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 > Quotes on select in Solaris

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-06, 09:32
jujones jujones is offline
Registered User
 
Join Date: May 2006
Location: Waco, KY
Posts: 18
Quotes on select in Solaris

UDB, 8.2, Solaris.

From class, I know that you sometimes need to put single quotes around select statements on the command line. I am trying to do a simple select with a where clause (that has to have single quotes) and it's not working.

I've tried:
db2 select a,b,c from syscat.dbauth where grantee = 'public'
db2 'select a,b,c from syscat.dbauth where grantee = 'public''
db2 "select a,b,c from syscat.dbauth where grantee = 'public'"

no luck.
Julie
Reply With Quote
  #2 (permalink)  
Old 08-04-06, 14:06
jthakrar jthakrar is offline
Registered User
 
Join Date: Mar 2004
Posts: 46
Your last format is correct, however it does not give the required result because -
1) SYSCAT.DBAUTH does not have columns a, b or c
2) DB2 converts all users/groups to upper case, so you should compare to 'PUBLIC'

Here's a sample query -

db2 "select * from syscat.dbauth where grantee = 'PUBLIC' "
Reply With Quote
  #3 (permalink)  
Old 08-04-06, 14:09
jujones jujones is offline
Registered User
 
Join Date: May 2006
Location: Waco, KY
Posts: 18
thanks. that worked. I had tried the PUBLIC but maybe not with that syntax. Thought I did. Sorry for your trouble, but thanks!

Julie
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