470,868 Members | 1,924 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,868 developers. It's quick & easy.

Fetching from LONG in Pro*C

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
Jul 19 '05 #1
1 3316
Pedro Oguri wrote:
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

Google is your friend!

http://asktom.oracle.com/pls/ask/f?p...D:702825000306
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Shujun Huang | last post: by
12 posts views Thread by wenmang | last post: by
3 posts views Thread by wenmang | last post: by
22 posts views Thread by Sandman | last post: by
1 post views Thread by Pedro Oguri | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.