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 > Querying special table name

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-10-10, 05:56
Onsightfree Onsightfree is offline
Banned
 
Join Date: May 2010
Posts: 5
Querying special table name

Hi all,

I would ask for your help in the following:
One of the columns in a table have a special character in its name:

(simplified)
SELECT AFO-NEXT FROM DB2ADMIN.LOGISTIK

The query is working for all other columns, but this one. The query is working with Select *, but I cannot access specifically this column.

I tried googling for special escape characters or such, but couldnt find anything.
Someone please help me out, how can I make the above query running?

On execution I get the SQL0206N error, I could not find any workaround for the '-' character.

Thanks in advance !
Reply With Quote
  #2 (permalink)  
Old 05-10-10, 06:34
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Enclose the column name in double quotes. Keep in mind that the name then must be entered _exactly_ as it is listed in the catalog; in particular, it becomes case sensitive.
Reply With Quote
  #3 (permalink)  
Old 05-10-10, 06:57
Onsightfree Onsightfree is offline
Banned
 
Join Date: May 2010
Posts: 5
Thanks a lot for your answer !

Pity that its kinda the only case, in which I cannot integrate this query with the R programming langauge, as it messes with " marks...

But anyway, thanks again, have a nice day :-)
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