0

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?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Vishal
  • 989
  • 2
  • 11
  • 19

1 Answers1

1

The datatype char is not the same as string. In PostgreSQL (and probably any other RDBMS) char holds a single character. You cannot assign the string representation of an integer > 9.

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228