kunj
kunj

Reputation:

Oracle-sqlplus

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

Answers (2)

René Nyffenegger
René Nyffenegger

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

Cyril Gandon
Cyril Gandon

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

Related Questions