Subject another issue with blobs
Author Francesco Lamonica
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

if i run the following code

int
FBWrapper::execute_iquery2(QString s, ISC_QUAD bid)
{
XSQLDA *in_sqlda;
ISC_QUAD blob_id;
isc_stmt_handle stmt;

stmt=NULL;
blob_id=bid;

in_sqlda = (XSQLDA *)malloc(XSQLDA_LENGTH(2));
in_sqlda->version=SQLDA_VERSION1;
in_sqlda->sqln=2;

in_sqlda->sqlvar[0].sqldata = (char *) &blob_id;
in_sqlda->sqlvar[0].sqltype = SQL_BLOB+1;
in_sqlda->sqlvar[0].sqllen = sizeof(ISC_QUAD);

char *str=(char*)malloc(s.length() +1);
strcpy(str,s);

qDebug("Execution of %s in progress...",str);
isc_dsql_execute_immediate(status_vector, &dbh, &trans,0,str,3,in_sqlda);
qDebug("execution done");

free(str);
return check4errors();
}

i get the following output

Execution of INSERT INTO Allegati VALUES
(gen_id(GenID_Allegato,1),989,'/home/franci/20056.jpg',?) in progress...
execution done
SQL error
SQLCODE: -804
SQL ERROR:
An error was found in the application program input parameters for the SQL
statement.

ISC STATUS:
Dynamic SQL Error
- -SQL error code = -804
- -SQLDA missing or incorrect version, or incorrect number/type of variables

is there a way to get more info about what i am doing wrong?

thanks a lot

- --
Francesco Lamonica: f DOT lamonica AT tin DOT it

PGP Fingerprint: 5870 92BA 8DFF 1ACF DE2E B94D 46EC 5505 7C64 4EF1
Favourite quote: There's no spoon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/TsE4RuxVBXxkTvERAtdoAKD/RlrSE2fINZ2br/Rg9Cr5aT5c+gCgkd16
KNL9VG8AWiRbmXpuQq/BAwc=
=74jR
-----END PGP SIGNATURE-----