Subject | Re: IBQuery and Token Unknown for COMMIT, SET, and TERM |
---|---|
Author | Svein Erling Tysvær |
Post date | 2006-01-25T09:35:56Z |
I don't use TIBO* components myself, but to me it seems like you are
confused about their use. My belief is that a TIBOQuery is for one
simple select statement, not entire scripts. Try using a TIB_Script
component, it should be able to handle the code you've provided.
HTH,
Set
confused about their use. My belief is that a TIBOQuery is for one
simple select statement, not entire scripts. Try using a TIB_Script
component, it should be able to handle the code you've provided.
HTH,
Set
--- In IBObjects@yahoogroups.com, "bmckenna6" wrote:
> w/IBODatabase, IBQuery and FB 1.0.0.794
>
> When I execute the complete script below in IB_SQL
> (as a new db with the required GENERATOR), it returns
> without error.
>
> When I run it through IBOQuery flattened out as a single
> string, it returns "Token Unknown" on the first COMMIT.
>
> (The rationale for this is that the 'DBNOTES1' in the script
> below gets replaced in the string so that I can create
> additional tables.)
>
> If I remove that first COMMIT, it returns "Token Unknown"
> on SET in the SET TERM in preparation for the trigger.
>
> The script (sections):
>
> CREATE TABLE DbNotes1(
> NoteID INTEGER NOT NULL PRIMARY KEY,
> Subject VARCHAR(36) NOT NULL UNIQUE,
> Notes BLOB,
> CreateDateStmp DATE,
> CreateTimeStmp TIME,
> EditDateStmp DATE,
> EditTimeStmp TIME
> );
> COMMIT;
>
> /* The generator referred to below is already
> created in the db */
>
> SET TERM !! ;
> CREATE TRIGGER BI_DBNOTES1 FOR DBNOTES1
> ACTIVE BEFORE INSERT
> AS
> BEGIN
> IF (NEW.NOTEID IS NULL) THEN
> NEW.NOTEID = GEN_ID(NOTEID_GEN, 1);
> END!!
> SET TERM ; !!
> COMMIT;
>
> CREATE INDEX DbNotes1SubIdx ON DbNotes1(Subject);
> COMMIT;
>
> If I eliminate the first COMMIT after the CREATE TABLE
> and ExecSQL (runs OK), Close and Clear that IBOQuery, and
> then run IBOQuery.SQL for the SET TERM trigger script (above),
> it returns "Token Unknown" for TERM.
>
> I presume that there are some clues to running DSQL
> through an IBQuery (or other similar components)
> that I need to become aware of.