1. Prajeesh Koothupalakkal
  2. PowerBuilder
  3. Thursday, 16 April 2020 08:16 AM UTC

Hello PB Experts,

I am having an issue with fetching value from a blob field using the SELECTBLOB statement.

My query is something like this,

SELECTBLOB object
INTO :lb_blob
FROM table
WHERE code = :code
USING SQLCA;

However, this is throwing SQL Error -9634: No cast from blob to byte.

My application is connecting to an Informix database.

Has anybody faced this issue? Your help is highly appreciated.

Thanks,

Prajeesh

 

Attachments (1)
Prajeesh Koothupalakkal Accepted Answer Pending Moderation
  1. Friday, 17 April 2020 03:20 AM UTC
  2. PowerBuilder
  3. # 1

Thanks for the response, Miguel.

I changed the DBParm parameter as you suggested but still no luck :(

Comment
  1. Prajeesh Koothupalakkal
  2. Sunday, 19 April 2020 06:27 AM UTC
Thanks, Miguel for your valuable guidance and time. And yes, I have created a ticket with Appeon.
  1. Helpful
  1. Prajeesh Koothupalakkal
  2. Monday, 20 April 2020 07:54 AM UTC
Hi Miguel,



I have fixed the problem. I created a view on the table that had the BLOB field and applied a cast on the BLOB field. The SELECTBLOB on this view works fine without any issues.



I really appreciate your time and response.



Thanks, Prajeesh
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 20 April 2020 20:11 PM UTC
Thanks for sharing
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 17 April 2020 02:35 AM UTC
  2. PowerBuilder
  3. # 2

The last time I used informix was in 1997 I think, but have a look at this dbparm connection parameter:

BinTextBlob

I'm not guaranteeing anything, but it's worth looking at (my memory is failing).

Try setting SQLCA.DBPARM = "BinTxtBlob=1" before doing your CONNECT to the database.

• 0 The blob contains a Unicode string. 
• 1 The blob contains any kind of data that is not regarded as a Unicode string. 

 

Who knows it solves the problem?

regards

Comment
There are no comments made yet.
Prajeesh Koothupalakkal Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 20:41 PM UTC
  2. PowerBuilder
  3. # 3

Hi Miguel,

Thanks for the response.

The type of this field in the database is "BLOB".

Cheers,

Prajeesh

 

Comment
  1. Miguel Leeuwe
  2. Friday, 17 April 2020 03:16 AM UTC
Ok, that means it can hold any kind of data, like binary data. (If you only store text, CLOB would be a better datatype).
  1. Helpful
  1. Prajeesh Koothupalakkal
  2. Friday, 17 April 2020 04:40 AM UTC
Thanks, Miguel but we are storing both images and RTF documents in this field. Btw, I tried creating another table with CLOB instead of BLOB, but it is throwing the same error.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 10:03 AM UTC
  2. PowerBuilder
  3. # 4

Hi, 

What type is the blob field in the database?

Comment
  1. Miguel Leeuwe
  2. Friday, 17 April 2020 02:28 AM UTC
I think that it should work, but look at my next answer as I have to paste some stuff.
  1. Helpful
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.