By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

Current library on AS/400

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

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello.

select current schema from sysibm.sysdummy1;

Sincerely,
Mark B.

Nov 12 '05 #2

P: n/a
4.****@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
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.