Subject Executing a Stored procedures with a few inserts inside
Author clementdoss
Hi,

Hope you can shed a light....

I have to populate a table, and I am trying to use a Stored procedure
to help me.

When I executing (or compiling) the script, I get the following error:
invalid request BLR at offset 307
bad parameter number

I have changed all the parameters, and the only way to execute this
script was to comment from the 2 insert on. Why? Is there a problem
running two inserts in a Stored Procedure?


Best regards,
Clément


Here is the script

SET AUTODDL OFF;
SET TERM ^ ;

/* Stored procedures */
ALTER PROCEDURE SP_GENERATE_INVOICES
(
INVOICE INTEGER,
MAN INTEGER
)
AS
begin

INSERT INTO INVOICES (INVOICE_NUMBER, INVOICE_TYPE, INVOICE_MAN,
INVOICE_ISSUEDT,
INVOICE_EXPDT , INVOICE_PAYDT,INVOICE_VALUE,
INVOICE_STATUS,INVOICE_VALUEPAID)
VALUES ( :INVOICE , 'BB', :MAN , '01.11.2002',
'14.11.2002', '14.11.2002', 34, 'P', 34);

INSERT INTO INVOICES (INVOICE_NUMBER, INVOICE_TYPE, INVOICE_MAN,
INVOICE_ISSUEDT,
INVOICE_EXPDT, INVOICE_PAYDT, INVOICE_VALUE,
INVOICE_STATUS, INVOICE_VALUEPAID)
VALUES ( :INVOICE + 10, 'BB', :MAN , '01.12.2002',
'14.12.2002', '14.12.2002', 34, 'P', 34);

INSERT INTO INVOICES (INVOICE_NUMBER, INVOICE_TYPE, INVOICE_MAN,
INVOICE_ISSUEDT,
INVOICE_EXPDT, INVOICE_PAYDT, INVOICE_VALUE,
INVOICE_STATUS, INVOICE_VALUEPAID)
VALUES ( :INVOICE + 20, 'BB', :MAN , '01.01.2003',
'14.01.2003', '14.01.2003', 34, 'P', 34);

INSERT INTO INVOICES (INVOICE_NUMBER, INVOICE_TYPE, INVOICE_MAN,
INVOICE_ISSUEDT,
INVOICE_EXPDT, INVOICE_PAYDT, INVOICE_VALUE,
INVOICE_STATUS, INVOICE_VALUEPAID)
VALUES ( :INVOICE + 30 , 'BB', :MAN , '01.02.2003',
'14.02.2003', '14.02.2003', 34, 'P', 34);

INSERT INTO INVOICES (INVOICE_NUMBER, INVOICE_TYPE, INVOICE_MAN,
INVOICE_ISSUEDT,
INVOICE_EXPDT, INVOICE_PAYDT, INVOICE_VALUE,
INVOICE_STATUS, INVOICE_VALUEPAID)
VALUES ( :INVOICE + 40, 'BB', :MAN , '01.03.2003',
'14.03.2003', NULL, 34, 'A', NULL);

end
^

SET TERM ; ^
SET AUTODDL ON;