Hi,
You need to cast the default value to Binary:
create or replace variable palhc.pinewEncPwd Binary(256) default
(Cast('TEST124 ' as Binary(256)));
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Lim Hock-Chai
Gesendet: Thursday, 29.11 2012 20:14
An: midrange-l@xxxxxxxxxxxx
Betreff: Re: calling sql procedure from interactive SQL session
Below is the error that I'm getting when run it thru RUNSQLSTM:
5770SS1 V7R1M0 100423 Run SQL Statements SVLRSPTST
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+...
7 ...+... 8
1
2 create or replace variable palhc.piUserId Varchar(256) default
'PALHC';
3 create or replace variable palhc.piResEml char(100)
4 default
'lim.hock-chai@xxxxxxxxxxxxxxx';
5 create or replace variable palhc.piErrFlag char(1) default ' ';
6 create or replace variable palhc.piErrID char(7) default ' ';
7 create or replace variable palhc.piErrMsg char(255) default '
';
8 create or replace variable palhc.piRequestID Varchar(256) default
' ';
9 create or replace variable palhc.piChgPwdAlso Char(1) default 'Y';
10 create or replace variable palhc.pinewEncPwd Binary(256) default
'TEST124 ';
11 create or replace variable palhc.pinewEncPwdLn int default 0;
12 create or replace variable palhc.pinewEncPwdVc Binary(16);
13 create or replace variable palhc.pinewASCEBC Char(1) default 'E';
14 create or replace variable palhc.piForcePwd char(1) default 'N';
15
MSG ID SEV RECORD TEXT
SQL79A0 0 2 Position 1 Variable PIUSERID was created in PALHC.
SQL79A0 0 3 Position 1 Variable PIRESEML was created in PALHC.
SQL79A0 0 5 Position 1 Variable PIERRFLAG was created in PALHC.
SQL79A0 0 6 Position 1 Variable PIERRID was created in PALHC.
SQL79A0 0 7 Position 1 Variable PIERRMSG was created in PALHC.
SQL79A0 0 8 Position 1 Variable PIREQUESTID was created in PALHC.
SQL79A0 0 9 Position 1 Variable PICHGPWDALSO was created in PALHC.
SQL0303 30 10 Position 1 Variable PINEWENCPWD not compatible or value
too long.
"CRPence" <CRPbottle@xxxxxxxxx> wrote in message
news:<mailman.1871.1354209312.10847.midrange-l@xxxxxxxxxxxx>...
On 29 Nov 2012 09:47, Lim Hock-Chai wrote:
Did encounter a strange behavior:
The statement below works fine in STRSQL. But if I put that
statement in a Source file and run it with RUNSQLSTM, it failed.
Weird. But no big deal. <<SNIP>>
create or replace variable pa1234.pinewEncPwd Binary(256) default
'TEST124 '
Simply stating that the request "failed" is not very descriptive :-(
If there is a reason to expect that the function is supported, e.g.
the /failure/ was *not* SQL0084 [although the documentation gives no
indication that would be the case], then probably that is an
indication that the /strange behavior/ should be reported as a probable
defect.?
Hopefully whatever the failure was, was not merely due to a missing
semicolon, as required by the script processor [at least for lack of
an EOF in its place].
IBM i 7.1 Information Center -> Database -> Reference -> SQL reference
-> Statements
_i CREATE VARIABLE i_
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/db2/rbaf
zcvariable.htm "The CREATE VARIABLE statement defines a global
variable at the application server.
_Invocation_
This statement can be embedded in an application program or issued
interactively. It is an executable statement that can be dynamically
prepared.
...
"
--
Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.