Page 1 of 1

apicp question

Posted: Mon Apr 25, 2011 12:31 pm
by barry.marcus
In our Vortex scripts we often precede calls to <sql> with calls to <apicp> to set one parameter or another for the sql call to follow. In some of those sql calls I'm now wanting to override the default database by (i.e., the one set with <db>) using

<sql db=$theNonDefaultDb ...>

Do the calls to apicp that precede this apply to the default database or to the database specified in the <sql> call? That is, is it necessary to do something like this instead:

<db=$theNonDefaultDb>
<sql ...>
<db=$theDefaultDb>

which seems just ever so lightly less elegant!

Thanks.

apicp question

Posted: Mon Apr 25, 2011 12:45 pm
by Kai
<apicp> calls apply to whatever <sql> etc. calls follow, regardless of database (either default or <sql>-specified). So you can change databases in the <sql> call after the <apicp>, and the <apicp> will still take effect; you do not need to change DBs before the <apicp>.

apicp question

Posted: Mon Apr 25, 2011 12:48 pm
by barry.marcus
Great! Thanks.