Noob who's stuck

I’m not a noob to sql or anything like that. However, for the life of me I can’t seem to get variables declared inside the sql editor.

declare
p1 char(2);
p2 char(3);

begin
call mystoredprocwithoutputparameters(123,1,‘foo’,p1,p2);
end;

the last 2 parameters are output parameter.

The issues is that I’m getting a Keyword CHAR not expected… error under the declare.

I’ve done
declare
@p1 char(2);
@p2 char(3);

declare @p1 char(2);
declare @p2 char(3);

etc. and nothing seems to work.

I get the following error:

[IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0199 - Keyword CHAR not expected. Valid tokens: DYNAMIC SENSITIVE ASENSITIVE INSENSITIVE.

All I want to do is test out my stored proc. Is that too much to ask? :wink:

We currently do not support declarations of variables within a script outside the scope of a routine. We will look to deliver that support in a future product release.

We currently do not support declarations of variables within a script outside the scope of a routine. We will look to deliver that support in a future product release.