Home » SQL & PL/SQL » SQL & PL/SQL » Read blob value
icon4.gif  Read blob value [message #401375] Mon, 04 May 2009 06:40 Go to next message
navkrish
Messages: 189
Registered: May 2006
Location: NJ,USA
Senior Member

All,
Here is my requirement

I get a clob value from java in a parameter and the data look like below
ABCDE55555555555555555555555555555055555555555555555D05500550
QWERF001101000110111D1100001111010000101111101111100101000000
QASER0000000000000000000000000000000000000000000D000000000000


IF you watch carefully each line is to be treated as separate record.
In this case I have to perform my logic three times.

How can i read it line by line in pl/sql? i.e I have to loop 3 times and I have to parse the line and perform some logic. Parsing should be fine but I am not able to find the total line and loop that much time.

Thanks

[Updated on: Mon, 04 May 2009 06:43]

Report message to a moderator

Re: Read blob value [message #401383 is a reply to message #401375] Mon, 04 May 2009 07:07 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Parsing should be fine but I am not able to find the total line and loop that much time.

Increment a variable.

What is your actual and precise problem not just tiny part you posted?

Post a working Test case: create table and insert statements along with the result you want with these data.

Regards
Michel

[Updated on: Mon, 04 May 2009 07:07]

Report message to a moderator

Re: Read blob value [message #401386 is a reply to message #401383] Mon, 04 May 2009 07:53 Go to previous messageGo to next message
navkrish
Messages: 189
Registered: May 2006
Location: NJ,USA
Senior Member

Sorry for not being clear

Java calls stored procedure and will pass a blob value.
Assume I get a value from java as blob parameter as below
ABCDE55555555555555555555555555555055555555555555555D05500550
QWERF001101000110111D1100001111010000101111101111100101000000
QASER0000000000000000000000000000000000000000000D000000000000


How can I move this data into array something like this
V_array[1] := 'ABCDE55555555555555555555555555555055555555555555555D05500550'

V_array[2] := 'QWERF001101000110111D1100001111010000101111101111100101000000'

V_array[3] := 'QASER0000000000000000000000000000000000000000000D000000000000'


Thanks...Let me know if its still not clear..

[Updated on: Mon, 04 May 2009 07:53]

Report message to a moderator

Re: Read blob value [message #401387 is a reply to message #401386] Mon, 04 May 2009 07:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
BLOB or CLOB?
If CLOB, you can use INSTR to find each end-of-line (chr(10)) and cut your string.
Many examples here to split a string.

Regards
Michel
Re: Read blob value [message #401389 is a reply to message #401387] Mon, 04 May 2009 08:00 Go to previous message
navkrish
Messages: 189
Registered: May 2006
Location: NJ,USA
Senior Member

Thanks Michel,
Will try...many thanks!
Previous Topic: Using UTL_TCP with SSL
Next Topic: dbms_job not working
Goto Forum:
  


Current Time: Fri Dec 09 13:31:12 CST 2016

Total time taken to generate the page: 0.13961 seconds