Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a stored procedure with one or more "update or insert" statement fails [CORE3968] #4301

Closed
firebird-automations opened this issue Oct 29, 2012 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Frank Schlottmann-Goedde (fsg)

Duplicates CORE3966

Using the following script in isql against the employee database demonstrates the error

/*
Creating a stored procedure with one or more "update or insert" statement
fails with:

Statement failed, SQLSTATE = 42S22
invalid request BLR at offset 193
-column EMP_NO is not defined in table PROJECT
-Error while parsing procedure EMPIU's BLR
*/

SET TERM ^ ;

create or alter procedure EMPIU (
EMP_NO smallint,
FIRST_NAME varchar(15),
LAST_NAME varchar(20),
PHONE_EXT varchar(4),
HIRE_DATE timestamp,
DEPT_NO char(3),
JOB_CODE varchar(5),
JOB_GRADE smallint,
JOB_COUNTRY varchar(15),
SALARY numeric(10,2),
PROJ_ID type of column PROJECT.PROJ_ID)
as
begin
select first 1 p.proj_id from project p where p.proj_id=:proj_id into :proj_id;
update or insert into EMPLOYEE_PROJECT (EMP_NO, PROJ_ID)
values (:EMP_NO, :PROJ_ID)
matching (EMP_NO, PROJ_ID);

update or insert into EMPLOYEE (EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE,
JOB_COUNTRY, SALARY)
values (:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY,
:SALARY)
matching (EMP_NO);
end^

SET TERM ; ^

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Duplicates CORE3966.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE3966 [ CORE3966 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants