We help IT Professionals succeed at work.

oracle sqlplus query delimiter

Roberto Madro R.
on
425 Views
Last Modified: 2017-03-20
why would I be getting the comma  ||','|| delimiter as part of the output header in my query?
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
The header defaults to your column "name".  If you don't provide an alias, Oracle uses a substring of what crated the column.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
for example:
SQL> select 'Hello' || ',' || 'World' from dual;

'HELLO'||',
-----------
Hello,World

SQL> select 'Hello' || ',' || 'World' as column_alias from dual;

COLUMN_ALIA
-----------
Hello,World
Roberto Madro R.Programmer Analyst

Author

Commented:
Yep, I get the same thing you get.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
>>Yep, I get the same thing you get.

As expected.  What are your desired results?
Roberto Madro R.Programmer Analyst

Author

Commented:
The desired results to only and cleanly get the designated header name, I'm for example getting the ||','|| as part of the header names, and the case statement is being displayed in whole.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
An alternative is set the column header for the alias:
col column_alias head 'col1,col2,col3'
select 'Hello' || ',' || 'World'  as column_alias from dual;

Open in new window

Roberto Madro R.Programmer Analyst

Author

Commented:
slightwv, your solution ID: 42056758, was what the dr. ordered, many thanks, we can file this case in the "Done" drawer.

Regards
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.