Home » Infrastructure » Linux » Embedded SQL in Linux Pro*C
icon5.gif  Embedded SQL in Linux Pro*C [message #235654] Mon, 07 May 2007 10:42 Go to next message
cleopard
Messages: 10
Registered: June 2005
Junior Member
I'm getting this in a Pro*C program with embedded SQL that I've been modifying on Linux:


rm: cannot lstat `test_data.exe': No such file or directory
rm: cannot lstat `test_data.o': No such file or directory
test_data.pc: In function `write_values':
test_data.pc:3179: cannot convert to a pointer type
test_data.pc:3179: warning: integer overflow in expression
test_data.pc:3179: cannot convert to a pointer type
test_data.pc:3179: warning: integer overflow in expression


And line 3179 looks like:

EXEC SQL SELECT COUNT(*) INTO :count FROM SER_NUM
WHERE
SER_NUM = :ser_num_pfx||:ser_num_base;

'ser_num_pfx' and 'ser_num_base' are both VARCHARs, 3 and 5 characters in length, respectively; 'count' is 'int'.
Re: Embedded SQL in Linux Pro*C [message #235720 is a reply to message #235654] Mon, 07 May 2007 14:59 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>'ser_num_pfx' and 'ser_num_base' are both VARCHARs, 3 and 5 characters in length, respectively; 'count' is 'int'.
Don't strings need to be enclosed by single quote marks?
I don't any in what you posted.
Re: Embedded SQL in Linux Pro*C [message #235732 is a reply to message #235720] Mon, 07 May 2007 15:44 Go to previous messageGo to next message
cleopard
Messages: 10
Registered: June 2005
Junior Member
'ser_num_pfx' and 'ser_num_base' are bind variables. When using SQL within a C program, variables like this are used in an SQL statement, and are declared within an 'EXEC SQL DECLARE' section as, in this case', VARCHAR (3 and 5 characters, respectively). When they're referred to in an SQL statement, a colon is placed in front of each one and in this example, the prefix and base are being concatenated.
icon6.gif  Re: Embedded SQL in Linux Pro*C [message #236671 is a reply to message #235654] Thu, 10 May 2007 10:52 Go to previous message
cleopard
Messages: 10
Registered: June 2005
Junior Member
That error had been messing with me for a couple of weeks and finally, for some reason, after making some other changes in the code (but in a different routine), I ran my 'build' script and it compiled and linked, and I don't know what the deal is. I made no changes to those lines in question, but now things are OK. Go figure.
Previous Topic: Error whn trying to install Oracle on Linux.
Next Topic: crontab is not working today
Goto Forum:
  


Current Time: Fri Dec 09 05:39:38 CST 2016

Total time taken to generate the page: 0.14082 seconds