I want to INSERT a binary (blob) with just a SQL statement

Question: Question:

I want to INSERT binary data (blob) purely with SQL statements without using files.
In Oracle, it seems that it can be realized in hexadecimal notation as described in this article .

INSERT INTO BLOB_MEDIA (CONTENT_ID, MEDIA)
   VALUES ( 1, HEXTORAW('3E00210102CDA000C9') )

What should I do with PostgreSQL and SQL Server?

Answer: Answer:

In SQL Server, binary values ​​can be written in hexadecimal with 0x without quotes, such as 0xABCDEF0123456789 .

Scroll to Top