How can I fetch a LONG type into a C variable using Pro*C compiler?
What´s wrong with this code?
typedef struct TAGmy_raw
{
long len;
unsigned char arr[2000000];
}
my_raw;
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL TYPE my_raw IS LONG;
my_raw buffer;
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT LONG_COLUMN
INTO :buffer
FROM TABLE_X
WHERE ID=1;
The code, compiles and executes it.
But buffer.len and buffer.arr return all zeroed
This insertion code works OK though:
EXEC SQL
INSERT INTO TABLE_X (LONG_COLUMN)
VALUES (:var);
Any help?
Tks,
Pedro Oguri
What´s wrong with this code?
typedef struct TAGmy_raw
{
long len;
unsigned char arr[2000000];
}
my_raw;
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL TYPE my_raw IS LONG;
my_raw buffer;
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT LONG_COLUMN
INTO :buffer
FROM TABLE_X
WHERE ID=1;
The code, compiles and executes it.
But buffer.len and buffer.arr return all zeroed
This insertion code works OK though:
EXEC SQL
INSERT INTO TABLE_X (LONG_COLUMN)
VALUES (:var);
Any help?
Tks,
Pedro Oguri
Comment