Fetching from LONG in Pro*C
From: Pedro Oguri <pedro_oguri_at_yahoo.com>
Date: 19 Jun 2004 12:28:31 -0700
Message-ID: <8f67ef74.0406191128.6cb5202d_at_posting.google.com>
How can I fetch a LONG type into a C variable using Pro*C compiler? What´s wrong with this code?
WHERE ID=1; The code, compiles and executes it.
But buffer.len and buffer.arr return all zeroed
Date: 19 Jun 2004 12:28:31 -0700
Message-ID: <8f67ef74.0406191128.6cb5202d_at_posting.google.com>
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
Received on Sat Jun 19 2004 - 21:28:31 CEST