MS Query Oracle syntax

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Does anyone know syntax for renaming a field using MS Query with a
oracle databse?

select f1 "MyField" from mytable; returns an error

actually more correctly stated my query is something like
select myfunction(f1, f2, f3) "MyName" from table1 where f1 = 1;

Thanks for pointing me in the right direction.
 
Try this:

SELECT f1 MyField FROM mytable;

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Try this:

SELECT f1 MyField FROM mytable;

Does that help?
***********
Regards,
Ron

XL2002, WinXP








- Show quoted text -

Thanks for the respnse!

I think MS Query (or Oracle ODBC) is causing troubles in that it won't
allow it without quotes either. Seems odd to me and frustrating. Any
ideas where I can further research it?

Jeff
 
Try running as a Pass-thru query. MS Query won't try to compile the SQL. It
will simply send it to the server and let Oracke compile and run it.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Try running as a Pass-thru query. MS Query won't try to compile the SQL. It
will simply send it to the server and let Oracke compile and run it.

Does that help?
***********
Regards,
Ron

XL2002, WinXP









- Show quoted text -

You can have MS Query do a pass-thru query? That would be cool. Not
sure I know how to do that... I'm reseaching it now. Any pointers
appreciated.

Thanks! This gives me hope!
Jeff
 
Ooops! MS Access runs Pass-thru queries, not MS Query.

This works in TOAD:
SELECT tblMyTable.NAME MyName
FROM DB.NAME_TABLE tblMyTable;

BUT....MS Query runs the query, parsing out the " MyName " section and
converting the SQL to:
SELECT tblMyTable.NAME
FROM DB.NAME_TABLE tblMyTable;

I seem to recall being able to rename an Oracle output field using MS
Query....and that it was a PITA to do it. I'll poke around and see if I can
figure it out again.

***********
Regards,
Ron

XL2002, WinXP
 
Nope......I corrected myself, but a bit too late.

HOWEVER......This comes close to what you want:

SELECT f1 """MyField""" FROM mytable;

The down side is that the field name resolves to "MyField".....with the
quotes, unfortunately. I pretty sure that's the price to be paid for
changing the field name.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Hi Jeff,

What is the full text of your actual query and what error messages are you
getting?

MH
 
Back
Top