View Single Post

   
  #3 (permalink)  
Old 02-27-2008, 04:39 AM
Karl Hanson
 
Posts: n/a
Default Re: Current library on AS/400

4.spam@mail.ru wrote:
> Hello.
>
> select current schema from sysibm.sysdummy1;
>
> Sincerely,
> Mark B.
>


OS/400 current library (CURLIB) and SQL CURRENT SCHEMA are not (by
definition) the same. There may be an "SQL only" way to get CURLIB, but
if not one option might be to write a small external procedure or
function (UDF).

For example a CL program could contain this command:
RTVJOBA CURLIB(&CURLIB)

To register the CL program as a procedure, do something like:
create procedure getcurlib(out curlib char(10))
language CL
no sql
not fenced
external name mylib.curlib

This is just an idea - I have not built or tested it.

--
Karl Hanson
Reply With Quote