Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

explicitly specify region in SQL on AS400 1

Status
Not open for further replies.

ddiamond

Programmer
Joined
Apr 22, 2005
Messages
918
Location
US
On the AS400, I can specify the region in SQL using the syntax region/table if I'm running the query through strsql. But if I instead use a seperate program to launch the sql using ODBC, I get an error if I try to use that syntax. Does anyone know how I can specify the region in my SQL when using ODBC drivers?
 
Try this if region is a library name:
Select ... from region.table
dot instead slash.
 
Thanks, that worked. I also had to add the library to the odbc's library list.
 
Thanks, that worked. I also had to add the library to the odbc's library list.

That is strange. I can perform any SQL on any library as long as I treat the library as a sort of schema-name.
With Client Access ODBC it does not matter which library is in the library list...

Ties Blom
Information analyst
 
Schema name and library name are the same thing.
 
Schema name and library name are the same thing.

In a way yes.

What I meant to say is that when you use a connection with library A in the library list the following will also work:

Select B.field from table

The library B does not have to be in the library-list in this case for the SQL to parse.





Ties Blom
Information analyst
 
What about UDFs? If I have a UDF can a explicitly specify which library the UDF resides in? If I don't explicitly specify it, DB2 finds the UDF provided it's library is part of the User's library list, but it would nice if I could explicitly specify it instead. library.UDF() doesn't seem to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top