Reputation:
I am using set colsep'|' in sqlplus.However,It appends the pipe(|) column-sperator in between two columns only not at the begining and the end of the column.Example-It give output like this- emp_name|emp_department|emp_salary
I want the out put like this(Append "|") in the begning and end also: |emp_name|emp_department|emp_salary| How can i acchieve this in oracle using sqlplus,Pls. help me out...ur early response can ease my nerve!!!
Upvotes: 0
Views: 508
Reputation: 40603
select
NULL, -- select your left most |
your_first_column,
another_column_1,
another_column_2,
your_last_column,
NULL -- select right mose |
from
your_table;
Upvotes: 0
Reputation: 17068
I don't think sqlplus let you do that. As you know, separators columns are here for, well.. separe two columns. You can always do your request like that :
select '|' || col1, col2, col3, col4 || '|'
from myTable
Upvotes: 4