- paulo gomes
- SnapDevelop
- Tuesday, 10 December 2019 09: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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.