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: 16
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: 1576
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: 88
Registered: September 2017
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: 13920
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: 1971
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 Apr 20 02:02:35 CDT 2024