Home » SQL & PL/SQL » SQL & PL/SQL » how to extract data from oracle table having space in column name using vba code?
how to extract data from oracle table having space in column name using vba code? [message #665409] Tue, 05 September 2017 02:46 Go to next message
oracbeg
Messages: 13
Registered: July 2017
Junior Member
I really need some advice on this. Please. I have a oracle table having column names with spaces. I made a code having sql select query inside, which extracts data accordingly. It works for column name without spaces like "select column from table". i need to make work this in vba "select column name from table". What delimiters should i use. Have tried {},[],``. Please help
Re: how to extract data from oracle table having space in column name using vba code? [message #665410 is a reply to message #665409] Tue, 05 September 2017 03:15 Go to previous messageGo to next message
Roachcoach
Messages: 1501
Registered: May 2010
Location: UK
Senior Member
If someone has done something so heretical, you need to reference the column in double quotes:

select "I hate them" from badtabledesign
Re: how to extract data from oracle table having space in column name using vba code? [message #665426 is a reply to message #665410] Tue, 05 September 2017 08:26 Go to previous messageGo to next message
JPBoileau
Messages: 11
Registered: September 2017
Junior Member
Try the double quotes:

SELECT "MYTABLE"."MYCOLUMN" FROM "MYTABLE";

JP
Re: how to extract data from oracle table having space in column name using vba code? [message #665428 is a reply to message #665426] Tue, 05 September 2017 08:34 Go to previous messageGo to next message
cookiemonster
Messages: 12961
Registered: September 2008
Location: Rainy Manchester
Senior Member
You know Roachcoach said the exact same thing 5 hours ago?
Re: how to extract data from oracle table having space in column name using vba code? [message #665433 is a reply to message #665428] Tue, 05 September 2017 09:01 Go to previous message
Bill B
Messages: 1701
Registered: December 2004
Senior Member
And roachcoach's column name and table name is much more descriptive of the OP's horrible design.
Previous Topic: PLSQL Procedure to Grant Privs on Schema Objects
Next Topic: where clause between to sysdates
Goto Forum:
  


Current Time: Sat Dec 16 22:19:16 CST 2017

Total time taken to generate the page: 0.18305 seconds