0

I have v_fileContent blob;, the value of which is returned by a different procedure, and I need to pass approximately 1000 first characters of it to another procedure. I've googled a lot and have only found ways of getting substrings of various lob type columns in tables. But how is it possible to get a substring of a variable?

Smk
  • 13
  • 4
  • Does this answer your question? [BLOB to String, SQL Server](https://stackoverflow.com/questions/6911460/blob-to-string-sql-server) – pix Feb 19 '20 at 13:24
  • 1
    @pix Wouldn't those answers be specific to SQL Server? Seems all the answers are related to a query and not to a variable in a procedure. – Scratte Feb 19 '20 at 13:35

1 Answers1

1

If you are using a single byte per character encoding (not Unicode) you can use:

Ask Tom Oracle Source

utl_raw.cast_to_varchar2( dbms_lob.substr( BLOB_LOCATOR, 1000, 1 ) );
pix
  • 1,264
  • 19
  • 32
Alistair Wall
  • 332
  • 1
  • 2
  • 3