If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2look usage

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-17-09, 20:11
gamo gamo is offline
Registered User
 
Join Date: Jul 2009
Location: Sydney
Posts: 13
db2look usage

Hi,

I am trying to reconstruct a UDF so I'm attempting to use db2look

I have
> db2look -d mydb -e

the error which I am getting is

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "db2look" was found following
"BEGIN-OF-STATEMENT". Expected tokens may include: "DECLARE".

which seems a bit weird to me

might this be because I don't have access to system tables? shouldn't the error message be a bit more descriptive if that is the case?
Reply With Quote
  #2 (permalink)  
Old 11-17-09, 20:53
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
From CLP:

db2 => !db2look -d sample -e
-- USER is: DB2ADMIN
-- Creating DDL for table(s)
-- This CLP file was created using DB2LOOK Version "9.7"
-- Timestamp: 2009/11/18 11:02:11
-- Database Name: SAMPLE
-- Database Manager Version: DB2/NT Version 9.7.0
-- Database Codepage: 1208
-- Database Collating Sequence is: IDENTITY
Reply With Quote
  #3 (permalink)  
Old 11-17-09, 21:47
gamo gamo is offline
Registered User
 
Join Date: Jul 2009
Location: Sydney
Posts: 13
that worked

sorry if this is a really dumb question, but what is the ! for?

and why isn't it in the docs? (or is it and I'm just not seeing it?)

does it have something to do with my setup?
Reply With Quote
  #4 (permalink)  
Old 11-17-09, 22:14
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
I can't remember how I leaned "!".

But, I found a description in
DB2 Database for Linux, UNIX, and Windows

Quote:
db2 - Command line processor invocation command
.....
The shell command (!), allows operating system commands to be executed from the interactive or the batch mode on UNIX based systems, and on Windows operating systems (!ls on UNIX, and !dir on Windows operating systems, for example).

Last edited by tonkuma; 11-17-09 at 22:21.
Reply With Quote
  #5 (permalink)  
Old 11-17-09, 22:18
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you back out of the DB2 comand prompt to windows command line then you don't need the !. db2look is not an SQL command, it is a program.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 11-17-09, 22:22
gamo gamo is offline
Registered User
 
Join Date: Jul 2009
Location: Sydney
Posts: 13
oh I see - that makes total sense...

! thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On