Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to remove starting with '_'

904205Apr 2 2012 — edited Apr 2 2012
Hi Experts,

I have a requirement like to produce all column names into a feed,for this i solved below query:

SELECT LISTAGG(SUBSTR(LTRIM(COLUMN_NAME,'S$'), 3), '|') WITHIN GROUP (ORDER BY COLUMN_ID) PATH
FROM USER_TAB_COLS
where table_name = 'S$_emp';



but some of the columns displayed in starting like _currency*

why because this table is auto generated from some tool,so every column name starts with s1_ ......to eliminate this i used trim,but even though i have a problem because from 10 th row onwards..........if i given substr length from 4 may loss some column starting names......

column names in db:

s1_a|s2_b|s3_c|s4_d|s5_e|s6_f|s7_g|s8_h|s9_i|s10_j|s11_k|

The above query o/p

a|b|c|d|e|f|g|h|i|_j|_k|

I need like:

a|b|c|d|e|f|g|h|i|j|k|


can any please help me...

Thanks,
Surya...
This post has been answered by 908002 on Apr 2 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2012
Added on Apr 2 2012
4 comments
252 views