Read blob fields in Firebird.

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Tommi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 11.07.2008, 13:27

Read blob fields in Firebird.

Post by Tommi »

If I do:

SELECT myblobvalue FROM mytable WHERE id=2

I receive a null answer.
How can I do ?

Thank You
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Hi,

You need to add more infos:

1. Which Zeos version do you use?
2. Is that field a not null field?
3. Silly questions .. is there some data on that field? and if you type
"select * FROM mytable WHERE id=2" the result is one or more record?

4. Is a blob subtype 0 or 1? (I mean is a binary or text blob)?
Tommi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 11.07.2008, 13:27

Post by Tommi »

seawolf wrote:Hi,

You need to add more infos:

1. Which Zeos version do you use?
2. Is that field a not null field?
3. Silly questions .. is there some data on that field? and if you type
"select * FROM mytable WHERE id=2" the result is one or more record?

4. Is a blob subtype 0 or 1? (I mean is a binary or text blob)?
1. 6.6.3 Stable
2. Yes, is a not null field
3. Yes there are datas and there are more than one record (ID is not primary key)
4. Blob Field contains binary data, when I create it in my CREATE statement I define it:
...,MyBlobField BLOB NOT NULL);

When I fill my fields I do:

(For example Stringa:='INSERT INTO originali (crclink,dati) VALUES(336426043390699390,:kBlob0)'
and ValoreStr is an array of strings)

Code: Select all

  ...
  ...
  try
    ZQuery1.SQL.Clear;
    ZQuery1.Params.Clear;
    ZQuery1.SQL.Add(stringa);
    if NumStr > 0 then
      for a:=0 to NumStr -1 do
      begin
        ZQuery1.Params.CreateParam(ftBlob,'kBlob'+inttostr(a),ptInput);
   Query1.Params.ParamByName('kBlob'+inttostr(a)).AsBlob:=ValoreStr[a];
      end;
    ZQuery1.ExecSQL;
    result:=true;
  except
  ....
  ....
  ....
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

It looks like Blob is a primary key or a part of .. why don't you use a generator instead of a Blob? (or something else)?
Tommi
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 11.07.2008, 13:27

Post by Tommi »

seawolf wrote:It looks like Blob is a primary key or a part of .. why don't you use a generator instead of a Blob? (or something else)?
I finally solved my issue, thank you
Post Reply