DBMS_LOB.SUBSTR [message #672995] |
Thu, 01 November 2018 12:20 |
|
EDT
Messages: 3 Registered: November 2018
|
Junior Member |
|
|
Hi All,
Can someone please help me how to get string value from BLOB column.
I will get below string in my data.
1 PIN_FLD_ERROR_CODE STR [0] "20321"
And I want to get error code .. that is 20321 from that string.
Please help me.
ED
|
|
|
|
Re: DBMS_LOB.SUBSTR [message #673001 is a reply to message #672995] |
Thu, 01 November 2018 13:06 |
|
Michel Cadot
Messages: 68658 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Quote:I will get below string in my data.
String is not BLOB it is CLOB.
Or is this a BLOB that contains strings? In this case why not using CLOB instead?
Post something we can work with (in addition to answer to BlackSwan's question).
[Updated on: Thu, 01 November 2018 13:07] Report message to a moderator
|
|
|
|
|
Re: DBMS_LOB.SUBSTR [message #673005 is a reply to message #673003] |
Thu, 01 November 2018 14:02 |
|
Michel Cadot
Messages: 68658 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
How can you get this from a BLOB as a BLOB is BINARY data and so NOT characters?
You MUST post something we can reproduce.
Copy and paste what you did (Please use [code] tags).
[Updated on: Thu, 01 November 2018 14:02] Report message to a moderator
|
|
|
|
|
Re: DBMS_LOB.SUBSTR [message #673011 is a reply to message #673007] |
Thu, 01 November 2018 15:31 |
|
Michel Cadot
Messages: 68658 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
So forgetting about the BLOB stuff and assuming these are just string data and you want what's between " in the row that contains 'PIN_FLD_ERROR_CODE' then it is something like:
select regexp_substr(string,'"([^"]*)',1,1,'',1)
from t
where string like '%PIN_FLD_ERROR_CODE%'
/
|
|
|