Subject Re: [ib-support] XCase and Interbase 6
Author Paul Reeves
Carlo Pettirossi wrote:
>
> At 21.27 07/02/01 +0100, you wrote:
> >Carlo Pettirossi wrote:
> >
> >The first statement to set the terminator:
> >
> > > set TERM^;
> >
> >[snipped]
> >
> >
> >is not the corollory of the second to reset it:
> >
> > > set TERM ;^
> >
> >
> >If you look closely in the example I wrote (for the first instance) :
> >
> >set term ^;
> >
> >Note the space between term and ^;
> >
> >
> >And please, please, please don't post in html.
> >
> >Paul
> >--
>
> Hi,
>
> I'm here with the damn script generated as before by Xcase once more.
> The question is: is it now correct or not?
>
> SET TERM ^;
> CREATE TABLE MyTable
> (
> ID INTEGER NOT NULL,
> IDSECONDTABLE INTEGER NOT NULL,
> FIELDNAME VARCHAR(50),
> FIELDVALUE BLOB SUB_TYPE 1 SEGMENT SIZE 80,
> FIELDLINK VARCHAR(100),
> CONSTRAINT RDB$PRIMARY56 PRIMARY KEY (ID)
> )
> ^
> CREATE TRIGGER T_BI_MyTable FOR MyTable BEFORE INSERT AS
> DECLARE VARIABLE row_count INTEGER;
> BEGIN
>
> IF (new.IDSECONDTABLE is not null) THEN
> BEGIN
> SELECT COUNT(*)
> FROM SITES
> WHERE SECONDTABLE.ID = NEW.IDSECONDTABLE
> INTO :row_count ;
> IF (row_count = 0) THEN
> BEGIN
> EXCEPTION xc_i_res ;
> END
> END
> END
> ^
> SET TERM ;^
>
> Anyway the error message is now:
>
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 9, char 17
> ?
> Statement: CREATE TRIGGER .... (then goes on to the end script)
>
> Any suggestion is welcome.
> Bye
>

Well, it worked for me. (I changed the reference from SITES to RDB$DATABASE and
replaced your exception with a valid one of my own. Other than that I ran the
script as above.)


Paul
--

Paul Reeves
http://www.ibphoenix.com
taking InterBase further