0

I'm developing an application that pulls information from a Firebird SQL database (accessed via the network) that sits behind an existing application.

To get an idea of what the most commonly used tables are in the application, I've run Wireshark while using the application to capture the SQL statements that are transmitted to the database server when the program is running.

I have no problem viewing what tables are being accessed via the application, however some of the query values passed over the network are not being displayed in the captured SQL packets. Instead these values are replaced with what I assume is a variable of some sort.

Heres a sample query:

select * from supp\x0d\x0aWHERE SUPP.ID=? /* BIND_0 */ \x0d\x0a

(I am assumming \x0d\x0a is used to denote a newline in the SQL query)

Has anyone any idea how I may be able to view the values associated with BIND_0 or /* BIND_0 */?

Any help is much appreciated.

P.S. The version of Firebird I am using is 1.5 - I understand there are syntactical differences in the SQL used in this version and more recent versions.

4

1 回答 1

2

That /* BIND_0 */ is simply a comment (probably generated by the tool that generated the query), the placeholder is the question mark before that. In Firebird statements are - usually - first prepared by sending the query text (with or without placeholders) to the server with operation op_prepare_statement = 68 (0x44). The server then returns a description of the bind variables and the datatypes of the result set.

当查询实际执行时,客户端会将所有绑定变量与执行请求(通常在 operation op_execute= 63 (0x3F) 中)一起发送到一个名为 XSQLDA 的结构中。

于 2013-06-06T12:16:19.280 回答