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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Loading text into a BLOB column

knayam247Feb 27 2007 — edited Feb 28 2007
Hey all,

Is there a way to insert simple text into a BLOB column? The scenario is that, I have a table that has a column "Details" which is set to a CLOB datatype. I have a procedure that loads data from an XML file into this table(along with other tables). The XML file has a node that maps to the Details column. So, when the procedure runs data is extracted from the various nodes and elements and what have you into various tables specified in the procedure. The Details column gets populated as well with text data. Now the data type of Details needs to be changed to BLOB. I tried adding a dummy column to the table and set its datatype to BLOB and run the procedure, but I get a ORA-01461 error stating "can bind a LONG value only for insert into a LONG column". I assess from this that I can't insert text data straight into a BLOB. Therefore my question is how can I get it to insert the data into the Details column if it is changed to a BLOB. Is there a way you can convert from text to binary format within the procedure so that when the insert is happening, no error is thrown out and the field is populated just like it would if were it a CLOB? If not, then what alternative is there to load the data for this column.

Any feedback would be appreciated and let me know if the problem I mention is not clear enough and I'll clarify as best as possible. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2007
Added on Feb 27 2007
6 comments
7,375 views