On 2010-02-13 14:00, Alexander Barkov wrote:
Hello,
I am a new in MonetDB.
I'm testing MonetDB + unixODBC with an application which inserts long BLOB values, and I'm having some problems.
Can you please help me?
1. When I use
rc= SQLBindParameter(hstmt, position, SQL_PARAM_INPUT, SQL_C_DEFAULT, SQL_LONGVARBINARY, 0, 0, (char*) data, data_size, &BindBuf[position].size);
I get error "Optional feature is not implemented".
If I change SQL_LONGVARBINARY to SQL_VARCHAR, it works, however it wants the data in HEX notation, instead of raw binary buffer. That means I need 2*data_size extra memory to encode my binary data in hex, and then send the result send to SQLBindParameter.
Is there a way to bind raw binary data, to avoid hex encoding?
Looking at the code (and not actually trying it), I'd think that you should be able to use raw binary data when using SQL_VARCHAR. However, you do need to specify the actual length and not rely on SQL_NTS. I'll look into this more later.
2. When I insert blob data using rc= SQLExecDirect(hstms, "INSERT INTO t1 (blob_column)" "VALUES " "('<long hex-string>')", SQL_NTS);
It works fine for short data, but it returns this error when hex-string is long enough:
[SQLSTATE:S1000][unixODBC][MonetDB][ODBC Driver 1.0]current transaction is aborted (please ROLLBACK)
I guess I hit some maximum possible query length limit, or maybe maximum possible transaction size.
Is there a way to configure MonetDB to allow longer values?
How large is your data? I'm not aware of any limit in the server.
3. Does the native MonetDB API have the same limitations with the bind types and maximum query(or transaction) size?
The ODBC driver is built on top of the MonetDB API so inherits any limitations the API may have. Having said that, I can't think of any limitation off the top of my head. But again, how much data are we talking about?
Thank you very much!
------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- Sjoerd Mullender