473,320 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3419
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shujun Huang | last post by:
Hi, I am working on converting Informix database to Postgre. I have one question for fetching records using PostgreSQL. The record I am fetching is a variable size text string. Before fetching...
12
by: wenmang | last post by:
Hi, I am using following Oracle Proc-C compiler: Pro*C/C++: Release 8.1.7.0.0 - Production on Thu Jun 15 15:57:32 2006 (c) Copyright 2000 Oracle Corporation. All rights reserved. I like to...
3
by: wenmang | last post by:
Hi, I encountered a problem involving storage of unsigned long long. The requirement of incoming data field is an unsigned 64-bit integer, but on our system, due to lack of support of 64-bit...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
2
by: pallavi24 | last post by:
Hi I posted a query a few days bak saying that a join statement was taking very long time. The same query works fine in Oracle on the same tables but takes a very long time in MySQL. Both the...
5
by: Bhavesh | last post by:
Hello genious people, I m trying to insert a LARGE text from Multiline Textbox into my table of sqlserver2000. I m using vs-2005. Please note that I dont want to store blob data From FILE...
1
by: Bhavesh | last post by:
Hi Bruce, Thanks For Reply. U were right, Needed to pass string , but also need to pass size of Data( instead of 16, passed actual length of data). So that worked for me & didn't get any...
2
by: SunshineInTheRain | last post by:
I'm trying to modify a long long code within a button click by make the insert/update/delete/select using the same transaction. Purpose is to make sure every operation can be rollback instead of some...
1
by: Pedro Oguri | last post by:
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; } my_raw;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.