473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

call of sqls

Hello,

is there any possibility to call a .sql-file directly by giving the path of
the file instead of copying the whole content of the file to the editor of
db2 (I am using ibm db2 universal database 8.2)?
In Oracle, there is the syntax @'path to the sql' for that. Is there an
equivalent for db2?

Thanks a lot in advance for help.

Cheers,
ina
Nov 12 '05 #1
4 1717
Ina Schmitz wrote:
Hello,

is there any possibility to call a .sql-file directly by giving the path
of the file instead of copying the whole content of the file to the editor
of db2 (I am using ibm db2 universal database 8.2)?
In Oracle, there is the syntax @'path to the sql' for that. Is there an
equivalent for db2?


db2 -f /path/to/file

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
Hello again,
db2 -f /path/to/file

Thanks for the answer. Unfortunately, I didn't succeed in using this yet.
Where exactly do I have to type this command? I typed it in the
"Befehlseditor" of DB2 (sorry, I don't know the exact translation for this).
Do I have to start anything else than "db2start" before?
I got the following message:
"SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu
den
möglichen Token gehören: "SELECT". SQLSTATE=42601
SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu den
möglichen Token gehören: "SELECT".
[...]"
So I suppose, that in the "Befehlseditor" only select commands could be
executed?

Could you please tell me some online documentation about this? I didn't find
anything in the db2 online help to this topic.

Thanks a lot!
Cheers,
Ina


Nov 12 '05 #3
Ina Schmitz wrote:
Hello again,

db2 -f /path/to/file


Thanks for the answer. Unfortunately, I didn't succeed in using this yet.
Where exactly do I have to type this command? I typed it in the
"Befehlseditor" of DB2 (sorry, I don't know the exact translation for this).
Do I have to start anything else than "db2start" before?
I got the following message:
"SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu
den
möglichen Token gehören: "SELECT". SQLSTATE=42601
SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu den
möglichen Token gehören: "SELECT".
[...]"
So I suppose, that in the "Befehlseditor" only select commands could be
executed?

Could you please tell me some online documentation about this? I didn't find
anything in the db2 online help to this topic.

The command noted by Knut invokes the "Befehlseditor". So you do it from
the shell.You can try:
!db2 -f ...
The bang (!) is used to initiate a system call from CLP.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4

Ina Schmitz wrote:
Hello again,
db2 -f /path/to/file Thanks for the answer. Unfortunately, I didn't succeed in using this

yet. Where exactly do I have to type this command? I typed it in the
before this try: db2 connect to :)))

and then use: db2 -t -f path
option -t means that statements are terminated with ; .
"Befehlseditor" of DB2 (sorry, I don't know the exact translation for this). Do I have to start anything else than "db2start" before?
I got the following message:
"SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu den
möglichen Token gehören: "SELECT". SQLSTATE=42601
SQL0104N Auf "ANWEISUNG-ANFANG" folgte das unerwartete Token "db2". Zu den möglichen Token gehören: "SELECT".
[...]"
So I suppose, that in the "Befehlseditor" only select commands could be executed?

Could you please tell me some online documentation about this? I didn't find anything in the db2 online help to this topic.


in db2 command prompt type ?<enter>, also if db2 reports SQLXXXXN error
you
can try

db2>? SQLXXXXN and you will get detaild explanation of error with
possibile solution..

Nov 12 '05 #5

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

Similar topics

13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
4
by: shahbazc | last post by:
Hi All, I'm rather new to asp.net, currently I am experimenting with .NET 2.0. I have a fairly large number of reports which have everything in common except the sql, report heading and perhaps a...
4
by: clamps | last post by:
I've been doing different sqls for a while but I'm a super n00b to access. Is there a way to call a procedure/function when a change in a 'cell' from the table view occurs? Thanks for the help...
5
by: Jason | last post by:
Hello, I am testing a complex J2EE application on WebSphere and UDB V8.2.3. Because of the compliexity of the application, we have to run it a few hours to finish all test scenarios. One of...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
5
by: cuddles | last post by:
Hi all, Is there any way to call a labeled compound SQL statement from within a stored proc? say i have a procedure which retrieves names and everytime a certain condition occurs, i want the...
4
by: db2admin | last post by:
Hello, Sometime, clients disconnect after starting sql and sql keep running in the db2 engine making it a runaway sql. is there something in DB2 which can avoid this behavior i.e. clean any...
4
by: aj | last post by:
Microsoft SQL Server 2005 - 9.00.3054.00 (X64) (Build 3790: Service Pack 2) Last Friday we had a situation where the DNS system inside our Active Directory server went weird. I know this isn't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.