here is a code in embedded SQL(in c)
EXEC SQL BEGIN DECLARE SECTION
char *id = NULL;
EXEC SQL END DECLARE SECTION
.
. //here id is assigned value, printf("%s",id) gives an int i parsed into string
.
EXEC SQL SELECT * FROM table T WHERE T.id = :id
This code gives the following error,
SQLCODE : 4294966876
SQL0420N Invalid character found in a character string argument of the
function "DECFLOAT". SQLSTATE=22018
Can any tell what the problem is?
The datatype
char
is not the same asstring
. In PostgreSQL (and probably any other RDBMS)char
holds a single character. You cannot assign the string representation of an integer > 9.