Home » SQL & PL/SQL » Client Tools » using a prompt as a column (toad)
using a prompt as a column [message #648471] Tue, 23 February 2016 14:23 Go to next message
yu_yu
Messages: 3
Registered: February 2016
Junior Member
a simple question, how do I add a prompt in a select statemen.

for example, I want to build a query like select a1, a2,:prompt as user_name from table1 where a1 =condition;

here I need the capability of this prompting in the select statement. when I ran like this, I got a toad error: invalid host/bind variable name.
Re: using a prompt as a column [message #648472 is a reply to message #648471] Tue, 23 February 2016 14:31 Go to previous messageGo to next message
BlackSwan
Messages: 26207
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this orum.

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Why not just static SELECT as needed?

Re: using a prompt as a column [message #648473 is a reply to message #648471] Tue, 23 February 2016 14:36 Go to previous messageGo to next message
Michel Cadot
Messages: 65849
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What is your goal in the end?

Re: using a prompt as a column [message #648474 is a reply to message #648473] Tue, 23 February 2016 14:40 Go to previous messageGo to next message
yu_yu
Messages: 3
Registered: February 2016
Junior Member
This is purely an information field, not used for any other statement later on. Whoever run the query will enter their name. the results will be dumped to csv file. Instead of doing extra step, it's convenient to have this in the query.
Re: using a prompt as a column [message #648475 is a reply to message #648474] Tue, 23 February 2016 14:43 Go to previous messageGo to next message
Michel Cadot
Messages: 65849
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

And your user will use TOAD?

Re: using a prompt as a column [message #648476 is a reply to message #648475] Tue, 23 February 2016 14:44 Go to previous messageGo to next message
yu_yu
Messages: 3
Registered: February 2016
Junior Member
Yes
Re: using a prompt as a column [message #648477 is a reply to message #648474] Tue, 23 February 2016 14:44 Go to previous messageGo to next message
BlackSwan
Messages: 26207
Registered: January 2009
Location: SoCal
Senior Member
SELECT USER FROM DUAL;

post results from above
Re: using a prompt as a column [message #648478 is a reply to message #648476] Tue, 23 February 2016 14:52 Go to previous messageGo to next message
Michel Cadot
Messages: 65849
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

yu_yu wrote on Tue, 23 February 2016 21:44
Yes


So you deserve what you will have in the end; with bad tools you can't get good result.
What application requires TOAD as interface?

Re: using a prompt as a column [message #648480 is a reply to message #648478] Tue, 23 February 2016 15:15 Go to previous message
Littlefoot
Messages: 21439
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, it works for me:

/forum/fa/13044/0/

Previous Topic: set markup html on
Next Topic: Unit Tests on SQL Developer - Startups and Teardowns
Goto Forum:
  


Current Time: Mon Oct 22 17:33:34 CDT 2018