1

I am trying to insert blank data in blob column of table using C program in oracle database but it is inserting as Null, How to make it blank instead of null.data type is lpBlob.

1
  • define blank - short answer, fill your blob with 0x20 (that's spaces) Commented Mar 15, 2013 at 18:27

1 Answer 1

4

Depending on your definition of "blank", my assumption is that you want to use the empty_blob function

INSERT INTO table_name( ..., blob_column_name )
  VALUES( ..., empty_blob() );
Sign up to request clarification or add additional context in comments.

9 Comments

I am not using sql, I am inserting the data using C program
@user1773207 - Presumably, your C application is issuing SQL statements (either directly or via some client API). If you want to insert an empty BLOB, you'd need to use the empty_blob function.
I tried to fill blob with blank but still it is inserting null in oracle, Is there any function in C like java to insert empty blob.
@user1773207 - What API are you using? OCI? OCCI? Something else? Can you edit your question to include the code that you're using?
I am using OCI API, same code is working for other database(SQL server /DB2) but for oracle database it is inserting as NULL in blob field.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.