1. paulo gomes
  2. SnapDevelop
  3. Tuesday, 10 December 2019 21:04 PM UTC

Hi All,

There is a blob column in one of our Oracle database that has to be displayed to the Users in our web site.

We are coding a new REST Web API that one of our web sites is consuming the methods.

The Snap Develop is the PB 2019, not the PB 2019 R2 Beta.

The following original PB statement 

    SELECTBLOB ANSWER_HTML INTO :lblob_temp FROM internet_faq WHERE INTERNET_FAQ_ID =           :as_primary_key_id;

was migrated manually to C# as

PbBlob  lblob_temp = null;                             //holds the blob column value retrieved; the column name is ANSWER_HTML

PbString answerString = "";                          //holds the string corresponding to the blob

var sqlStatement = new SqlQueryBuilder();    //the select created by the query builder


sqlStatement.Select("ANSWER_HTMl").From("internet_faq").WhereValue("INTERNET_FAQ_ID", as_primary_key);  
validSelect = sqlStatement.Validate(_dataContext, throwError: false);                //it returns True

Try

    {

     lblob_temp = _dataContext.SqlExecutor.Scalar<Byte[]>(sqlStatement, as_primary_key);

     answerString = lblob_temp.ToString();

     return answerString ;

     }

Catch(Exception msgError){return msgError.message; }

 

The select statement always returns no rows no matter which value as_primary_key is. No Exception is raised.

If the select is changed, for instance, to retrieve a non blob column with the same key it retrieves data, like

     sqlStatement.Select("QUESTION_TXT").From("internet_faq").WhereValue("INTERNET_FAQ_ID", as_primary_key);  

So the as_primary_key is being passed correctly.

 

Am I missing some C# construction?

Any ideas what could be?

 

Thank you.

Regards,

Paulo Gomes

pgomes@intervalintl.com

paulo gomes Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 22:19 PM UTC
  2. SnapDevelop
  3. # 1

Hi Govinda, thank you for the reply !

Yes, we have a POC to migrate a junk of PB NVOs to REST Web API with Snap Develop and PB 2019. This POC has to be deployed into Production until the end of January-2020 to be shown to the Senior Management.

It will give us an idea of time and resources needed to migrate the entire Application. Since we are not using the Migration Tool released in the R2 Beta, the expected time should be smaller than the one for the POC.

In parallel, we are evaluating the R2 Beta with just few PB NVO components. We are using other PCs, not the developments PCs in order to do not upgrade the development PB 2019.

However, in the PB 2019 development PC I tried to install the Power Script bridge using NuGet but received an "downgrade" error. This may explain why I have the PbBlob data type recognized from my PB 2019 Snap Develop: maybe some components could be installed and remains there.

I guess the best way to continue the POC is to go again with Snap Objects 1.0.1 as you mentioned.

And yes, tomorrow I'll document the R2 Beta issue with the PbBlob retrieve.

Thank you for the help.

 

Regards,

Paulo

pgomes@intervalintl.com

Comment
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 December 2019 14:56 PM UTC
  2. SnapDevelop
  3. # 2

Hi Paulo,

 

It is great news that you've decided to start using SnapObjects for your projects. I hope that my answer to your question is simple enough, yet very accurate to help you solve your problem.

 

By analyzing your code snippet here, I infer that you might have SnapDevelop 2019 installed. Yet, it might seem that you have the libraries for SnapObjects 2019 R2 Beta as well. I got to this conclusion because I see that you are using the data type PbBlob. So, this would most likely mean that you have the NuGet package PowerScript.Bridge added to your project. That library depends on the SnapObjects.Data (2.0.0 Beta) NuGet package. So, this would actually seem to be a possible bug for the R2 Beta release of SnapObjects.

 

My suggestion is that you try the same using the NuGet packages of version 1.0.1 of SnapObjects. Of course, you would need to find a replacement datatype for your variables because that version of SnapObjects cannot use the PbBlob datatype just yet. And, also please place a ticket so that we can analyze this issue in R2 Beta as well (this will be very helpful to us too).

 

I hope this is useful info for you.

 

Regards,

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.