• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1755
  • Last Modified:

Substring Procedure for Long Data Type

Hi all I have a requirement in Oracle 10g to run the substring command on a long datatype in a table. For example this is what I would like to do.
note: col1 is LONG datatype

select substr(col1,1,2000), substr(col1,2001,4001)  from table1;
I'd also like to run the trim function if possible from start to end.

I remember someone in my last place had a pl/sql procedure with input/output variables. Can someone help.

Thankss all.
0
cyberonics
Asked:
cyberonics
  • 2
  • 2
1 Solution
 
cyberonicsAuthor Commented:
Thanks raopsn. Whats the syntax to run it. I can't seem to figure his out.
0
 
raopsnCommented:
These are the parameters for the function :

in_rowid rowid  
in_owner varchar
in_table_name varchar
in_column

You can call this in your query like this..

SELECT LONG_TO_CHAR(rowid, 'scott', 'table1', col1) as col1, col2, col3
FROM table1

0
 
cyberonicsAuthor Commented:
Excellent solution.
Thanks raopsn
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now