由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Re: How to change Default SQL String Buffer Size(1K) for ODBC Driver
相关主题
Re: How to create a new database under SQL 7.0 from remote host?ODBC SQLEndTran problem
Help on SQL 2012 Add a Linked Server through ODBChelp! oracle8i client installation on Windows2000/NT4
谢谢skeptic,高低价,amnesia 三位大侠dbi informix text insertions question
what is the size limitation of Oracle JDBC Statement?请教:'now' 的时间是怎么实现的
[转载] MS SQL Server有没有一个C API?[转载] what's wrong with this PL/SQL
Job Opening - Junior Software/Database Developer (转载)create linked server problem, please help
help needa Store Procedure question...
A very basic question.问一个SQL LOADER BLOB的问题
相关话题的讨论汇总
话题: sql话题: odbc话题: 1k话题: string话题: size
进入Database版参与讨论
1 (共1页)
h****r
发帖数: 2056
1
But getObject only exists in Java, not C++, and my problems
is, say
SQL string like
"select .... from ... where ...", if its size over 1K, then
ODBC driver
will not accept it. Is there a way to extend the ODBC SQL
String 1K
limitation?
Thanks.
a*****a
发帖数: 438
2
I'm a bit confused with what you want.
Are you talking about the lenght of your sql command
statement, or the length of the column?
* If it's command statement, you may try put it in a stored
proc.
* If it's the length of the column (assuming you are using a
TEXT field):
If you use VC++'s ODBC, TEXT column is mapped to RFX_TEXT.
And it takes a default nMaxLength of 255 (you can check the
prototype of RFX_TEXT in afxdb.h). Just supply your length
to overwrite the default value.

【在 h****r 的大作中提到】
: But getObject only exists in Java, not C++, and my problems
: is, say
: SQL string like
: "select .... from ... where ...", if its size over 1K, then
: ODBC driver
: will not accept it. Is there a way to extend the ODBC SQL
: String 1K
: limitation?
: Thanks.

h****r
发帖数: 2056
3
yes, I mean the lenght of the sql command statement, store
procedure
is good, but maybe not fast. Now I overcome the 1k
limitation to 4k
limitation, it is the limiation of the ODBC packet size,
which is 4k.
Do you have some good way to over the 4k limiation of sql
statement?

【在 a*****a 的大作中提到】
: I'm a bit confused with what you want.
: Are you talking about the lenght of your sql command
: statement, or the length of the column?
: * If it's command statement, you may try put it in a stored
: proc.
: * If it's the length of the column (assuming you are using a
: TEXT field):
: If you use VC++'s ODBC, TEXT column is mapped to RFX_TEXT.
: And it takes a default nMaxLength of 255 (you can check the
: prototype of RFX_TEXT in afxdb.h). Just supply your length

a*****a
发帖数: 438
4
I don't see why you absolutely need a statement longer than
4K chars.. something must be wrong here.
And actually calling a stored procedure is almost always
faster in such case.

【在 h****r 的大作中提到】
: yes, I mean the lenght of the sql command statement, store
: procedure
: is good, but maybe not fast. Now I overcome the 1k
: limitation to 4k
: limitation, it is the limiation of the ODBC packet size,
: which is 4k.
: Do you have some good way to over the 4k limiation of sql
: statement?

h****r
发帖数: 2056
5


【在 a*****a 的大作中提到】
: I don't see why you absolutely need a statement longer than
: 4K chars.. something must be wrong here.
: And actually calling a stored procedure is almost always
: faster in such case.

h****r
发帖数: 2056
6
The reason is I have to provide an updateDb API for other
people to
insert data to tens of differnet kind of table, and some
statement for
insert a record is definetly over 4k, use CLOB by
prepare/bind/exec will overcome the size problem, but
because every table has different coloums,
It is hard to provide an common updateDb API for all tables
by prepare/bind/exec.
for example,
table A is (Number, Number, CLOB),
table B is (Number, CLOB, string, CLOB);
we cannot provide a common updateDb API for

【在 a*****a 的大作中提到】
: I don't see why you absolutely need a statement longer than
: 4K chars.. something must be wrong here.
: And actually calling a stored procedure is almost always
: faster in such case.

a*****a
发帖数: 438
7
If I were you, I'd use OLEDB instead of ODBC.
In OLEDB, you can just set all the column/param data and
then call IRowsetChan ge::SetData (equivalent of SQL UPDATE)

【在 h****r 的大作中提到】
: The reason is I have to provide an updateDb API for other
: people to
: insert data to tens of differnet kind of table, and some
: statement for
: insert a record is definetly over 4k, use CLOB by
: prepare/bind/exec will overcome the size problem, but
: because every table has different coloums,
: It is hard to provide an common updateDb API for all tables
: by prepare/bind/exec.
: for example,

h****r
发帖数: 2056
8
I found maybe use the prepare/bind/exec is a good way to
handle the
CLOB, but I meet some problem when use it. Do you ever have
expreience
and can point out what is wrong for my code?
I debugged it, the problem is from the SQLExecute, so the
SQLBindParameter
may have problem. But I really don't know where I can find
an example
to use them.
void updateClob(const char* lobString)
{
SQLRETURN lRetVal;
SQLHSTMT lSqlHstmt;
SQLINTEGER ind = SQL_DATA_AT_EXEC;


【在 a*****a 的大作中提到】
: If I were you, I'd use OLEDB instead of ODBC.
: In OLEDB, you can just set all the column/param data and
: then call IRowsetChan ge::SetData (equivalent of SQL UPDATE)

a****o
发帖数: 37
9
big string for a query is not good for network bandwidth.
why not try stored procedure?

【在 h****r 的大作中提到】
: But getObject only exists in Java, not C++, and my problems
: is, say
: SQL string like
: "select .... from ... where ...", if its size over 1K, then
: ODBC driver
: will not accept it. Is there a way to extend the ODBC SQL
: String 1K
: limitation?
: Thanks.

1 (共1页)
进入Database版参与讨论
相关主题
问一个SQL LOADER BLOB的问题[转载] MS SQL Server有没有一个C API?
申请一FINANCIAL 的职位.和经理, VP 上周面完了.Job Opening - Junior Software/Database Developer (转载)
JDBC-ODBC Bridge supporting JDBC API 2.0?help need
ODBC to Drive SQL on Text Files?A very basic question.
Re: How to create a new database under SQL 7.0 from remote host?ODBC SQLEndTran problem
Help on SQL 2012 Add a Linked Server through ODBChelp! oracle8i client installation on Windows2000/NT4
谢谢skeptic,高低价,amnesia 三位大侠dbi informix text insertions question
what is the size limitation of Oracle JDBC Statement?请教:'now' 的时间是怎么实现的
相关话题的讨论汇总
话题: sql话题: odbc话题: 1k话题: string话题: size