[solved] ZQuery.Open internally requests metadata
Posted: 21.09.2012, 10:06
Hello!
First of all, excuse me for my English.
Problem: Some of RDBMS functions (like FOUND_ROWS() in
MySQL) must be called immediately after SQL command executive. When we
call TZQuery.Open, we send to server SQL statment, after that
TZQuery internally requests metadata from server. So, TZQuery.Open not
only send SQL request to server, but send commands (or another sql statments) to
get metadata. If after that we call RDBMS function (ZQueryCount.SQL =
'SELECT FOUND_ROWS() AS RecsCount'; ZQueryCount.Open), function return
wrong result.
Question: How i can send request to RDBMS, after method TZDataSet.Open send
SQL statement to server, but before TZDataSet.Open requests metadata?
I think Event like TZDataSet.AfterSqlSendBeforeGetMetadata can help,
but i do not now architecture of ZEOS library and can't implement
event.
Any ideas?
First of all, excuse me for my English.
Problem: Some of RDBMS functions (like FOUND_ROWS() in
MySQL) must be called immediately after SQL command executive. When we
call TZQuery.Open, we send to server SQL statment, after that
TZQuery internally requests metadata from server. So, TZQuery.Open not
only send SQL request to server, but send commands (or another sql statments) to
get metadata. If after that we call RDBMS function (ZQueryCount.SQL =
'SELECT FOUND_ROWS() AS RecsCount'; ZQueryCount.Open), function return
wrong result.
Question: How i can send request to RDBMS, after method TZDataSet.Open send
SQL statement to server, but before TZDataSet.Open requests metadata?
I think Event like TZDataSet.AfterSqlSendBeforeGetMetadata can help,
but i do not now architecture of ZEOS library and can't implement
event.
Any ideas?