Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[BLOB SUB_TYPE TEXT] using in SQL

Status
Not open for further replies.

laffreuxthomas

Programmer
Sep 3, 2002
20
FR
Hi !

I vould like to insert a text in my BLOB field, with a SQL query that i write manually.
Is it possible ?

Thanks in advance !

Thomas
 
Hi Thomas,

If you mean INSERT INTO MYTABLE (MYBLOB) VALUES ('mytext') then No - this isn't possible.

There are 2 ways to do this:

A)

1) INSERT INTO MYTABLE (MYBLOB) VALUES :)myblob)
2) prepare the above statement
3) use the parameter to set your param (myblob) to the string value

B)

1) download an UDF library ( see section "contributed downloads" ) that can convert the string to a blob
2) like this:

INSERT INTO MYTABLE (MYBLOB) VALUES (F_StrToBlob('myvalue'))

With regards,
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Thanks.

Yes, but i work with Java, not with Delphi. I've done with my JDBC driver. It's quite complex, but it's working now.

Thank you for your response !

Thomas
 
Hi Thomas,

Next time, better mention you're working with Java :)

I guess you solved it with a PreparedStatement class, right? (my JDBC knowledge is a bit rusty)...

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
ok
Yes, with a PreparedStatement, you're right :)

Do you you know if it is possible to access Firebird by JDBC or ODBC ? Can i use the same drivers?

I'm working on an free open-sources software for creating database GUI. I'll finished to internationalize it next november (It's still a french software) . I would like to make it compatible with Firebird too.
 
Hi,

Subscribe yourself to "ib-support@yahoogroups.com" and ask about the Firebird JDBC driver - it's called JayBird I believe...

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top