Home » U++ Library support » U++ SQL » MSSQL binary data
Re: MSSQL binary data [message #19228 is a reply to message #19224] |
Fri, 21 November 2008 21:23 |
|
mirek
Messages: 13976 Registered: November 2005
|
Ultimate Member |
|
|
luzr wrote on Fri, 21 November 2008 09:24 | Well, I needed to store image files into MSSQL and found we have no real support there yet...
I guess this should be addressed soon, anyway, for now, here is very simple function to workaround the insert/update (fetch seems to work):
SqlVal MsSqlBinary(const String& data)
{
return SqlVal("convert(varbinary(max), '0x" + HexString(data) + "', 1)", SqlS::FN);
}
Mirek
|
Well, this simpler variant works too:
SqlVal MsSqlBinary(const String& data)
{
return SqlVal("0x" + HexString(data), SqlS::HIGH);
}
Interestingly, it seems like similar method should work for Oracle and MySql as well:
http://www.herongyang.com/jdbc/Oracle-BLOB-SQL-INSERT.html
Something to add to SqlExp. So far, with Oracle, I was always using SqlRaw, but that means no SqlExp...
Mirek
|
|
|
Goto Forum:
Current Time: Fri May 10 02:37:27 CEST 2024
Total time taken to generate the page: 0.02106 seconds
|