473,749 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file versus command line issue

Group,

I'm learning DB2 as part of my internship and I've run into a really
weird problem. If I run a script as a file using the following command:

db2 -n -td@ -f audit.db2 +o -x -z audit.cvs

it works. However if I copy and paste that same sql that is in the .db2
file:

db2 -n -td@ SELECT CREATED, EVENT, PROCESS_ID from fmc.audit where
created > timestamp('2005-06-09-21.31.57.520925 ') for read only@ +o -x
-z audit.cvs I get the following error:

SQL0104N An unexpected token "for" was found following "_trail where
created". Expected tokens may include: "<interval_qual ifier>".
SQLSTATE=42601

Any help would be greatly appreciated as I'm still learning a lot about
DB2. Also, I'm using version 8.1.0.36 and the database is on a Solaris
backend, but I'm working through Windows and the dbcmd prompt.

Melih Onvural

Nov 12 '05 #1
4 3107
If this happens to anyone else I wanted to write out a solution.

the greater than and less than signs are interpreted as redirection on
the command prompt so you have to make sure to let the system know that
this is one long sql command by putting it in quotes (" ")

Nov 12 '05 #2
In article <11************ **********@g49g 2000cwa.googleg roups.com>,
(me***********@ gmail.com) says...
db2 -n -td@ SELECT CREATED, EVENT, PROCESS_ID from fmc.audit where
created > timestamp('2005-06-09-21.31.57.520925 ') for read only@ +o -x
-z audit.cvs I get the following error:


I'm not sure if this fixes all issues but it might be worth a try:

db2 -n "SELECT CREATED, EVENT, PROCESS_ID from fmc.audit where
created > timestamp('2005-06-09-21.31.57.520925 ') for read only" +o
-x -z audit.cvs
Nov 12 '05 #3
If this happens to anyone else I wanted to write out a solution.

the greater than and less than signs are interpreted as redirection on
the command prompt so you have to make sure to let the system know that
this is one long sql command by putting it in quotes (" ")

Nov 12 '05 #4
How about :
db2 -n -td@ +o -x -z audit.cvs "SELECT CREATED, EVENT, PROCESS_ID from
fmc.audit where created > timestamp('2005-06-09-21.31.57.520925 ') for
read only@ "

Thanks
Rahul.

Nov 12 '05 #5

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

Similar topics

6
16646
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take it easy, it'll go away once u've learned how to play around with a few things on your system and reorganised. i'm particulary a solaris junkie, but linux is my admiration. the issue here is Not the OS/Software, but rather the concept. first of all...
2
18983
by: Murtix Van Basten | last post by:
Hi, I have dumped a very large database from mysql (using mysqldump program) as a raw sql file. The reason was, convert this database to a MSSQL database. Since mysqldump creates the file as raw sql file with the database-table structures and the data in it, I thought using OSQL command line utilities should work to out this whole database in MSSQL server. I have run this command from command line:
11
3647
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own rules when it comes to file paths. A lot of Microsoft installers for example, and also installers of other companies, do not work because they handle paths in the following manner:
18
7342
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated in MsAccess 97 or prior and have been converted to 2003. On occassion user 1 will open a db. When user 2 opens the db it will not let user 2 modify macros and what not. I can understand this and realize we could split the db; it is not worth ...
17
1996
by: News | last post by:
Hi everyone, My goal is to pull command switches/options from a file and then assign the values to select variables which would eventually be included in a class object. The data file looks something like this but the switches could be in any order and not all may be used. -m quemanager -s server -p port -k key -o object -c 20 -t test@email.com
4
2389
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command line. It also works when pulling the options from a file.
135
7506
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
8
3514
by: Andrew Robert | last post by:
Hi Everyone. I tried the following to get input into optionparser from either a file or command line. The code below detects the passed file argument and prints the file contents but the individual swithces do not get passed to option parser.
1
3105
by: ianoble | last post by:
Hi all, I am running a simple command line Get for a networked VSS database. The command executes properly until it reaches a directory that is corrupted. Because the database is not local, I don't have access to run the analyze utility to try and fix the issue. Plus, I've been told it's been run before and has not resolved anything. To my question...how can I duplicate the functionality of the UI that skips corrupted files/folder, in...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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...
1
6801
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
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
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.