IB-native IN-parameter value create failed

Discuss a software development with IBProvider

IB-native IN-parameter value create failed

Postby paulhughes » 08 Jun 2009, 06:22

Hi,

The full error is:
IB-native IN-parameter value create failed. Position 1.
Write BLOB: User storage-object works incorrectly

I'm using D2009 with the trial LCPI OLE DB Provider for Interbase [v3][RC4] and FireBird 2.5.

I'm trying to move data from a Paradox table containing an image ftBlob field via a TADOQuery connected to FireBird which has a BLOB SUB_TYPE 0 field defined.

I get the above error on the image field when trying to post the record.

The ADOQuery SQL is simply SELECT * FROM MyTableName WHERE 0 = 1 and it does an Append, Post for each record.

To assign the image data I've tried:
DestField.AsBytes := SourceField.AsBytes
DestField.AsString := SourceField.AsString
DestField.Assign(SourceField)

How can I get the image from the Paradox table into the ADOQuery and update the FB table please?

Regards, Paul.
paulhughes
 
Posts: 16
Joined: 18 May 2009, 17:52

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jun 2009, 10:57

Hello

Could you show your code or write a small _full_ sample with copy data between tables through ADOExpress (dbGo)?
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jun 2009, 11:27

Hello, again

Or, as variant, try to use an explicit SQL statement:

"INSERT INTO ..."

See sample code for work with BLOB parameters in "Samples\adoexpress\001_blob_samples\main.cpp"
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby paulhughes » 08 Jun 2009, 15:08

Hi,

Please see example attached.

Regards, Paul.
Attachments
ADO-FB-Blob.zip
(7.08 KiB) Downloaded 92 times
paulhughes
 
Posts: 16
Joined: 18 May 2009, 17:52

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jun 2009, 17:10

Ok, I found and fix the this problem

Thanks.
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby paulhughes » 08 Jun 2009, 17:58

OK, good.

Does that mean it will be available in the next release of your provider? Do you know when that might be?

Is there anything I can do in the meantime?

Regards, Paul.
paulhughes
 
Posts: 16
Joined: 18 May 2009, 17:52

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jun 2009, 19:10

paulhughes wrote:Does that mean it will be available in the next release of your provider? Do you know when that might be?


Yes, ofcourse. I think, the next release will be tomorrow :)

You can write to ibprovider@ibprovider.com for get the build (with fix for this problem) now
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby salim_naufal » 08 Jul 2009, 13:37

Using Delphi 2009 and IBProvider Verion 7446 (the latest)
using the ADOQuery component to insert into a Firebird 2.1.X database, I get this error.
My ADOQuery is something like:
INSERT INTO <mytable>
( f1, f2..., fn)
VALUES
( :f1, :f2 ..., :fn)

One of the fields is a BLOB.

To insert, I use:
MyADOQuery.Parameters.ParamByName('<fn>').Value := MyAdoSourceQuery.FieldByName('<fn>').Value

for strings, integers, and floats

and

MyADOQuery.Parameters.ParamByName('<fn>').Assign(MyAdoSourceQuery.FieldByName('<fn>'))

for blobs.

When the source had a Null blob field, I do not assign anything. In all cases, the error message is generated.

Any suggestions?

Thanks

Salim
salim_naufal
 
Posts: 6
Joined: 08 Jul 2009, 13:09

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jul 2009, 13:43

1. I do not see the error message.
2. Why you do not uses a dest.Value=source.Value for BLOB?
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby salim_naufal » 08 Jul 2009, 13:54

I tried that and had the same error.
I could prepare a small test sample that reproduces the problem. Do you have Delphi 2009?
salim_naufal
 
Posts: 6
Joined: 08 Jul 2009, 13:09

Re: IB-native IN-parameter value create failed

Postby salim_naufal » 08 Jul 2009, 14:14

The problem occurs when we must assign a null value to the blob.
either assigning nothing or doing

MyAdoQuery.Parameters.ParamByName('<MyBlobField>').Value := Null

fails
salim_naufal
 
Posts: 6
Joined: 08 Jul 2009, 13:09

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jul 2009, 14:41

Target BLOB-column has a "NOT NULL" signature?
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby salim_naufal » 08 Jul 2009, 14:49

No, Target blob can be null. I tested with two tables:

CREATE TABLE T1
( ID INTEGER NOT NULL,
B BLOB SUB_TYPE 1 SEGMENT SIZE 80,
CONSTRAINT PK_T1 PRIMARY KEY(ID)
)

CREATE TABLE T2
( ID INTEGER NOT NULL,
B BLOB,
CONSTRAINT PK_T2 PRIMARY KEY(ID)
)

I could not succeed in setting the values of the blobs to null in the adoQuery containing the insert statement.
salim_naufal
 
Posts: 6
Joined: 08 Jul 2009, 13:09

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 08 Jul 2009, 15:27

Hi

I write small test in BCB5.

And test IBProvider v3

No problem with assign of Null.

But I get a problem with Execute (Can't translate VARIANT_With_NULL) :-(

I already fixed a similar problem with arrays, but I do not thinking about BLOB.

Could you send to me GDB file and exe of your test application to ibprovider@ibprovider.com

Or attach they to your message on this forum

And say to me the version of IB/FB
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Re: IB-native IN-parameter value create failed

Postby Kovalenko Dmitry » 09 Jul 2009, 11:30

All binaries (trial, free and professional) were refreshed

I hope, NULL problem was completely solved

Amin
Kovalenko Dmitry
Site Admin
 
Posts: 621
Joined: 17 Nov 2005, 20:51
Location: Russia, Lipetsk

Next

Return to Programming with IBProvider

Who is online

Users browsing this forum: No registered users and 1 guest

cron