Unix Technical Forum

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

This is a discussion on C embedded sql - Problems when using C preprocessor values in host variables declarations within the Sybase forums, part of the Database Server Software category; --> My code declares a HOST variable this way: #define NAME_LEN 80 .... EXEC SQL BEGIN DECLARE SECTION; char sqlName[NAME_LEN]; ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 03:05 PM
Gabriel
 
Posts: n/a
Default C embedded sql - Problems when using C preprocessor values in host variables declarations

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 03:05 PM
Neal
 
Posts: n/a
Default Re: C embedded sql - Problems when using C preprocessor values in host variables declarations

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com