In our database we have a certain set of "base" tables, each of which has an associated "log" table. For instance, there are the tables project and logproject, filter and logfilter, etc. We also have a simple utility that creates backup copies of the base tables. Here is a simplified version of the code:
<a name=backupDatabase PUBLIC source timestamp>
<$BACKUP_PREFIX="BU">
<apicp allinear 1>
<sql db=$source ROW "select NAME from SYSTABLES where NAME like 'log*'">
<substr $NAME 3 -1>
<$baseTable=$ret>
<strfmt "create table %s%s%s as select * from %s" $BACKUP_PREFIX $timestamp $baseTable $baseTable>
<sql db=$source $ret></sql>
</sql>
</a>
The select query retrieves the name of each log table, and the base table is extracted from that. Then a create table statement is built, executed and voila! This works fine when called with code such as:
<$theDb="D:\TheDBPath">
<sql "select counter whenBackedUp"></sql>
<backupDatabase source=$theDb timestamp=$whenBackedUp>
The problem is when I submit a URL to run the same utility on a remote server. In the same vortex script file is the following function:
<a name=launchBackupDatabase PUBLIC>
<backupDatabase source=$theDb timestamp=$whenBackedUp>
</a>
When the code issues a URL such as:
http://our.remote.server/texiscgi/texis ... edUp=12345
we get the following errors in the vortex log (one for each create table statement that it attempted to run):
015 [synchronizer]:575: Line 1: syntax error at ";"
000 [synchronizer]:575: SQLPrepare() failed with -1 in the function prepntexis
Line 575 is the line that reads "<sql db=$source $ret></sql>" in the function backupDatabase. I don't get why it's saying there is a syntax error at ";" since there is no semicolon in the create table statement that the function produces. I'm logging the sql statements in a separate text file on the remote server, and this is what's in that log (one line like this for each create table statement):
Thu Jul 28 19:59:48 Eastern Daylight Time 2011 [create table BU12345project as select * from project]
All of the statements are syntactically correct. Perhaps I'm missing something obvious. Thanks for your help.
<a name=backupDatabase PUBLIC source timestamp>
<$BACKUP_PREFIX="BU">
<apicp allinear 1>
<sql db=$source ROW "select NAME from SYSTABLES where NAME like 'log*'">
<substr $NAME 3 -1>
<$baseTable=$ret>
<strfmt "create table %s%s%s as select * from %s" $BACKUP_PREFIX $timestamp $baseTable $baseTable>
<sql db=$source $ret></sql>
</sql>
</a>
The select query retrieves the name of each log table, and the base table is extracted from that. Then a create table statement is built, executed and voila! This works fine when called with code such as:
<$theDb="D:\TheDBPath">
<sql "select counter whenBackedUp"></sql>
<backupDatabase source=$theDb timestamp=$whenBackedUp>
The problem is when I submit a URL to run the same utility on a remote server. In the same vortex script file is the following function:
<a name=launchBackupDatabase PUBLIC>
<backupDatabase source=$theDb timestamp=$whenBackedUp>
</a>
When the code issues a URL such as:
http://our.remote.server/texiscgi/texis ... edUp=12345
we get the following errors in the vortex log (one for each create table statement that it attempted to run):
015 [synchronizer]:575: Line 1: syntax error at ";"
000 [synchronizer]:575: SQLPrepare() failed with -1 in the function prepntexis
Line 575 is the line that reads "<sql db=$source $ret></sql>" in the function backupDatabase. I don't get why it's saying there is a syntax error at ";" since there is no semicolon in the create table statement that the function produces. I'm logging the sql statements in a separate text file on the remote server, and this is what's in that log (one line like this for each create table statement):
Thu Jul 28 19:59:48 Eastern Daylight Time 2011 [create table BU12345project as select * from project]
All of the statements are syntactically correct. Perhaps I'm missing something obvious. Thanks for your help.