We help IT Professionals succeed at work.
Get Started

Need to add dummy column in query with no data values in result

beechers asked
Last Modified: 2013-12-07
I want to do a SQL query in Oracle that will add a dummy column with no data in the column. I can do the following:  select file_num, name, 'dummy_column' from pd_file where file_num = '123456'. But the result comes up with a 'dummy_column' column with 'dummy_column' as the value for that field in every row.  I saw a question here with the answer being to do the follwwing:
select file_num, name,  null 'dummy_column' from pd_file where file_num = '123456'.

When I do that I get the following error:  "ORA-00923: FROM keyword not found where expected".

I am sure there must be a way to do this simple thing.  Thanks for your advice!
Watch Question
This problem has been solved!
Unlock 4 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE