Subject | INSERT procedure problems |
---|---|
Author | joe_dh2003 |
Post date | 2004-05-27T19:11:02Z |
Hi everyone,
I'm having some troubles with a simple stored procedure to INSERT a
row:
-------------------------------------------------------------------
CREATE PROCEDURE SP_I_COUNTRY (NAME VARCHAR(50)) RETURNS(ID BIGINT)
AS
BEGIN
ID = GEN_ID(G_COUNTRY_ID,1);
INSERT INTO COUNTRY VALUES(:ID,:NAME);
END;
-------------------------------------------------------------------
If it matters, I'm running this script through the SQL editor in
Marathon 3.0.0.22.
When I run the script, it runs fine. But when I try to COMMIT the
action, I get this error:
-----------------------------------
ISC ERROR CODE:335544343
ISC ERROR MESSAGE:
invalid request BLR at offset 102
bad parameter number
-----------------------------------
If I add a second input parameter, then the script executes AND
commits fine. But then the variables for the INSERT statement get
mixed up - the two input paramters get passed into the INSERT
statement - the temporary variable ID isn't used.
Any help would be appreciated
Thanks,
Dave Hagedorn
N.E. Hagedorn & Sons Limited
I'm having some troubles with a simple stored procedure to INSERT a
row:
-------------------------------------------------------------------
CREATE PROCEDURE SP_I_COUNTRY (NAME VARCHAR(50)) RETURNS(ID BIGINT)
AS
BEGIN
ID = GEN_ID(G_COUNTRY_ID,1);
INSERT INTO COUNTRY VALUES(:ID,:NAME);
END;
-------------------------------------------------------------------
If it matters, I'm running this script through the SQL editor in
Marathon 3.0.0.22.
When I run the script, it runs fine. But when I try to COMMIT the
action, I get this error:
-----------------------------------
ISC ERROR CODE:335544343
ISC ERROR MESSAGE:
invalid request BLR at offset 102
bad parameter number
-----------------------------------
If I add a second input parameter, then the script executes AND
commits fine. But then the variables for the INSERT statement get
mixed up - the two input paramters get passed into the INSERT
statement - the temporary variable ID isn't used.
Any help would be appreciated
Thanks,
Dave Hagedorn
N.E. Hagedorn & Sons Limited