473,398 Members | 2,404 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,398 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 3422
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.