Subject | New to Stored Procedures |
---|---|
Author | Tobias Giesen |
Post date | 2001-07-04T02:07:29Z |
Hello!
I'm having trouble getting my first stored procedure to work. In this small
excerpt, I'm trying to create the database with one table and a stored
procedure. The table is created fine, but the stored procedure definition
returns the error:
COLUMN UNKNOWN - why?
Thanks for your help.
Tobias
----------------------------------------
SET SQL DIALECT 3;
CREATE DATABASE 'XYZ.GDB' PAGE_SIZE 1024 USER "SYSDBA" PASSWORD "masterkey";
CREATE TABLE BETRAEGE
(
ID INTEGER NOT NULL,
TYP CHAR( 10) NOT NULL,
DATUM TIMESTAMP NOT NULL,
BETRAG DOUBLE PRECISION,
CONSTRAINT PK_BETRAEGE PRIMARY KEY (ID,TYP,DATUM)
);
COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;
CREATE PROCEDURE ROUND_NORMAL AS
BEGIN
FOR SELECT BETRAG
FROM BETRAEGE
INTO :B
DO BEGIN
B=(B/100+0.5)*100;
END
EXIT;
END ^
SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON;
I'm having trouble getting my first stored procedure to work. In this small
excerpt, I'm trying to create the database with one table and a stored
procedure. The table is created fine, but the stored procedure definition
returns the error:
COLUMN UNKNOWN - why?
Thanks for your help.
Tobias
----------------------------------------
SET SQL DIALECT 3;
CREATE DATABASE 'XYZ.GDB' PAGE_SIZE 1024 USER "SYSDBA" PASSWORD "masterkey";
CREATE TABLE BETRAEGE
(
ID INTEGER NOT NULL,
TYP CHAR( 10) NOT NULL,
DATUM TIMESTAMP NOT NULL,
BETRAG DOUBLE PRECISION,
CONSTRAINT PK_BETRAEGE PRIMARY KEY (ID,TYP,DATUM)
);
COMMIT WORK;
SET AUTODDL OFF;
SET TERM ^ ;
CREATE PROCEDURE ROUND_NORMAL AS
BEGIN
FOR SELECT BETRAG
FROM BETRAEGE
INTO :B
DO BEGIN
B=(B/100+0.5)*100;
END
EXIT;
END ^
SET TERM ; ^
COMMIT WORK;
SET AUTODDL ON;