Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 11:38 AM
deebeetwo@yahoo.com
Guest
 
Posts: n/a
Default Current library on AS/400

On AS/400, is there a way to determine the current library from SQL?
(i.e., CURLIB)

  #2  
Old November 12th, 2005, 11:38 AM
4.spam@mail.ru
Guest
 
Posts: n/a
Default Re: Current library on AS/400

Hello.

select current schema from sysibm.sysdummy1;

Sincerely,
Mark B.

  #3  
Old November 12th, 2005, 11:38 AM
Karl Hanson
Guest
 
Posts: n/a
Default Re: Current library on AS/400

4.spam@mail.ru wrote:[color=blue]
> Hello.
>
> select current schema from sysibm.sysdummy1;
>
> Sincerely,
> Mark B.
>[/color]

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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,174 network members.