Hi.

I'm writing code that calls "database independant" functions, which are mapped
to the the appropriate real functions at build time. Variables come in as parameters,
and are declared outside of the .cpc code.

What I'm finding is that I'm copying data into char[] inside the functions for
the sake of "correctness", eg:
exec sql begin declare section;
char serverdb[19], servernode[65], dbuser[33], dbpass[33];
exec sql end declare section;

/* copy the real values */
strncpy(serverdb, myOptions.database, 18);
....

This works, and produces no errors, but is it really necessary?

A more concise version also works but produces warnings, eg:
exec sql begin declare section;
char *serverdb, *servernode, *dbuser, *dbpass;
exec sql end declare section;

serverdb = myOptions.database;
...

Any pointers from more cluefull precompiler folk? Is there an all together better
way? :-)
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to