Hi, please apply patch below to correct the EXEC SQL CREATE SCHEMA
construct in ECPG. Currently (versions 7.3.x, 7.4) the preprocessor
emmits "create scheme" in error, rather than "create schema".
A workaround also exists for those who require it (but I guess no-one
apart from me does since it's went unreported through 7.3), rather
than (checking omitted):
EXEC SQL CREATE SCHEMA foo;
you can use:
EXEC SQL BEGIN DECLARE SECTION;
char l_cmd[50];
EXEC SQL END DECLARE SECTION;
snprintf(l_cmd, sizeof(l_cmd), "CREATE SCHEMA foo");
EXEC SQL EXECUTE IMMEDIATE :l_cmd;
Thanks, L.
*** src/interfaces/ecpg/preproc/preproc.y.orig 2003-11-19 10:52:25.000000000 +0000
--- src/interfaces/ecpg/preproc/preproc.y 2003-11-19 10:52:30.000000000 +0000
***************
*** 966,974 ****
*****************************************************************************/
CreateSchemaStmt: CREATE SCHEMA UserId OptSchemaName AUTHORIZATION UserId OptSchemaEltList
! { $$ = cat_str(6, make_str("create scheme"), $3, $4, make_str("authorization"), $6, $7); }
| CREATE SCHEMA ColId OptSchemaEltList
! { $$ = cat_str(3, make_str("create scheme"), $3, $4); }
;
OptSchemaName: ColId { $$ = $1; }
--- 966,974 ----
*****************************************************************************/
CreateSchemaStmt: CREATE SCHEMA UserId OptSchemaName AUTHORIZATION UserId OptSchemaEltList
! { $$ = cat_str(6, make_str("create schema"), $3, $4, make_str("authorization"), $6, $7); }
| CREATE SCHEMA ColId OptSchemaEltList
! { $$ = cat_str(3, make_str("create schema"), $3, $4); }
;
OptSchemaName: ColId { $$ = $1; }