[Sqlrelay-discussion] Bind (bytea) with Postgresql
Brought to you by:
mused
|
From: Marcel C. P. <mpa...@mt...> - 2006-04-07 09:51:22
|
Hi,
I use sqlrelay 36.4 with the programming language C.
with the following code:
/* C-CODE */
FILE *file;
char *fileName="input.dat";
long id = 1;
unsigned int len = 14112;
file = fopen(fileName, "r");
char data[len+1];
if( fread(data, 1, len, file) != len )
printf ("NOK\n");
data[len]=NULL;
fclose(file);
sqlrcur_prepareQuery(cur, "UPDATE data SET info = ? WHERE id = ?");
sqlrcur_inputBindBlob(cur, "1", data, len);
sqlrcur_inputBindLong(cur, "2", id);
if (!sqlrcur_executeQuery(cur))
printf (" %s\n", sqlrcur_errorMessage(cur));
/* C-CODE END */
This returns an error (cur.getErrorMessage):
ERROR: syntax error at or near "WHERE" at character 42
Attempted Query:
UPDATE queue_job_info SET job_request = ? WHERE job_id = ?
For what do I make wrong around blob to read/write?
Thanks and Regards,
Marcel C. Pantigny
--
______________________________
media transfer AG
Dipl.-Ing. Marcel C. Pantigny
Dolivostrasse 11
D-64293 Darmstadt
Germany
Tel : +49 61 51 81 93 36
Fax : +49 61 51 81 93 41
E-Mail: MPa...@mt...
Web : http://www.mtg.de
______________________________
|