|
Re: .arr and .len [message #437074 is a reply to message #437069] |
Wed, 30 December 2009 22:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
calluru
Messages: 17 Registered: July 2009 Location: Austin, TX, USA
|
Junior Member |
|
|
When you declare a variable as VARCHAR in your Pro*C code between SQL DECLARE section, the Pro*C pre-compiler translates them into C structures. Within the structure the VARCHAR data will be stored in a string array called arr and the length of the string is stored in the member variable called len.
And whenever you fetch string values from database into one of these VARCHAR variables you would have to append the string with a null terminator. I think this is a C thing. Try printing these string values with and without the null terminator you will see it what I mean.
For more information look up for handling string in Pro*C.
-- Balaji
|
|
|
Re: .arr and .len [message #437113 is a reply to message #437069] |
Thu, 31 December 2009 02:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Quote:I am very new in pro*c. And currently still learning and try to understand the pro*c syntax.
A good reading to start using Pro*C: Pro*C/C++ Programmer's Guide
Quote:and used in the body like this:
NULLSTR(ID_NO)
where id_no is int type.
If what you say is real this should produce a compilation error.
Note that NULLSTR is a macro define in your program and is not part of Pro*C. Take care using it or you might overwrite your stack.
Regards
Michel
[Updated on: Thu, 31 December 2009 02:22] Report message to a moderator
|
|
|
|
|
|