dbTalk Databases Forums  

C embedded sql - Problems when using C preprocessor values in host variables declarations

comp.databases.sybase comp.databases.sybase


Discuss C embedded sql - Problems when using C preprocessor values in host variables declarations in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gabriel
 
Posts: n/a

Default C embedded sql - Problems when using C preprocessor values in host variables declarations - 11-12-2003 , 04:50 AM






My code declares a HOST variable this way:

#define NAME_LEN 80
....

EXEC SQL BEGIN DECLARE SECTION;
char sqlName[NAME_LEN];
....
EXEC SQL END DECLARE SECTION;

I precompile this way: "cpre -G -r -m -a myprogram.cp"

For some reason, within the .sql file this is declared as @sqlName
char(NAME_LEN), instead of @sqlName char(80).

Later, when I use isql to upload the store procedure, it fails saying
it doesn't recognize the variable NAME_LEN.

Is there any config option I should set to prevent this from
happening? I had a look at the messages in this group and didn't find
any on this.

I'm newbie on Sybase embedded SQL, so excuse my ingorance.

The Open client version is: CS_VERSION_110

Thanks in advance,

Gabriel.

Reply With Quote
  #2  
Old   
Neal
 
Posts: n/a

Default Re: C embedded sql - Problems when using C preprocessor values in host variables declarations - 11-12-2003 , 09:41 AM






I think that is a bug that has been fixed in the latest EBFs.
The bug number is:
216372 ESQL/C: cpre and cobre used with -G flag did not use
actual character array size for stored procedure's
parameter.

There was another similar bug that has also been fixed in recent EBFs:
239138 CPRE/COBPRE: When using -G option and an invalid stored
procedure parameter's character size is specified, this
is not defaulted to 255.

If it is still a problem after you apply the most recent EBF,
you should probably contact technical support.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.