473,782 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"USE" statement in AS/400 DB2 SQL

Anyone know if there is an analagous statement for the "USE" statement
used in SQL Server? I am trying to prevent from having to change all
the references to a database in my sql statement.

I want to do
Use 'db2'

Select * from tblRev
Instead of

Select * from db2.tblRev.

I am using the RUN SQL SCRIPTS compiler that comes with the AS/400
Operations Navigator? Please help I don't want to have to go back and
remove the test database references.
thanks
Nov 12 '05 #1
2 7419
"bccbccbcc" <bi********@pac ificlife.com> wrote in message
news:e6******** *************** ***@posting.goo gle.com...
Anyone know if there is an analagous statement for the "USE" statement
used in SQL Server? I am trying to prevent from having to change all
the references to a database in my sql statement.

I want to do
Use 'db2'

Select * from tblRev
Instead of

Select * from db2.tblRev.

I am using the RUN SQL SCRIPTS compiler that comes with the AS/400
Operations Navigator? Please help I don't want to have to go back and
remove the test database references.
thanks


I am not sure about DB2/400, but look a the SET SCHEMA statement in the SQL
Reference Guide.
Nov 12 '05 #2
Mark A wrote:
"bccbccbcc" <bi********@pac ificlife.com> wrote in message
news:e6******** *************** ***@posting.goo gle.com...
Anyone know if there is an analagous statement for the "USE" statement
used in SQL Server? I am trying to prevent from having to change all
the references to a database in my sql statement.

I want to do
Use 'db2'

Select * from tblRev
Instead of

Select * from db2.tblRev.

I am using the RUN SQL SCRIPTS compiler that comes with the AS/400
Operations Navigator? Please help I don't want to have to go back and
remove the test database references.
thanks

I am not sure about DB2/400, but look a the SET SCHEMA statement in the SQL
Reference Guide.


Here is a link to the SET SCHEMA description in DB2 UDB for iSeries SQL
Reference:
http://publib.boulder.ibm.com/iserie...tsetschema.htm

You will need OS/400 V5R2.
Other links of possible interest:
http://publib.boulder.ibm.com/pubs/h...infocenter.htm
http://www.ibm.com/servers/eserver/iseries/db2/

--
Karl Hanson
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

40
3044
by: Steve Juranich | last post by:
I know that this topic has the potential for blowing up in my face, but I can't help asking. I've been using Python since 1.5.1, so I'm not what you'd call a "n00b". I dutifully evangelize on the goodness of Python whenever I talk with fellow developers, but I always hit a snag when it comes to discussing the finer points of the execution model (specifically, exceptions). Without fail, when I start talking with some of the "old-timers"...
1
422
by: bccbccbcc | last post by:
anyone know an analagous statement for the "USE" statement in SQL Server T-sql? I want to use USE 'db' Select * from tblREV instead of Select * from db.tblREV
4
7193
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2) how to use the selection "All" as criteria for a field in a query, which is used to generate data for a report.
26
2528
by: Chris Potter | last post by:
Hello everyone. I am taking my first course in C and in one of my assignments i need to print out an array that could have anywhere from 0 to 100 positive integers in it (a negative integer is used to stop input), and i have to print 8 integers per line. The code that i have works, and does exactly that, but i feel a little uneasy because i am using two breaks. I would like to hear any comments about this approach, and what i might do to...
10
2527
by: paulw | last post by:
Hi Please give problems that "HAS TO" to use recursion (recursive calls to itself.) Preferrably real world examples, not knights tour. I'm thinking about eliminating the use of stack... Thanks.
10
6100
by: Joe Thompson | last post by:
Hi, This is probably a simple question but I'm curious. What is the purpose of the "finally" statement? There must be a good reason to use it that I'm just not getting... How is this: method1 {
17
1582
by: Tim Baur | last post by:
Hi All, I'm a VB6er who's recently started using VB2005; I have a general question about variable declaration. In VB, I've always tried to avoid using the "As New" construct when declaring a variable preferring instead to instantiate in the class' or form's initialize event or as needed. Using "As New" created unnecessary overhead and resulted in a loss of control over my object's life cycle. Is this advisable practice in .Net?
3
1866
by: vbace2 | last post by:
Hi. I am using DB2 v9.1 fixpack 2. I was wondering if there is a way to use the with hold option when using the prepare statement. Or, is there another way that I can do what I need to? I have a procedure that dynamically creates and drops a table. So, I am using a prepare statement to get all the values from one of the columns. I am then calling a procedure for each returned row. However, the procedure that I am calling has a commit....
5
13369
by: kimiraikkonen | last post by:
Hello, I want to ask about "imports" statement. Some projects must be inserted with "imports xxxx" statements before beginning coding. But how do i know when to use or do i have to use "imports" statement? How will i know which "imports" will my project need? From books or how can i guess? Thanks...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.