![]() |
![]() |
![]() |
GNOME Data Access 4.0 manual | ![]() |
---|---|---|---|---|
#include <providers-support/gda-pstmt.h> GdaPStmt; void gda_pstmt_set_gda_statement (GdaPStmt *pstmt, GdaStatement *stmt); GdaStatement* gda_pstmt_get_gda_statement (GdaPStmt *pstmt); void gda_pstmt_copy_contents (GdaPStmt *src, GdaPStmt *dest);
The GdaPStmt represents the association between a GdaStatement statement and a prepared statement which is database dependant and is an in-memory representation of a statement. Using prepared statement has the following advantages:
the parsing of the SQL has to be done only once, which improves performances if the statement has to be executed more than once
if a statement has been prepared, then it means it is syntaxically correct and has been understood by the database's API
it is possible to use variables in prepared statement which eliminates the risk of SQL code injection
The GdaPStmt is not intended to be instanciated, but subclassed by database provider's implementation.
Once created, the database provider's implementation can decide to associate (for future lookup) to
a GdaStatement object in a connection using
gda_connection_add_prepared_statement()
.
void gda_pstmt_set_gda_statement (GdaPStmt *pstmt, GdaStatement *stmt);
Informs pstmt
that it corresponds to the preparation of the stmt
statement
|
a GdaPStmt object |
|
a GdaStatement object |
GdaStatement* gda_pstmt_get_gda_statement (GdaPStmt *pstmt);
Get a pointer to the GdaStatement which led to the creation of this prepared statement
|
a GdaPStmt object |
Returns : |
the GdaStatement |