Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure eror

Status
Not open for further replies.

mydisney

Programmer
May 7, 2007
55
US
Trying to execute a sp on db2 from sequel server. Getting error.


EXEC AS400SRV_IBMDA400_OLEDB.vgsysb.qgpl.get_company' 010'

The error:

OLE DB provider "IBMDA400" for linked server "AS400SRV_IBMDA400_OLEDB" returned message "SQL0104: Token { was not valid. Valid tokens: ( END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
Cause . . . . . : A syntax error was detected at token {. Token { is not a valid token. A partial list of valid tokens is ( END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token {. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL statement because it does not end with a valid clause.".
Msg 7212, Level 17, State 1, Line 1
Could not execute procedure 'getcompany' on remote server 'AS400SRV_IBMDA400_OLEDB'.

The strored procedure is Get_Company where I pass in a parameter of 10 char.

create procedure get_company
(in company varchar(10))
result set 1
language sql
modifies sql data
begin
declare C1 scroll cursor with return for
select drky, drdl01 from vgiprdcom/f0005
where drsy = '00' and drrt = '01' and drky = company;
open C1;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top