\hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{}\section{Qore\+:\+:S\+QL\+:\+:S\+Q\+L\+Statement Class Reference}
\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement}\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}


The \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} class provides the most flexibilty for executing \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} on a database server.  




Inheritance diagram for Qore\+:\+:S\+QL\+:\+:S\+Q\+L\+Statement\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=261pt]{class_qore_1_1_s_q_l_1_1_s_q_l_statement__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab2435b87ba94bcd5b064084c0930d92c}{active} ()
\begin{DoxyCompactList}\small\item\em Returns \hyperlink{basic_data_types_True}{True} if the object is currently active and has a connection or transaction lock allocated to it, or \hyperlink{basic_data_types_False}{False} if not. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62e2cbca10b9b848b26fd7ebfa5dd753}{affected\+Rows} ()
\begin{DoxyCompactList}\small\item\em Returns the number of rows affected by the last call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a3fe33af34dfcd763f12d406c91305916}{begin\+Transaction} ()
\begin{DoxyCompactList}\small\item\em Manually starts a transaction and allocates a connection or grabs the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{bind} (...)
\begin{DoxyCompactList}\small\item\em Binds placeholder buffer specifications and values to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{bind\+Args} (softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Binds placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{bind\+Placeholders} (...)
\begin{DoxyCompactList}\small\item\em Binds placeholder buffer specifications to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{bind\+Placeholders\+Args} (softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Binds placeholder buffer specifications given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{bind\+Values} (...)
\begin{DoxyCompactList}\small\item\em Binds values to value buffer specifications to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{bind\+Values\+Args} (softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Binds values to value buffer specifications given as a list in the single argument to the method to value buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a568ebcbb44ae14b127487524169b0d78}{close} ()
\begin{DoxyCompactList}\small\item\em Closes the statement if it is open, however this method does not release the connection or transaction lock. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}{commit} ()
\begin{DoxyCompactList}\small\item\em Commits the transaction, releases the connection or the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}, and closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{constructor} (\hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} ds)
\begin{DoxyCompactList}\small\item\em Creates the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object based on the given \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object that provides the connection to the database. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af4ab2449388ac84f174e9ae2e9da2ce2}{constructor} (\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} dsp)
\begin{DoxyCompactList}\small\item\em Creates the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object based on the given \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object that provides the connection to the database. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a78fc987d855bd283c1ac4192743453cb}{copy} ()
\begin{DoxyCompactList}\small\item\em Throws an exception; objects of this class cannot be copied. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a50d360812380f793b0b0ab7f0b181792}{current\+Thread\+In\+Transaction} ()
\begin{DoxyCompactList}\small\item\em Returns \hyperlink{basic_data_types_True}{True} if the current thread is in a transaction (i.\+e. holds the transaction lock), \hyperlink{basic_data_types_False}{False} if not. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a22375c4a7755215cc53accc68b626ec7}{define} ()
\begin{DoxyCompactList}\small\item\em Performs an explicit define operation on the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1cc37a8464e3c8a6e50b08d366d3d629}{describe} ()
\begin{DoxyCompactList}\small\item\em Describes columns in the statement result. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a235cd43bb5a46e9906c220d9caf0659a}{destructor} ()
\begin{DoxyCompactList}\small\item\em Closes the statement if it is open and destroys the object. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{exec} (...)
\begin{DoxyCompactList}\small\item\em Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} before executing the statement. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{exec\+Args} (softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}{fetch\+Columns} (softint rows=-\/1)
\begin{DoxyCompactList}\small\item\em Retrieves a block of rows as a hash of lists with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{fetch\+Row} ()
\begin{DoxyCompactList}\small\item\em Retrieves the current row as a hash where the keys are the column names and the values are the column values. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}{fetch\+Rows} (softint rows=-\/1)
\begin{DoxyCompactList}\small\item\em Retrieves a block of rows as a list of hashes with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}{get\+Output} ()
\begin{DoxyCompactList}\small\item\em Retrieves output buffers as a hash; result sets will be returned as hashes of lists. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}{get\+Output\+Rows} ()
\begin{DoxyCompactList}\small\item\em Retrieves output buffers as a hash; result sets will be returned as lists of hashes. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a61c9cdf7687934dd54faf0c4cb5dd2c6}{get\+S\+QL} ()
\begin{DoxyCompactList}\small\item\em Returns the current \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string set with the call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()} or \hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG} if no \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} has been set. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a28e5fae36d515312aef330f8b26df817}{get\+Value} ()
\begin{DoxyCompactList}\small\item\em Retrieves the current row as a hash where the keys are the column names and the values are the column values. \end{DoxyCompactList}\item 
auto \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af7fe60e95959cc5eb6cf0046adcb9ec6}{member\+Gate} (\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} key)
\begin{DoxyCompactList}\small\item\em This method allows \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} objects to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{next} ()
\begin{DoxyCompactList}\small\item\em Increments the row pointer when retrieving rows from a select statement; returns \hyperlink{basic_data_types_True}{True} if there is a row to retrieve, \hyperlink{basic_data_types_False}{False} if not. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{prepare} (\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} sql,...)
\begin{DoxyCompactList}\small\item\em Saves an \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} statement that will be prepared and executed later, along with optional arguments. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{prepare\+Raw} (\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} sql)
\begin{DoxyCompactList}\small\item\em Saves an \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} statement that will be prepared and executed later. \end{DoxyCompactList}\item 
nothing \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}{rollback} ()
\begin{DoxyCompactList}\small\item\em Closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}, performs a transaction rollback, and releases the connection or the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}, and closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62c5937fb1ce112f54fdfe6f4f49ae24}{valid} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if the object is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not (use when iterating with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}) \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} class provides the most flexibilty for executing \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} on a database server. 

\begin{DoxyParagraph}{Restrictions\+:}
\hyperlink{group__parse__options_gac496a9d9bcf9d5c626c8c267c73a83bc}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+D\+A\+T\+A\+B\+A\+SE}
\end{DoxyParagraph}
This class allows statements to be executed and result sets to be iteratively returned in all formats supported by Qore (single row at a time as a hash or blocks of rows as either hashes of lists or lists of hashes). The same flexibility of choosing the output format for result sets also applies to output values from stored procedure or function execution, for example.

This class does not differentiate between executing select statements, stored procedures, functions, or other \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} code; the transaction lock for \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} objects and a dedicated connection for \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} objects is allocated to the object when the connection is necessary, and it is not automatically released by this class. The transaction lock or connection must be manually released by calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}{S\+Q\+L\+Statement\+::commit()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}{S\+Q\+L\+Statement\+::rollback()} (or the methods with the same name in the parent \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} or \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object).

Here is an example executing a select statement\+: 
\begin{DoxyCode}
\{
    SQLStatement stmt(ds);
    \textcolor{comment}{# release transaction lock on exit}
    on\_exit stmt.commit();
    stmt.prepare(\textcolor{stringliteral}{"select * from table"});
    \textcolor{keywordflow}{while} (stmt.next()) \{
        hash<auto> row = stmt.fetchRow();
        do\_something(row);
    \}
\}
\end{DoxyCode}


\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Most commands are executed implicitly; for example, in the example above there is no call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} as it is executed implicitly in the initial call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}.
\item Current column values in query results iterated with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} as above can also be dereferenced directly from the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object by using the column name in lower case as a member name (using \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af7fe60e95959cc5eb6cf0046adcb9ec6}{S\+Q\+L\+Statement\+::member\+Gate()}, see that method for an example)
\item Query results can also be returned in blocks using \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}{S\+Q\+L\+Statement\+::fetch\+Rows()} and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}{S\+Q\+L\+Statement\+::fetch\+Columns()} (\char`\"{}rows\char`\"{} and \char`\"{}columns\char`\"{} in this case refer to the output data format; also using these methods there is no need to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()})
\item When using an \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool}, the statement will be automatically closed when the connection is returned to the pool (for example, by committing or rolling back the transaction).
\end{DoxyItemize}
\end{DoxyNote}
The following methods are useful when executing all statements\+:
\begin{DoxyItemize}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{S\+Q\+L\+Statement\+::bind()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{S\+Q\+L\+Statement\+::bind\+Args()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{S\+Q\+L\+Statement\+::bind\+Placeholders()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{S\+Q\+L\+Statement\+::bind\+Placeholders\+Args()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{S\+Q\+L\+Statement\+::bind\+Values()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a3fe33af34dfcd763f12d406c91305916}{S\+Q\+L\+Statement\+::begin\+Transaction()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}{S\+Q\+L\+Statement\+::commit()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}{S\+Q\+L\+Statement\+::rollback()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a568ebcbb44ae14b127487524169b0d78}{S\+Q\+L\+Statement\+::close()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a61c9cdf7687934dd54faf0c4cb5dd2c6}{S\+Q\+L\+Statement\+::get\+S\+Q\+L()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab2435b87ba94bcd5b064084c0930d92c}{S\+Q\+L\+Statement\+::active()}
\end{DoxyItemize}

The following methods are useful when executing select statements\+:
\begin{DoxyItemize}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}{S\+Q\+L\+Statement\+::fetch\+Rows()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}{S\+Q\+L\+Statement\+::fetch\+Columns()}
\end{DoxyItemize}

The following methods are useful when executing stored procedures, functions, or other non-\/select \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} statements\+:
\begin{DoxyItemize}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}{S\+Q\+L\+Statement\+::get\+Output()}
\item \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}{S\+Q\+L\+Statement\+::get\+Output\+Rows()}
\end{DoxyItemize}

\begin{DoxyNote}{Note}
This class is not available with the \hyperlink{group__parse__options_gac496a9d9bcf9d5c626c8c267c73a83bc}{P\+O\+\_\+\+N\+O\+\_\+\+D\+A\+T\+A\+B\+A\+SE} parse option 
\end{DoxyNote}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab2435b87ba94bcd5b064084c0930d92c}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab2435b87ba94bcd5b064084c0930d92c}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!active@{active}}
\index{active@{active}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{active()}{active()}}
{\footnotesize\ttfamily bool Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::active (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Returns \hyperlink{basic_data_types_True}{True} if the object is currently active and has a connection or transaction lock allocated to it, or \hyperlink{basic_data_types_False}{False} if not. 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if the object is currently active and has a connection or transaction lock allocated to it, or \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (stmt.active())
    stmt.commit();
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_aa6e9c12936aca9c1c6b4eb151cd3d0a7}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62e2cbca10b9b848b26fd7ebfa5dd753}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62e2cbca10b9b848b26fd7ebfa5dd753}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!affected\+Rows@{affected\+Rows}}
\index{affected\+Rows@{affected\+Rows}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{affected\+Rows()}{affectedRows()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int} Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::affected\+Rows (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Returns the number of rows affected by the last call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} 

\begin{DoxyReturn}{Returns}
the number of rows affected by the last call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
int rc = stmt.affectedRows();
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_af32268f269fc8e29cb4966ec70d40b26}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a3fe33af34dfcd763f12d406c91305916}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a3fe33af34dfcd763f12d406c91305916}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!begin\+Transaction@{begin\+Transaction}}
\index{begin\+Transaction@{begin\+Transaction}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{begin\+Transaction()}{beginTransaction()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::begin\+Transaction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Manually starts a transaction and allocates a connection or grabs the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.beginTransaction();
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a50fe98b66f009c1fce620ce42dc77c62}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind@{bind}}
\index{bind@{bind}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind()}{bind()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds placeholder buffer specifications and values to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

Any arguments previously bound will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em ...} & Arguments to placeholder specifications (if required by the underlying D\+BI driver) and bind by value arguments\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    stmt.bind(h.id, h.name);
    stmt.exec();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{S\+Q\+L\+Statement\+::bind\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{S\+Q\+L\+Statement\+::bind\+Placeholders()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{S\+Q\+L\+Statement\+::bind\+Placeholders\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{S\+Q\+L\+Statement\+::bind\+Values()}, and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a53fbcc157b43c9f733e738f033c5b133}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind\+Args@{bind\+Args}}
\index{bind\+Args@{bind\+Args}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind\+Args()}{bindArgs()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind\+Args (\begin{DoxyParamCaption}\item[{softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

Any arguments previously bound will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em vargs} & Arguments to placeholder specifications (if required by the underlying D\+BI driver) and bind by value arguments\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    list<auto> args = (h.id, h.name);
    stmt.bindArgs(args);
    stmt.exec();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{S\+Q\+L\+Statement\+::bind()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{S\+Q\+L\+Statement\+::bind\+Placeholders()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{S\+Q\+L\+Statement\+::bind\+Placeholders\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{S\+Q\+L\+Statement\+::bind\+Values()}, and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_aecef7bdce44fb28daf3ffda44bd395b6}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind\+Placeholders@{bind\+Placeholders}}
\index{bind\+Placeholders@{bind\+Placeholders}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind\+Placeholders()}{bindPlaceholders()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind\+Placeholders (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds placeholder buffer specifications to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method. Only placeholder buffer specifications will be processed; value buffer specifications will be skipped by this method.

Any buffer specifications previously defined will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind buffer specifications directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.~\newline
~\newline
 Not all D\+BI drivers require binding placeholders specification.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em ...} & Arguments to placeholder specifications (if required by the underlying D\+BI driver)\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"begin select sysdate into :sd from dual"}, Type::Date); end;
stmt.bindPlaceholders(Type::Date);
date d = stmt.getOutput().sd;
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{S\+Q\+L\+Statement\+::bind()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{S\+Q\+L\+Statement\+::bind\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{S\+Q\+L\+Statement\+::bind\+Placeholders\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{S\+Q\+L\+Statement\+::bind\+Values()}, and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a0311c65d5483cd9cbaf48dc59f437895}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind\+Placeholders\+Args@{bind\+Placeholders\+Args}}
\index{bind\+Placeholders\+Args@{bind\+Placeholders\+Args}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind\+Placeholders\+Args()}{bindPlaceholdersArgs()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind\+Placeholders\+Args (\begin{DoxyParamCaption}\item[{softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds placeholder buffer specifications given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method. Only placeholder buffer specifications will be processed; value buffer specifications will be skipped by this method.

Any buffer specifications previously defined will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind buffer specifications directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.~\newline
~\newline
 Not all D\+BI drivers require binding placeholders specification.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em vargs} & Arguments to placeholder specifications (if required by the underlying D\+BI driver)\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"begin select sysdate into :sd from dual"}, Type::Date); end;
list<auto> l = \hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}(Type::Date);
stmt.bindPlaceholdersArgs(l);
date d = stmt.getOutput().sd;
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{S\+Q\+L\+Statement\+::bind()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{S\+Q\+L\+Statement\+::bind\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{S\+Q\+L\+Statement\+::bind\+Placeholders()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}{S\+Q\+L\+Statement\+::bind\+Values()}, and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a515142e47a51687427a8e6715bc35a70}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab831457973f8279ce9783039cd5a720c}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind\+Values@{bind\+Values}}
\index{bind\+Values@{bind\+Values}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind\+Values()}{bindValues()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind\+Values (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds values to value buffer specifications to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

Any values previously bound will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em ...} & Arguments to bind by value arguments\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    stmt.bindValues(h.id, h.name);
    stmt.exec();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ae42a182f328c30f24a8092e5891631a3}{S\+Q\+L\+Statement\+::bind()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a6f55e9c97db5b359315ead0dc5b4effe}{S\+Q\+L\+Statement\+::bind\+Args()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aacfe5d7ba6e1c1b6fcf5e7bc979c945f}{S\+Q\+L\+Statement\+::bind\+Placeholders()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_abcf1db95fb3e85e4677f141d9176b711}{S\+Q\+L\+Statement\+::bind\+Placeholders\+Args()}, and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}{S\+Q\+L\+Statement\+::bind\+Values\+Args()}. 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_addf98ea5bdf907ae646a7f2f8e1607c0}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a01789f9ed02c8fc9e0b0493cf1823cb5}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!bind\+Values\+Args@{bind\+Values\+Args}}
\index{bind\+Values\+Args@{bind\+Values\+Args}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{bind\+Values\+Args()}{bindValuesArgs()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::bind\+Values\+Args (\begin{DoxyParamCaption}\item[{softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Binds values to value buffer specifications given as a list in the single argument to the method to value buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

Any values previously bound will be released when this call is made.

\begin{DoxyNote}{Note}
You can also bind directly when calling \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} as a shortcut as well, in which case it\textquotesingle{}s not necessary to make an extra call to this method.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em vargs} & Arguments to bind by value arguments\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    list<auto> args = (h.id, h.name);
    stmt.bindValuesArgs(args);
    stmt.exec();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_ae80b0921b26b6455b85ae727e57b1fa0}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a568ebcbb44ae14b127487524169b0d78}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a568ebcbb44ae14b127487524169b0d78}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!close@{close}}
\index{close@{close}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{close()}{close()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::close (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Closes the statement if it is open, however this method does not release the connection or transaction lock. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.close();
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a3be914ba53e691d4ee4655973de3718b}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!commit@{commit}}
\index{commit@{commit}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{commit()}{commit()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::commit (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Commits the transaction, releases the connection or the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}, and closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.commit();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
For possible exceptions; see D\+BI driver docs for the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a4a5a12d0ca11cea1862152de47f0c812}{commit()} method 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a721847f8231a8e1539542dbe5bca606d}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::constructor (\begin{DoxyParamCaption}\item[{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource}}]{ds }\end{DoxyParamCaption})}



Creates the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object based on the given \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object that provides the connection to the database. 

This method will throw an exception only if the object passed as an argument uses a driver that does not support the prepared statement interface added in Qore version 0.\+8.\+1.


\begin{DoxyParams}{Parameters}
{\em ds} & The \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object to use for the DB connection for the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
SQLStatement stmt(db);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & the D\+BI driver for the given object does not support the prepared statement A\+PI\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+1 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af4ab2449388ac84f174e9ae2e9da2ce2}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af4ab2449388ac84f174e9ae2e9da2ce2}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::constructor (\begin{DoxyParamCaption}\item[{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool}}]{dsp }\end{DoxyParamCaption})}



Creates the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object based on the given \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object that provides the connection to the database. 

This method will throw an exception only if the object passed as an argument uses a driver that does not support the prepared statement interface added in Qore version 0.\+8.\+1.


\begin{DoxyParams}{Parameters}
{\em dsp} & The \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object to use for the DB connection for the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} object\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
SQLStatement stmt(db);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & the D\+BI driver for the given object does not support the prepared statement A\+PI\\
\hline
\end{DoxyExceptions}
\begin{DoxySince}{Since}
Qore 0.\+8.\+1 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a78fc987d855bd283c1ac4192743453cb}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a78fc987d855bd283c1ac4192743453cb}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!copy@{copy}}
\index{copy@{copy}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Throws an exception; objects of this class cannot be copied. 


\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+C\+O\+P\+Y-\/\+E\+R\+R\+OR} & \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} objects cannot be copied \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a50d360812380f793b0b0ab7f0b181792}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a50d360812380f793b0b0ab7f0b181792}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!current\+Thread\+In\+Transaction@{current\+Thread\+In\+Transaction}}
\index{current\+Thread\+In\+Transaction@{current\+Thread\+In\+Transaction}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{current\+Thread\+In\+Transaction()}{currentThreadInTransaction()}}
{\footnotesize\ttfamily bool Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::current\+Thread\+In\+Transaction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Returns \hyperlink{basic_data_types_True}{True} if the current thread is in a transaction (i.\+e. holds the transaction lock), \hyperlink{basic_data_types_False}{False} if not. 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if the current thread is in a transaction (i.\+e. holds the transaction lock), \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
bool b = stmt.currentThreadInTransaction();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
Qore 0.\+8.\+12 
\end{DoxySince}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_afb9a48701323d1c620f4bfcf40e4ba78}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a22375c4a7755215cc53accc68b626ec7}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a22375c4a7755215cc53accc68b626ec7}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!define@{define}}
\index{define@{define}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{define()}{define()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::define (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Performs an explicit define operation on the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. 

It is not encessary to call this method manually; define operations are implicitly executed when needed when retrieving values from a select statement

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\{
    SQLStatement stmt(ds);
    \textcolor{comment}{# release transaction lock on exit}
    on\_exit stmt.commit();
    stmt.prepare(\textcolor{stringliteral}{"select * from table"});
    stmt.exec();
    stmt.define();
    \textcolor{comment}{# note that the SQLStatement::next() would implicitly execute exec() and define()}
    \textcolor{keywordflow}{while} (stmt.next()) \{
        hash<auto> row = stmt.fetchRow();
        do\_something(row);
    \}
\}
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a7f767fcdc63e67b201acfa73cc3c5b82}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1cc37a8464e3c8a6e50b08d366d3d629}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1cc37a8464e3c8a6e50b08d366d3d629}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!describe@{describe}}
\index{describe@{describe}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{describe()}{describe()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::describe (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Describes columns in the statement result. 

\begin{DoxyReturn}{Returns}
a hash with ({\itshape column\+\_\+name}\+: {\itshape description\+\_\+hash}) format, where each {\itshape description\+\_\+hash} has the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}name\char`\"{}}\+: (string) the column name
\item {\ttfamily \char`\"{}type\char`\"{}}\+: (integer) the column type code (as returned by \hyperlink{class_qore_1_1zzz8valuezzz9_a5e7d381ab49abebd0d0f045708482512}{Qore\+::zzz8valuezzz9\+::type\+Code()})
\item {\ttfamily \char`\"{}maxsize\char`\"{}}\+: (integer) the maximum size of the column
\item {\ttfamily \char`\"{}native\+\_\+type\char`\"{}}\+: (string) the database-\/specific name of the type
\item {\ttfamily \char`\"{}internal\+\_\+id\char`\"{}}\+: (integer) the database-\/specific type code of the type 
\end{DoxyItemize}
\end{DoxyReturn}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a4ace76d7521c621918188bb89c3c4288}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a235cd43bb5a46e9906c220d9caf0659a}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a235cd43bb5a46e9906c220d9caf0659a}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!destructor@{destructor}}
\index{destructor@{destructor}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{destructor()}{destructor()}}
{\footnotesize\ttfamily Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::destructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Closes the statement if it is open and destroys the object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
delete stmt;
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!exec@{exec}}
\index{exec@{exec}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{exec()}{exec()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::exec (\begin{DoxyParamCaption}\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} before executing the statement. 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Optional arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

If bind arguments are provided, any arguments previously bound will be released when this call is made.

After calling this method to execute the statement, to retrieve information about the call or output values bound in the call, call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62e2cbca10b9b848b26fd7ebfa5dd753}{S\+Q\+L\+Statement\+::affected\+Rows()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}{S\+Q\+L\+Statement\+::get\+Output()}, or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}{S\+Q\+L\+Statement\+::get\+Output\+Rows()} as needed.

To retrieve rows from a select statement call either \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()}, or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}{S\+Q\+L\+Statement\+::fetch\+Rows()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}{S\+Q\+L\+Statement\+::fetch\+Columns()} as needed.


\begin{DoxyParams}{Parameters}
{\em ...} & Optional arguments to placeholder specifications (if required by the underlying D\+BI driver) and bind by value arguments can be given in the call to the method; if present, arguments are bound before the statement is executed\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    stmt.exec(h.id, h.name);
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}; the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} uses a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} an the statement was prepared on another connection\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}{S\+Q\+L\+Statement\+::exec\+Args()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a1fd3fd0ce29a4eb110dd6ff416195bda}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a58ffbb1fb12036db5027cf70918733b3}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!exec\+Args@{exec\+Args}}
\index{exec\+Args@{exec\+Args}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{exec\+Args()}{execArgs()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::exec\+Args (\begin{DoxyParamCaption}\item[{softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Executes the bound statement with any bound buffers, also optionally allows binding placeholder buffer specifications and values given as a list in the single argument to the method to buffers defined in \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} 

If the statement has not previously been prepared with the DB A\+PI, it will be implicitly prepared by this method call. This means that this call will cause a connection to be dedicated from a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} object or the transaction lock to be grabbed with a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource} object, depending on the argument to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}.

Optional arguments to buffer specifications must be given in the same order as declared in the string given to the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} method.

If bind arguments are provided, any arguments previously bound will be released when this call is made.

After calling this method to execute the statement, to retrieve information about the call or output values bound in the call, call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62e2cbca10b9b848b26fd7ebfa5dd753}{S\+Q\+L\+Statement\+::affected\+Rows()}, \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}{S\+Q\+L\+Statement\+::get\+Output()}, or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}{S\+Q\+L\+Statement\+::get\+Output\+Rows()} as needed.

To retrieve rows from a select statement call either \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} and \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()}, or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}{S\+Q\+L\+Statement\+::fetch\+Rows()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}{S\+Q\+L\+Statement\+::fetch\+Columns()} as needed.


\begin{DoxyParams}{Parameters}
{\em vargs} & Optional arguments to placeholder specifications (if required by the underlying D\+BI driver) and bind by value arguments can be given in the call to the method; if present, arguments are bound before the statement is executed\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"insert into table (id, name) values (%v, %v)"});
foreach hash<auto> h \textcolor{keywordflow}{in} (l) \{
    list<auto> args = (h.id, h.name);
    stmt.execArgs(args);
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}; the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} uses a \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} an the statement was prepared on another connection\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed; see the relevant D\+BI driver docs for more information
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af1633d031c7480fed7de638b21f9a087}{S\+Q\+L\+Statement\+::exec()} 
\end{DoxySeeAlso}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_aaf3f423da01bbe18b95eaf0cb53053f3}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab889448c79985fc26e41b7e2086308df}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!fetch\+Columns@{fetch\+Columns}}
\index{fetch\+Columns@{fetch\+Columns}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{fetch\+Columns()}{fetchColumns()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::fetch\+Columns (\begin{DoxyParamCaption}\item[{softint}]{rows = {\ttfamily -\/1} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves a block of rows as a hash of lists with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}. 

If the argument passed is omitted or less than or equal to zero, then all available rows from the current row position are retrieved, also if fewer rows are available than requested then only the rows available are retrieved.


\begin{DoxyParams}{Parameters}
{\em rows} & The maximum number of rows to retrieve, if this argument is omitted, negative, or equal to zero, then all available rows from the current row position are retrieved\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a hash (giving column names) of lists (giving row values for each column) of data returned; each list will have at most {\itshape rows} elements (unless {\itshape rows} is negative, in which case all available rows are returned). If the total number of rows available is less than {\itshape rows} (if {\itshape rows} is positive), then the last data returned by this method may return short lists. If no more rows are available, then an empty hash is returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash<auto> h = stmt.fetchColumns(-1);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item There is no need to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} when calling this method; the method automatically iterates through the given number of rows
\item Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when row values are retrieved; see the relevant D\+BI driver docs for more information 
\end{DoxyItemize}
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a9f8ed8237c4c866b657e492978aaa84d}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!fetch\+Row@{fetch\+Row}}
\index{fetch\+Row@{fetch\+Row}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{fetch\+Row()}{fetchRow()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::fetch\+Row (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves the current row as a hash where the keys are the column names and the values are the column values. 

Use with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} to iterate through the results of a select statement one row at a time

\begin{DoxyReturn}{Returns}
the current row as a hash where the keys are the column names and the values are the column values
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (stmt.next()) \{
    hash<auto> h = stmt.fetchRow();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when row values are retrieved; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a0e26549aee530ea728ecb13b35f854f8}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a9e36c9ff3e13b7bd65db1d67cd596e5a}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!fetch\+Rows@{fetch\+Rows}}
\index{fetch\+Rows@{fetch\+Rows}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{fetch\+Rows()}{fetchRows()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::fetch\+Rows (\begin{DoxyParamCaption}\item[{softint}]{rows = {\ttfamily -\/1} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves a block of rows as a list of hashes with the maximum number of rows determined by the argument passed; automatically advances the row pointer; with this call it is not necessary to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} 

If the argument passed is omitted or less than or equal to zero, then all available rows from the current row position are retrieved, also if fewer rows are available than requested then only the rows available are retrieved.

If no more rows are available then an empty list is returned.


\begin{DoxyParams}{Parameters}
{\em rows} & The maximum number of rows to retrieve, if this argument is omitted, negative, or equal to zero, then all available rows from the current row position are retrieved\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
list<auto> l = stmt.fetchRows(-1);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item There is no need to call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} when calling this method; the method automatically iterates through the given number of rows
\item Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when row values are retrieved; see the relevant D\+BI driver docs for more information 
\end{DoxyItemize}
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a6534d93f4686c55e6700dd59188500eb}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a1aed9317985c27bfd7ca6ca2c07be32b}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!get\+Output@{get\+Output}}
\index{get\+Output@{get\+Output}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{get\+Output()}{getOutput()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::get\+Output (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves output buffers as a hash; result sets will be returned as hashes of lists. 

\begin{DoxyReturn}{Returns}
Returns a hash of output buffers; result sets will be returned as hashes of lists. Each key in the hash is the same as the name given to the placeholder specification in the call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash<auto> h = stmt.getOutput();
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when output values are retrieved; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a677eeb9a87925099e2506db6a89fa998}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a5d4ec7e77c7bb751b7a49c7d8d6433e3}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!get\+Output\+Rows@{get\+Output\+Rows}}
\index{get\+Output\+Rows@{get\+Output\+Rows}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{get\+Output\+Rows()}{getOutputRows()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::get\+Output\+Rows (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves output buffers as a hash; result sets will be returned as lists of hashes. 

\begin{DoxyReturn}{Returns}
Retrieves output buffers as a hash; result sets will be returned as lists of hashes. Each key in the hash is the same as the name given to the placeholder specification in the call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash<auto> h = stmt.getOutputRows();
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when output values are retrieved; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a746ce99d4d6453963e899390a8c8ea4c}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a61c9cdf7687934dd54faf0c4cb5dd2c6}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a61c9cdf7687934dd54faf0c4cb5dd2c6}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!get\+S\+QL@{get\+S\+QL}}
\index{get\+S\+QL@{get\+S\+QL}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{get\+S\+Q\+L()}{getSQL()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::get\+S\+QL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Returns the current \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string set with the call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()} or \hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG} if no \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} has been set. 

\begin{DoxyReturn}{Returns}
Returns the current \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string set with the call to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()} or \hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG} if no \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} has been set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string sql = stmt.getSQL();
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_aa351dd140d5e1a6147a3a34e92614493}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a28e5fae36d515312aef330f8b26df817}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a28e5fae36d515312aef330f8b26df817}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!get\+Value@{get\+Value}}
\index{get\+Value@{get\+Value}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{get\+Value()}{getValue()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Retrieves the current row as a hash where the keys are the column names and the values are the column values. 

Use with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} to iterate through the results of a select statement one row at a time

\begin{DoxyReturn}{Returns}
the current row as a hash where the keys are the column names and the values are the column values
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (stmt.next()) \{
    hash<auto> h = stmt.getValue();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Equivalent to \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()}
\item Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed or when row values are retrieved; see the relevant D\+BI driver docs for more information
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+5 
\end{DoxySince}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a08e13d83166f84b2f3656e16c7008a7b}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af7fe60e95959cc5eb6cf0046adcb9ec6}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af7fe60e95959cc5eb6cf0046adcb9ec6}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!member\+Gate@{member\+Gate}}
\index{member\+Gate@{member\+Gate}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{member\+Gate()}{memberGate()}}
{\footnotesize\ttfamily auto Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::member\+Gate (\begin{DoxyParamCaption}\item[{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}]{key }\end{DoxyParamCaption})}



This method allows \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} objects to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. 

\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key} & the column name for the value to retrieve\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the current column value of the given row
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
SQLStatement stmt(ds);
\textcolor{comment}{# release transaction lock on exit}
on\_exit stmt.commit();
stmt.prepare(\textcolor{stringliteral}{"select name, birthdate from table"});
\textcolor{keywordflow}{while} (stmt.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"name: %s birthdate: %y"}, stmt.name, stmt.birthdate);
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()} \\
\hline
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+I\+T\+E\+R\+A\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & Cannot dereference statement iteration context; make sure and call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()} before trying to dereference the current row being iterated \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & this error is thrown if the given key cannot be converted to the \hyperlink{character_encoding_default_encoding}{default character encoding} \\
\hline
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+C\+O\+L\+U\+M\+N-\/\+E\+R\+R\+OR} & The given column name does not exist in the current row data\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Column values can only be dereferenced using the automatic \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_af7fe60e95959cc5eb6cf0046adcb9ec6}{S\+Q\+L\+Statement\+::member\+Gate()} method while iterating a result set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}; the hash that will be dereferenced is equivalent to that returned by \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()}
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+6 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!next@{next}}
\index{next@{next}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily bool Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Increments the row pointer when retrieving rows from a select statement; returns \hyperlink{basic_data_types_True}{True} if there is a row to retrieve, \hyperlink{basic_data_types_False}{False} if not. 

If this method returns True, then call \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ab58ac988ce3517a88e3d25f5b5fbdb2b}{S\+Q\+L\+Statement\+::fetch\+Row()} afterwards to retrieve the row

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if there is a row to retrieve, \hyperlink{basic_data_types_False}{False} if not (no more rows to be retrieved)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (stmt.next()) \{
    hash<auto> h = stmt.fetchRow();
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+Q\+L\+S\+T\+A\+T\+E\+M\+E\+N\+T-\/\+E\+R\+R\+OR} & No S\+QL has been set with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()} or \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Exceptions could be thrown by the D\+BI driver when the statement is prepared or when attempting to bind the given arguments to buffer specifications or when the statement is executed; see the relevant D\+BI driver docs for more information 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a45f7bd62a339149daa3f859012eb626f}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!prepare@{prepare}}
\index{prepare@{prepare}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{prepare()}{prepare()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::prepare (\begin{DoxyParamCaption}\item[{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}]{sql,  }\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Saves an \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} statement that will be prepared and executed later, along with optional arguments. 

The statement is actually only prepared when used for the first time, this is so that \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} objects created with \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} objects use the \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} more efficiently, as many drivers require the actual DB A\+PI prepare call to be made on the same connection as the connection the statement will be executed on as well.

\begin{DoxyNote}{Note}
This method parses the \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string for placeholders and bind by value tokens ({\ttfamily \%v}); for a version of this method that does not parse the \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string for placeholders and bind by value tokens, see \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}{S\+Q\+L\+Statement\+::prepare\+Raw()}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em sql} & The \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string to prepare for execution on the DB server\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepare(\textcolor{stringliteral}{"select * from table where id = %v"});
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a480f30622fff523ee188297b1eebfa79}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_aa0dadef84dc71fa6bb0dd1cac491f100}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!prepare\+Raw@{prepare\+Raw}}
\index{prepare\+Raw@{prepare\+Raw}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{prepare\+Raw()}{prepareRaw()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::prepare\+Raw (\begin{DoxyParamCaption}\item[{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}]{sql }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Saves an \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} statement that will be prepared and executed later. 

The statement is actually only prepared when used for the first time, this is so that \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement} objects created with \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} objects use the \hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool} more efficiently, as many drivers require the actual DB A\+PI prepare call to be made on the same connection as the connection the statement will be executed on as well.

\begin{DoxyNote}{Note}
This method does not parse the \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string for placeholders and bind by value tokens ({\ttfamily \%v}); for a version of this method that does parse the \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string for placeholders and bind by value tokens, see \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_ad05790f42e735a8ba687fcbc93d1480a}{S\+Q\+L\+Statement\+::prepare()}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em sql} & The \hyperlink{namespace_qore_1_1_s_q_l}{S\+QL} string to prepare for execution on the DB server\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.prepareRaw(\textcolor{stringliteral}{"select * from table"});
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a0f5d70f9678cd823fb1eb7aa99052fdd}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!rollback@{rollback}}
\index{rollback@{rollback}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{rollback()}{rollback()}}
{\footnotesize\ttfamily nothing Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::rollback (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}, performs a transaction rollback, and releases the connection or the transaction lock according to the object used in the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a39bdf5cf150edd5d30f75719e3887a55}{S\+Q\+L\+Statement\+::constructor()}, and closes the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{S\+Q\+L\+Statement}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
stmt.rollback();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
For possible exceptions; see D\+BI driver docs for the \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a545ae07df1d373713d431515dc778ce1}{rollback()} method 
\end{DoxyNote}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_ad243d89229ee65a43fe33d29137217c4}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62c5937fb1ce112f54fdfe6f4f49ae24}\label{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62c5937fb1ce112f54fdfe6f4f49ae24}} 
\index{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}!valid@{valid}}
\index{valid@{valid}!Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement@{Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement}}
\subsubsection{\texorpdfstring{valid()}{valid()}}
{\footnotesize\ttfamily bool Qore\+::\+S\+Q\+L\+::\+S\+Q\+L\+Statement\+::valid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \hyperlink{basic_data_types_True}{True} if the object is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not (use when iterating with \hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{S\+Q\+L\+Statement\+::next()}) 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if the object is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (i.valid())
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"current value: %y\(\backslash\)n"}, i.getValue());
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_ac43800cdf66d8a1e021989194d330306}{Qore\+::\+S\+Q\+L\+::\+Abstract\+S\+Q\+L\+Statement}.

