Subject Re: [firebird-support] Timestamp in SP
Author Helen Borrie
At 10:42 AM 2/08/2004 +0200, you wrote:
>Hi all,
>sorry, that I didn't give all.
>
>Am Montag, 2. August 2004 08:56 schrieb Helen Borrie:
> > At 08:42 AM 2/08/2004 +0200, you wrote:
> > > > No, not at all. But SQL error -104 is a very broad "parent" for dozens
> > > > of language validity errors. Can you catch the gdscode? - that's the
> > > > 9-digit error code.
> > >
> > >335544569
> >
> > That's a DSQL error, and there should have been a text message with it.
>
>Token unknown - line 1, char 45 1.

If it's not a bug in the debugger, and that is a genuine message from the
server, then it means you probably have a "stray" character "1" on the
first line of the SP, with 32 blanks between "SET TERM ^^ ;" and this stray
character.



>SET TERM ^^ ;
>CREATE PROCEDURE P_GETAENDLIST (
> DIENST SmallInt,
> VEREIN SmallInt)
>AS
>/*
> Procedure: GETAENDLIST
>
> Author : Walter Neumann
> Date : 18. 5. 2004
> Purpose : Daten für Änderungslisten generieren
> Params
> ------
> <param> : <purpose>
>*/
>DECLARE VARIABLE PID INTEGER;
>DECLARE VARIABLE TDAT DATE;
>DECLARE VARIABLE TWO VARCHAR(100);
>DECLARE VARIABLE TMELDDAT TIMESTAMP;
>DECLARE VARIABLE TAENDDAT TIMESTAMP;
>DECLARE VARIABLE BID INTEGER;
>DECLARE VARIABLE LEISTID SMALLINT;
>DECLARE VARIABLE ABBETR DATE;
>DECLARE VARIABLE ABGRU SMALLINT;
>DECLARE VARIABLE ABBEM VARCHAR(100);
>DECLARE VARIABLE ABMELDD TIMESTAMP;
>DECLARE VARIABLE ABMELD CHAR(1);
>DECLARE VARIABLE ABMELDK CHAR(1);
>DECLARE VARIABLE BISBETR DATE;
>DECLARE VARIABLE BISGRU SMALLINT;
>DECLARE VARIABLE BISBEM VARCHAR(100);
>DECLARE VARIABLE BISMELDD TIMESTAMP;
>DECLARE VARIABLE BISMELD CHAR(1);
>DECLARE VARIABLE BISMELDK CHAR(1);
>DECLARE VARIABLE PAENDD TIMESTAMP;
>DECLARE VARIABLE STUND NUMERIC(9,2);
>DECLARE VARIABLE ABBETRALT DATE;
>DECLARE VARIABLE BISBETRALT DATE;
>DECLARE VARIABLE BISMELDDALT TIMESTAMP;
>DECLARE VARIABLE BISMELDALT CHAR(1);
>DECLARE VARIABLE STUNDALT NUMERIC(9,2);
>DECLARE VARIABLE LNR INTEGER;
>DECLARE VARIABLE STPKTOLD SMALLINT;
>DECLARE VARIABLE GEDRUCKT SMALLINT;
>DECLARE VARIABLE DIENST1 SMALLINT;
>DECLARE VARIABLE DIENST2 SMALLINT;
>DECLARE VARIABLE DIENST3 SMALLINT;
>DECLARE VARIABLE DIENST4 SMALLINT;
>DECLARE VARIABLE ZSID INTEGER;
>DECLARE VARIABLE ZSLEISTID SMALLINT;
>DECLARE VARIABLE ZSGR SMALLINT;
>DECLARE VARIABLE ZSMELDD TIMESTAMP;
>DECLARE VARIABLE SVN CHAR(10);
>DECLARE VARIABLE TIT VARCHAR(30);
>DECLARE VARIABLE VN VARCHAR(50);
>DECLARE VARIABLE NN VARCHAR(50);
>declare variable ADRID INTEGER;
>DECLARE VARIABLE STRA VARCHAR(50);
>DECLARE VARIABLE HNR VARCHAR(20);
>DECLARE VARIABLE PLZ VARCHAR(7);
>DECLARE VARIABLE ORT VARCHAR(50);
>DECLARE VARIABLE STPKT SMALLINT;
>DECLARE VARIABLE STPKTBEZ VARCHAR(50);
>DECLARE VARIABLE LISTNR INTEGER;
>DECLARE VARIABLE AENDDAT DATE;
>DECLARE VARIABLE AENDDIENST VARCHAR(50);
>DECLARE VARIABLE AENDART VARCHAR(50);
>DECLARE VARIABLE AENDGRU VARCHAR(50);
>DECLARE VARIABLE AENDBEMERK VARCHAR(100);
>DECLARE VARIABLE AENDSTDALT NUMERIC(9,2);
>DECLARE VARIABLE AENDSTDNEU NUMERIC(9,2);
>DECLARE VARIABLE UPD SMALLINT;
>DECLARE VARIABLE NONU TIMESTAMP;
>DECLARE VARIABLE NONULL TIMESTAMP;
>BEGIN
> /* code */
> NONULL = CAST('1900-01-01 00:00:01' AS TIMESTAMP);
> IF (DIENST > 0) THEN
> DIENST1 = DIENST;
> ELSE

================================================

> SELECT F.AENDLISTDIENST1, F.AENDLISTDIENST2, F.AENDLISTDIENST3,
>F.AENDLISTDIENST4 FROM FIRMA F
> INTO :DIENST1, :DIENST2, :DIENST3, DIENST4;

================================================
The above statement should throw a "Multiple rows in singleton
select" exception, since you have no WHERE clause to limit the output to a
single row. (It might be a single-row table, of course...)

Anyway, for now, best to see what Martijn makes of it...

/heLen