Dear Thomas , Thanks for the info. , actually , Oracle Pre-compiler can do that and that's why we need this functionality in order to move our programs to use 'cpc' of MAXDB in case we want to replace Oracle DB by MAXDB.
Oracle replaces EXEC SQL cursor statements with "static const char *sqxxx" where it can be compiled , unlike , 'cpc' where surrounds it with {}. I still want to proceed in my trial , either to keep the Pre-compiled Oracle Pro*C programs as is and try to change the CONNECT parameter to connect to SAPDB OR try to find away to include all global variables inside functions. Regarding the example, am pretty sure that it does not work with me if I specify '-E cansi' regardless of '-c ' option , because of the macro thing. Yes I tried to compile with and without -c option , the result is the same. Here is how I compiled HelloUnicodeDB program : cpc -E cansi -S internal -H nocheck -o -u dbadmin,rami123 -d maxdb1 HelloUnicodeDB I have the following version of MS VC++ compiler: "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86" , runs over Toshiba / WINXP . and as I think I downloaded MAXDB ver. 7.6 Thanks a lot Thomas, Rami -----Original Message----- From: Simenec, Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 08, 2006 8:59 PM To: [EMAIL PROTECTED] Cc: maxdb@lists.mysql.com Subject: RE: MAXDB cpc precompiler Dear Rami, It is not possible to declare a cursor outside a C function. Since every EXEC SQL DECLARE call is mapped to a C Precompiler library function call that is surrounded with { }, you will always get a syntax error if you use that call outside a function. In general global embedded sql statements are not allowed. I did not get the error message concerning uuid if I try to compile the HelloUnicodeDB program. Did you try the cpc without the -c option? What type and version of C compiler do you use? Regards, Thomas Simenec SAP Labs Berlin -----Original Message----- From: Rami AL-SAHHAR [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 8. Februar 2006 17:19 To: maxdb@lists.mysql.com Subject: MAXDB cpc precompiler Importance: High Dear Sir, Can I declare cursor as global ( outside the main() )? I tried to do it , but it gives an error when I compile the generated C code. If I can do it , tell me how ? and what's the general rules to declare global embedded sql statement? Thanks Rami -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]