GLOBAL TEMPORARY TABLES from Pro*C [message #328228] |
Thu, 19 June 2008 07:14  |
donato
Messages: 53 Registered: November 2007 Location: Barcelona, Spain
|
Member |
|
|
Hi all again!
My source code is:
#include <sqlca.h>
#define SQLCODE sqlca.sqlcode
void main()
{
EXEC SQL
CREATE GLOBAL TEMPORARY
TABLE table_temp
(col1 number);
return(SQLCODE);
}
I'm compiling with this options:
MODE=ANSI CLOSE_ON_COMMIT=NO DYNAMIC=ANSI CODE=ANSI_C
USERID=ORACLE/ORACLE@MYDB
The first error I obtain is:
TABLE table_temp
..........1
PCC-S-02201, Se ha encontrado el símbolo "TABLE" cuando se esperaba uno de los siguientes:
; random_terminal
(...)
Can anybody help me, please? Thanks in advance!
|
|
|
Re: GLOBAL TEMPORARY TABLES from Pro*C [message #328474 is a reply to message #328228] |
Fri, 20 June 2008 05:23   |
donato
Messages: 53 Registered: November 2007 Location: Barcelona, Spain
|
Member |
|
|
Hello!
I solved it. Well, is another way to do it, more than a solution. I use 'EXECUTE IMMEDIATE':
void main()
{
EXEC SQL BEGIN DECLARE SECTION;
char query[1000];
EXEC SQL END DECLARE SECTION;
sprintf(query, "CREATE GLOBAL TEMPORARY TABLE tmp_table (col1 number)");
EXEC SQL EXECUTE IMMEDIATE :query;
(...)
}
Regards!
|
|
|
|