Subject Re: [ib-support] Re: Problems with Firebird 1.0 and Dialect 3
Author Helen Borrie
At 12:59 PM 11-09-02 +0000, you wrote:
>I tried the following:
>
>1. isql -extract -output gms1.sql grantmgt.gdb
>2. added to statements to script
>
> SET SQL DIALECT 2;
> OUTPUT RESULTS.TXT;
> CREATE DATABASE 'D:\100\Grantmgt.gdb'
> USER 'SYSDBA' PASSWORD 'masterkey'
> PAGE_SIZE 4096;
>
>3. isql -i
>
>The ISQL output only suggested problems with four triggers. These
>triggers work in Dialect 1 and do not seem to be related to the
>errors I am seeing in stored procedure executions. Moreover, I do not
>understand the problem with these triggers. An example of the ISQL
>Dialect 2 problem with one of the four triggers is below:
>
>**** Error preparing statement:
>
>CREATE TRIGGER APPLICATION_AI_EDIT_LOG FOR APPLICATION
>ACTIVE AFTER INSERT POSITION 1
>as
>DECLARE VARIABLE InsertID INTEGER;
>DECLARE VARIABLE InsertSUBMITDATE DATE;
>DECLARE VARIABLE InsertPROJECTYEAR CHAR(2);
>DECLARE VARIABLE InsertSTARTDATE DATE;
>DECLARE VARIABLE InsertENDDATE DATE;
>DECLARE VARIABLE InsertAPPLICANTNAME VARCHAR(80);
>DECLARE VARIABLE InsertIMPLEMENTINGORG VARCHAR(80);
>DECLARE VARIABLE InsertPROJECTDIRECTOR VARCHAR(35);
>DECLARE VARIABLE InsertFISCALOFFICER VARCHAR(35);
>DECLARE VARIABLE InsertFEDFUNDS NUMERIC(15,2);
>DECLARE VARIABLE InsertSTATEFUNDS NUMERIC(15,2);
>DECLARE VARIABLE InsertSTATEMATCH NUMERIC(15,2);
>DECLARE VARIABLE InsertLOCALMATCH NUMERIC(15,2);
>DECLARE VARIABLE InsertPRIVATEMATCH NUMERIC(15,2);
>declare variable InsertSTATUS CHAR(1);
>DECLARE VARIABLE CriticalFieldChanged integer;
>BEGIN
> InsertID = GEN_ID(EDITS_APPLICATION,1);
> InsertSUBMITDATE = new.submitdate;
> InsertPROJECTYEAR = new.PROJECTYEAR;
> InsertSTARTDATE = new.STARTDATE;
> InsertENDDATE = new.ENDDATE;
> InsertAPPLICANTNAME = new.APPLICANTNAME;
> InsertIMPLEMENTINGORG = new.IMPLEMENTINGORG;
> InsertPROJECTDIRECTOR = new.PROJECTDIRECTOR;
> InsertFISCALOFFICER = new.FISCALOFFICER;
> InsertFEDFUNDS = new.FEDFUNDS;
> InsertSTATEFUNDS = new.STATEFUNDS;
> InsertSTATEMATCH = new.STATEMATCH;
> InsertLOCALMATCH = new.LOCALMATCH;
> InsertPRIVATEMATCH = new.PRIVATEMATCH;
> InsertSTATUS = new.applstatuscode ;
> INSERT INTO EDITSAPPLICATIONTABLE
> (ID,
> APPLICATIONNBR,
> EMPID_LASTUPDATE,
> DATEOFEDIT,
> SUBMITDATE,
> PROJECTYEAR, <---- are you sure this is char(2)
> STARTDATE,
> ENDDATE,
> APPLICANTNAME,
> IMPLEMENTINGORG,
> PROJECTDIRECTOR,
> FISCALOFFICER,
> FEDFUNDS,
> STATEFUNDS,
> STATEMATCH,
> LOCALMATCH,
> PRIVATEMATCH,
> STATUS)
> VALUES(
> :InsertID,
> new.applicationnbr,
> new.empid_lastupdate,
> 'NOW', <------------------- cast('NOW' as Timestamp)
> :InsertSUBMITDATE,
> :InsertPROJECTYEAR,
> :InsertSTARTDATE,
> :InsertENDDATE,
> :InsertAPPLICANTNAME,
> :InsertIMPLEMENTINGORG,
> :InsertPROJECTDIRECTOR,
> :InsertFISCALOFFICER,
> :InsertFEDFUNDS,
> :InsertSTATEFUNDS,
> :InsertSTATEMATCH,
> :InsertLOCALMATCH,
> :InsertPRIVATEMATCH,
> :InsertSTATUS);
>END

IOW, check all date types and also things that previously used implicit
casting.

Also, why all these variables, when you already have the new. context
variables you can use directly?

heLen