How to load a file into database column?
Submitted by: AdministratorWhile some other database systems might have an SQL function for this, with Firebird you need an application. Datatype that holds binary files is called BLOB, and you should use sub_type zero, as sub_type one is for text-only data. Let's create a table to hold the file. We'll have a filename column and a blob column containing the file itself:
CREATE TABLE t1
(
file_name VARCHAR(200),
file_data BLOB SUB_TYPE 0
);
The blobs are loaded via parametrized query:
INSERT INTO t1 (file_name, file_data) VALUES (?, ?);
Submitted by: Administrator
CREATE TABLE t1
(
file_name VARCHAR(200),
file_data BLOB SUB_TYPE 0
);
The blobs are loaded via parametrized query:
INSERT INTO t1 (file_name, file_data) VALUES (?, ?);
Submitted by: Administrator
Read Online Firebird Job Interview Questions And Answers
Top Firebird Questions
☺ | How to detect the server version? |
☺ | How to write UDF s in Delphi? |
☺ | How do convert or display the date or time as string? |
☺ | How to drop all foreign keys in database? |
☺ | Is there some bulk load or other way to import a lot of data fast? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |