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 > How do i put comment in DB2 UDB 7.2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-25-05, 03:39
act7656 act7656 is offline
Registered User
 
Join Date: Mar 2004
Posts: 24
Question How do i put comment in DB2 UDB 7.2

Hi there,

I have many SQL script for future reference, but wish to put every detail comment to each part of the SQL passes,

--- put comment here !
select *
from tableA
join
tableB
on tableA.student_ID = tableB.student_ID

what is the symbol need to be used?

i know DB2400 is using /* bla bla bla */ but not sure in DB2 UDB 7.2
__________________
Hello
Reply With Quote
  #2 (permalink)  
Old 02-25-05, 03:41
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

Command is put with two '--'.
Sample:
Code:
-- put comment here ! 
select * 
from tableA 
join 
tableB
on tableA.student_ID = tableB.student_ID
But your command should also work, because '---' it also beggins with '--'.

Hope this helps,
Grofaty

Last edited by grofaty; 02-25-05 at 03:43.
Reply With Quote
  #3 (permalink)  
Old 02-25-05, 03:57
act7656 act7656 is offline
Registered User
 
Join Date: Mar 2004
Posts: 24
HI Grofaty,

i had try to put '--' put in return me this error

"<eb1>SQL0198N The statement string of the PREPARE or EXECUTE IMMEDIATE statement is blank or empty. SQLSTATE=42617

State:42617,Native:-198,Origin:[IBM][CLI Driver][DB2/6000]</eb1>"
__________________
Hello
Reply With Quote
  #4 (permalink)  
Old 02-25-05, 04:26
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Where is your script saved? In file? Where are you trying to execute command? What is your OS? os/400 and database as/400?
Reply With Quote
  #5 (permalink)  
Old 02-25-05, 04:52
act7656 act7656 is offline
Registered User
 
Join Date: Mar 2004
Posts: 24
my script is save on my local machine, i am query from my machine to the database server in windows 2000 server DB2 UDB 7.2 and my machine os is Win 2K pro
__________________
Hello
Reply With Quote
  #6 (permalink)  
Old 02-25-05, 13:20
jsolis33 jsolis33 is offline
Registered User
 
Join Date: Feb 2002
Posts: 6
Assuming your script is saved in a file called sql.clp, you can run the script from command line by doing 'db2 -vf sql.clp'. As mentioned the prefix '--' is used for comments. How are you executing the script ?

-- comment here
select *
from tableA
join
tableB
on tableA.student_ID = tableB.student_ID
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