\hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource}{}\doxysection{Qore\+::SQL\+::Abstract\+Datasource Class Reference}
\label{class_qore_1_1_s_q_l_1_1_abstract_datasource}\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}


This class defines an abstract interface for database access, inherited by both the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool}} classes.  




{\ttfamily \#include $<$QC\+\_\+\+Abstract\+Datasource.\+dox.\+h$>$}



Inheritance diagram for Qore\+::SQL\+::Abstract\+Datasource\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_s_q_l_1_1_abstract_datasource__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
abstract nothing \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{begin\+Transaction}} ()
\begin{DoxyCompactList}\small\item\em Manually signals the start of transaction management on the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}}. \end{DoxyCompactList}\item 
abstract nothing \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a885eed5b3f805ec931f6b5c8fc165c8b}{commit}} ()
\begin{DoxyCompactList}\small\item\em Commits the current transaction and releases any thread resources associated with the transaction. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a2760e15dfe892c6f37f4f9cab6e86379}{current\+Thread\+In\+Transaction}} ()
\begin{DoxyCompactList}\small\item\em Should return \mbox{\hyperlink{basic_data_types_True}{True}} if the current thread is in a transaction with this object, must be re-\/implemented in subclasses to provide the desired functionality. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a71cd33bd6be7230e8481b3b6a0d33892}{exec}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql,...)
\begin{DoxyCompactList}\small\item\em Executes an SQL command on the server and returns either the integer row count (for example, for updates, inserts, and deletes) or the data retrieved (for example, if a stored procedure is executed that returns values) \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a8ebf9c0e5bb529dab200ab95ab36a5d4}{exec\+Raw}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql)
\begin{DoxyCompactList}\small\item\em Executes an SQL command on the server and returns either the row count (for example, for updates and inserts) or the data retrieved (for example, if a stored procedure is executed that returns values) \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ad188ffb22d7cb8274fa8fa4255a28b8f}{get\+Client\+Version}} ()
\begin{DoxyCompactList}\small\item\em Retrieves the driver-\/specific client library version information. \end{DoxyCompactList}\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a65faab023768b1ce628ec43f68cdd832}{get\+Config\+Hash}} ()
\begin{DoxyCompactList}\small\item\em Returns a \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} describing the configuration of the current object. \end{DoxyCompactList}\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a79772d8676975c1ab23710bc91d666ae}{get\+Config\+String}} ()
\begin{DoxyCompactList}\small\item\em Returns a string giving the configuration of the current object in a format that can be parsed by \mbox{\hyperlink{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}{parse\+\_\+datasource()}} \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ae89ba7cab57748a51358e44ac5e231d5}{get\+DBEncoding}} ()
\begin{DoxyCompactList}\small\item\em Retrieves the database-\/specific charset set encoding for the object. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a1e0d642801b1ce96fea0553ae4def964}{get\+DBName}} ()
\begin{DoxyCompactList}\small\item\em Returns the database name parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item 
abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a26a5370cb70baed85f0d3a51a8f36cf9}{get\+Driver\+Name}} ()
\begin{DoxyCompactList}\small\item\em Returns the name of the driver used for the object. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a4ffcb9760eea609835734b27e7f97eac}{get\+Host\+Name}} ()
\begin{DoxyCompactList}\small\item\em Returns the hostname parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab5d951f88607a8f3580730c894cd4681}{get\+OSEncoding}} ()
\begin{DoxyCompactList}\small\item\em Returns the Qore character encoding name for the object as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a06f2779d1294b4d3f1880b55e650add0}{get\+Option}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} opt)
\begin{DoxyCompactList}\small\item\em Returns the current value for the given option. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_aa434cc346c31db17946fd62caf3160c7}{get\+Option\+Hash}} ()
\begin{DoxyCompactList}\small\item\em Returns the valid options for the driver associated with the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}} with descriptions and current values for the current \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}} object. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac245a7e0615433778ab7a61abf845c54}{get\+Password}} ()
\begin{DoxyCompactList}\small\item\em Returns the password parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a54d89afe6d44810ed7e141ba35310748}{get\+Port}} ()
\begin{DoxyCompactList}\small\item\em Gets the port number that will be used for the next connection to the server. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement}{Abstract\+SQLStatement}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_afdf23f69850ebb8e0c337ade7fcb793d}{get\+SQLStatement}} ()
\begin{DoxyCompactList}\small\item\em Returns an \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement}{Abstract\+SQLStatement}} object based on the current database connection object. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_acd2bef573f9d703c9511efd38bc1c2ec}{get\+Server\+Version}} ()
\begin{DoxyCompactList}\small\item\em Returns the driver-\/specific server version data for the current connection. \end{DoxyCompactList}\item 
abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_aea226bb7ae548363ae25a4f1e306b34a}{get\+User\+Name}} ()
\begin{DoxyCompactList}\small\item\em Returns the username parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. \end{DoxyCompactList}\item 
abstract bool \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac7fe5b3cf6789100950622138915517e}{in\+Transaction}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if a transaction is currently in progress. \end{DoxyCompactList}\item 
abstract nothing \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_acccf4e46fb29f2d12700cc6feb0c9438}{rollback}} ()
\begin{DoxyCompactList}\small\item\em Rolls the current transaction back and releases any thread resources associated with the transaction. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{select}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql,...)
\begin{DoxyCompactList}\small\item\em Executes an SQL select statement on the server and (normally) returns the result as a hash (column names) of lists (column values per row) \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a6d4bd90ff3b28a637b19254a7f09dfba}{select\+Row}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql,...)
\begin{DoxyCompactList}\small\item\em Executes an SQL select statement on the server and returns the first row as a hash (the column values) \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}{select\+Rows}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql,...)
\begin{DoxyCompactList}\small\item\em Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the column values) \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a68f3f2fd0d820097db47aac8cc9912fe}{vexec}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql, \+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Executes an SQL command on the server and returns either the integer row count (for example, for updates, inserts, and deletes) or the data retrieved (for example, if a stored procedure is executed that returns values), taking a list for all bind arguments. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac1dd6bceaddef45dc6db0001dc142180}{vselect}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql, \+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Executes a select statement on the server and returns the results in a hash (column names) of lists (column values per row), taking a list for all bind arguments. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a82bd28bd70590c4519053d058d61e0e6}{vselect\+Row}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql, \+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Executes a select statement on the server and returns the first row as a hash (column names and values), taking a list for all bind arguments. \end{DoxyCompactList}\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_afe2104486bab27d21e47760edae79cf3}{vselect\+Rows}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} sql, \+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$ vargs)
\begin{DoxyCompactList}\small\item\em Executes a select statement on the server and returns the results in a list (rows) of hashes (column names and values), taking a list for all bind arguments. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class defines an abstract interface for database access, inherited by both the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource}{Datasource}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool}{Datasource\+Pool}} classes. 

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_gac496a9d9bcf9d5c626c8c267c73a83bc}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+DATABASE}} 
\end{DoxyParagraph}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!beginTransaction@{beginTransaction}}
\index{beginTransaction@{beginTransaction}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{beginTransaction()}{beginTransaction()}}
{\footnotesize\ttfamily abstract nothing Qore\+::\+SQL\+::\+Abstract\+Datasource\+::begin\+Transaction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Manually signals the start of transaction management on the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}}. 

This method should be called when the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}} object will be shared between more than 1 thread, and a transaction will be started with a \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}} method or the like.

This method does not make any communication with the server to start a transaction; it only allocates the transaction lock to the current thread in Qore.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{db.beginTransaction();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a3be309ce31c8b980aaee71010c3048f0}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a04c351f440ddfdbe79f9b4ef26608e6f}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a885eed5b3f805ec931f6b5c8fc165c8b}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a885eed5b3f805ec931f6b5c8fc165c8b}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!commit@{commit}}
\index{commit@{commit}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{commit()}{commit()}}
{\footnotesize\ttfamily abstract nothing Qore\+::\+SQL\+::\+Abstract\+Datasource\+::commit (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Commits the current transaction and releases any thread resources associated with the transaction. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{db.commit();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_ab70fe02e890112a4449f0340ef7cc335}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a9919ad37d79e03e364bd41462c981aea}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a2760e15dfe892c6f37f4f9cab6e86379}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a2760e15dfe892c6f37f4f9cab6e86379}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!currentThreadInTransaction@{currentThreadInTransaction}}
\index{currentThreadInTransaction@{currentThreadInTransaction}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{currentThreadInTransaction()}{currentThreadInTransaction()}}
{\footnotesize\ttfamily bool Qore\+::\+SQL\+::\+Abstract\+Datasource\+::current\+Thread\+In\+Transaction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Should return \mbox{\hyperlink{basic_data_types_True}{True}} if the current thread is in a transaction with this object, must be re-\/implemented in subclasses to provide the desired functionality. 

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item this is reimplemented as \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a5661e26369193015c195166e52c6d121}{Datasource\+::current\+Thread\+In\+Transaction()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_ac983fd7cd64d2de924113b8cb540ca11}{Datasource\+Pool\+::current\+Thread\+In\+Transaction()}}
\item this method was added as a non-\/abstract method in \mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 to avoid breaking existing subclasses of \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}}
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a71cd33bd6be7230e8481b3b6a0d33892}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a71cd33bd6be7230e8481b3b6a0d33892}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!exec@{exec}}
\index{exec@{exec}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{exec()}{exec()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::exec (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL command on the server and returns either the integer row count (for example, for updates, inserts, and deletes) or the data retrieved (for example, if a stored procedure is executed that returns values) 


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em ...} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The return value depends on the DBI driver; normally, for commands with placeholders, a hash is returned holding the values acquired from executing the SQL statement. For all other commands, normally an integer row count is returned. However, some DBI drivers also allow select statements to be executed through this interface, which would also return a hash (column names) of lists (values for each column).
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int rows = db.exec(\textcolor{stringliteral}{"{}insert into table (varchar\_col, timestamp\_col, blob\_col, numeric\_col) values (\%v, \%v, \%v, \%d)"{}}, string, now(), binary, 100);}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a226b0fa3f5fdc4da16d8dda6703f1fdb}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a63735bf6bce9e84968a57786965163da}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a8ebf9c0e5bb529dab200ab95ab36a5d4}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a8ebf9c0e5bb529dab200ab95ab36a5d4}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!execRaw@{execRaw}}
\index{execRaw@{execRaw}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{execRaw()}{execRaw()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::exec\+Raw (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL command on the server and returns either the row count (for example, for updates and inserts) or the data retrieved (for example, if a stored procedure is executed that returns values) 

This method does not do any variable binding, so it\textquotesingle{}s useful for example for DDL statements etc

\begin{DoxyParagraph}{Warning\+:}
Using this method to execute pure dynamic SQL many times with different SQL strings (as opposed to using the same string and binding by value instead of dynamic SQL) can affect application performance by prohibiting the efficient usage of the DB server\textquotesingle{}s statement cache. See DB server documentation for variable binding and the SQL statement cache for more information.
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server; this string will not be subjected to any transformations for variable binding\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The return value depends on the DBI driver; normally, for commands with placeholders, a hash is returned holding the values acquired from executing the SQL statement. For all other commands, normally an integer row count is returned. However, some DBI drivers also allow select statements to be executed through this interface, which would also return a hash (column names) of lists (values for each column).
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{db.execRaw(\textcolor{stringliteral}{"{}create table my\_tab (id number, some\_text varchar2(30))"{}});}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a4ec5865609884af9b0498a7f45b1042f}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a3e7e022470ddc471f045ab29ee25c4d7}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ad188ffb22d7cb8274fa8fa4255a28b8f}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ad188ffb22d7cb8274fa8fa4255a28b8f}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getClientVersion@{getClientVersion}}
\index{getClientVersion@{getClientVersion}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getClientVersion()}{getClientVersion()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Client\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Retrieves the driver-\/specific client library version information. 

\begin{DoxyReturn}{Returns}
the driver-\/specific client library version information
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{auto ver = db.getClientVersion();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
see the documentation for the DBI driver being used for possible exceptions 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a0074fed1b53e9b94f811f3b8481b1df4}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a4a5bff189485cb1a33e336f7880432dc}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a65faab023768b1ce628ec43f68cdd832}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a65faab023768b1ce628ec43f68cdd832}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getConfigHash@{getConfigHash}}
\index{getConfigHash@{getConfigHash}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getConfigHash()}{getConfigHash()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Config\+Hash (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns a \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} describing the configuration of the current object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto> h = ds.getConfigHash();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a \mbox{\hyperlink{group__dbi__functions_datasource_hash}{datasource hash}} describing the configuration of the current object
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 
\end{DoxySince}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a25f7d1c47f35371fcb2fac28fa8d5827}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_ae3bbee0fcb4cbc422d65814d61339f93}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a79772d8676975c1ab23710bc91d666ae}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a79772d8676975c1ab23710bc91d666ae}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getConfigString@{getConfigString}}
\index{getConfigString@{getConfigString}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getConfigString()}{getConfigString()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Config\+String (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns a string giving the configuration of the current object in a format that can be parsed by \mbox{\hyperlink{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}{parse\+\_\+datasource()}} 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string str = ds.getConfigString();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a string giving the configuration of the current object in a format that can be parsed by \mbox{\hyperlink{group__dbi__functions_ga5bc0c2cfb4f1bfbf73c527f9441a6dbe}{parse\+\_\+datasource()}}
\end{DoxyReturn}
\begin{DoxySince}{Since}
Qore 0.\+8.\+8 
\end{DoxySince}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a7713f26c809821a7942a60e27f924742}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a1eddfff5b95e355b5608554975984307}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ae89ba7cab57748a51358e44ac5e231d5}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ae89ba7cab57748a51358e44ac5e231d5}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getDBEncoding@{getDBEncoding}}
\index{getDBEncoding@{getDBEncoding}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getDBEncoding()}{getDBEncoding()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+DBEncoding (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Retrieves the database-\/specific charset set encoding for the object. 

\begin{DoxyReturn}{Returns}
the database-\/specific charset set encoding for the object
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string enc = db.getDBEncoding();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab5d951f88607a8f3580730c894cd4681}{Abstract\+Datasource\+::get\+OSEncoding()}}; 
\end{DoxySeeAlso}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_af898e46c3bc2498ae858d3f98fb23eb3}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a7f07246a7db1db14313420c18bcbcf8b}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a1e0d642801b1ce96fea0553ae4def964}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a1e0d642801b1ce96fea0553ae4def964}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getDBName@{getDBName}}
\index{getDBName@{getDBName}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getDBName()}{getDBName()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+DBName (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the database name parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. 

\begin{DoxyReturn}{Returns}
the database name parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string db = db.getDBName();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_aa0084434a2631b776ce4cfa7075e5f01}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a5babda43969ce082f11eae6d9a21d581}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a26a5370cb70baed85f0d3a51a8f36cf9}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a26a5370cb70baed85f0d3a51a8f36cf9}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getDriverName@{getDriverName}}
\index{getDriverName@{getDriverName}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getDriverName()}{getDriverName()}}
{\footnotesize\ttfamily abstract \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Driver\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the name of the driver used for the object. 

\begin{DoxyReturn}{Returns}
the name of the driver used for the object
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string driver = db.getDriverName();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_aff2f886f27e033dd2bdcc49c22b2cd65}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a003bb3bb9f55224159f49c574d0d1464}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a4ffcb9760eea609835734b27e7f97eac}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a4ffcb9760eea609835734b27e7f97eac}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getHostName@{getHostName}}
\index{getHostName@{getHostName}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getHostName()}{getHostName()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Host\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the hostname parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. 

\begin{DoxyReturn}{Returns}
the hostname parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string host = db.getHostName();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a103526f8e3e4e0783523f3af89047190}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a293eaadc3ab98b9a57f9c155e5ed2221}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a06f2779d1294b4d3f1880b55e650add0}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a06f2779d1294b4d3f1880b55e650add0}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getOption@{getOption}}
\index{getOption@{getOption}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getOption()}{getOption()}}
{\footnotesize\ttfamily auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Option (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{opt }\end{DoxyParamCaption})}



Returns the current value for the given option. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em opt} & the option to get \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the value of the option
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This base class method always throws an exception
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_aa434cc346c31db17946fd62caf3160c7}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_aa434cc346c31db17946fd62caf3160c7}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getOptionHash@{getOptionHash}}
\index{getOptionHash@{getOptionHash}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getOptionHash()}{getOptionHash()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga24ee71727f0785d3b826833ed6f5e2ee}{hash}}$<$ auto $>$ Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Option\+Hash (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the valid options for the driver associated with the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}} with descriptions and current values for the current \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}} object. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a hash where the keys are valid option names, and the values are hashes with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}desc\char`\"{}}\+: a string description of the option
\item {\ttfamily \char`\"{}type\char`\"{}}\+: a string giving the data type restriction for the option
\item {\ttfamily \char`\"{}value\char`\"{}}\+: the current value of the option
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxyNote}{Note}
this base class method always returns an empty hash
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+9.\+4 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab5d951f88607a8f3580730c894cd4681}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab5d951f88607a8f3580730c894cd4681}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getOSEncoding@{getOSEncoding}}
\index{getOSEncoding@{getOSEncoding}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getOSEncoding()}{getOSEncoding()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+OSEncoding (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the Qore character encoding name for the object as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. 

\begin{DoxyReturn}{Returns}
the Qore character encoding name for the object as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string enc = db.getOSEncoding();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_aae5a12ff32342c13df0cee4503e2f898}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a894276b97b76b3526516613f1182dee5}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac245a7e0615433778ab7a61abf845c54}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac245a7e0615433778ab7a61abf845c54}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getPassword@{getPassword}}
\index{getPassword@{getPassword}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getPassword()}{getPassword()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the password parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. 

\begin{DoxyReturn}{Returns}
the password parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string \textcolor{keywordflow}{pass} = db.getPassword();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_ae8ecfbacb0245d1c2e5118352cfe9edb}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a09f75c1b73aa9971b2ae8cd57e1e38c0}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a54d89afe6d44810ed7e141ba35310748}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a54d89afe6d44810ed7e141ba35310748}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getPort@{getPort}}
\index{getPort@{getPort}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getPort()}{getPort()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Port (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Gets the port number that will be used for the next connection to the server. 

Invalid port numbers will cause an exception to be thrown when the connection is opened

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*int port = db.getPort();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_ad8c4bde5992da775c95bd8b2a3340e19}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a99935d80ec9ca0739ed3031ec614ce52}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_acd2bef573f9d703c9511efd38bc1c2ec}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_acd2bef573f9d703c9511efd38bc1c2ec}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getServerVersion@{getServerVersion}}
\index{getServerVersion@{getServerVersion}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getServerVersion()}{getServerVersion()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+Server\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the driver-\/specific server version data for the current connection. 

\begin{DoxyReturn}{Returns}
the driver-\/specific server version data for the current connection
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{auto ver = db.getServerVersion();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
see the documentation for the DBI driver being used for additional possible exceptions 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a35340d8cbadc2eb5b20ab9d8e0fc87eb}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a953480807dbdafae0808a6c47014c0d6}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_afdf23f69850ebb8e0c337ade7fcb793d}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_afdf23f69850ebb8e0c337ade7fcb793d}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getSQLStatement@{getSQLStatement}}
\index{getSQLStatement@{getSQLStatement}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getSQLStatement()}{getSQLStatement()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement}{Abstract\+SQLStatement}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+SQLStatement (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns an \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement}{Abstract\+SQLStatement}} object based on the current database connection object. 

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item this is reimplemented as \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a39ef1a8bff15788d039672359c28772e}{Datasource\+::get\+SQLStatement()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_af59598025506fa7079b734018a89decf}{Datasource\+Pool\+::get\+SQLStatement()}}
\item this method was added as a non-\/abstract method in \mbox{\hyperlink{namespace_qore}{Qore}} 0.\+9.\+0 to avoid breaking existing subclasses of \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource}{Abstract\+Datasource}}
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+9.\+0 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_aea226bb7ae548363ae25a4f1e306b34a}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_aea226bb7ae548363ae25a4f1e306b34a}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!getUserName@{getUserName}}
\index{getUserName@{getUserName}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{getUserName()}{getUserName()}}
{\footnotesize\ttfamily abstract \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SQL\+::\+Abstract\+Datasource\+::get\+User\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns the username parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set. 

\begin{DoxyReturn}{Returns}
the username parameter as a string or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if none is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*string user = db.getUserName();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a0b9c482becfbe8349a75e5a55370f88c}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_aaf036746fb8d7c107b09d7288924b64b}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac7fe5b3cf6789100950622138915517e}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac7fe5b3cf6789100950622138915517e}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!inTransaction@{inTransaction}}
\index{inTransaction@{inTransaction}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{inTransaction()}{inTransaction()}}
{\footnotesize\ttfamily abstract bool Qore\+::\+SQL\+::\+Abstract\+Datasource\+::in\+Transaction (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Returns \mbox{\hyperlink{basic_data_types_True}{True}} if a transaction is currently in progress. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if a transaction is currently in progress
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{bool b = db.inTransaction();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_af74cb806c9e19c6099c0d2cce84a44ab}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a3b868b40604c049b4bf78b121ede7c16}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_acccf4e46fb29f2d12700cc6feb0c9438}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_acccf4e46fb29f2d12700cc6feb0c9438}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!rollback@{rollback}}
\index{rollback@{rollback}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{rollback()}{rollback()}}
{\footnotesize\ttfamily abstract nothing Qore\+::\+SQL\+::\+Abstract\+Datasource\+::rollback (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Rolls the current transaction back and releases any thread resources associated with the transaction. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{db.rollback();}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_acdc71e3819dbc3bf8be24d60e75e7bb2}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a73532001be895a5a30cc58c5bfbe2c1c}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!select@{select}}
\index{select@{select}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{select()}{select()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::select (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL select statement on the server and (normally) returns the result as a hash (column names) of lists (column values per row) 

The usual return format of this method is suitable for use with \mbox{\hyperlink{statements_context}{context statements}}, for easy iteration and processing of query results. Alternatively, the \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+Iterator}} class can be used to iterate the return value of this method.

Additionally, this format is a more efficient format than that returned by the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}{Abstract\+Datasource\+::select\+Rows()}} method, because the column names are not repeated for each row returned. Therefore, for retrieving anything greater than small amounts of data, it is recommended to use this method instead of \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}{Abstract\+Datasource\+::select\+Rows()}}.

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em ...} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
This method returns a hash (the keys are the column names) of lists (the column data per row) when executed with an SQL select statement, however some DBI drivers allow any SQL to be executed through this method, in which case other data types can be returned (such as an integer for a row count or a hash for output parameters when executing a stored procedure). If no rows are found, a hash of column names assigned to empty lists is returned.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{\# bind a string and a date/time value by value in a query}}
\DoxyCodeLine{hash<auto> query = db.select(\textcolor{stringliteral}{"{}select * from table where varchar\_column = \%v and timestamp\_column > \%v"{}}, string, 2007-\/10-\/11T15:31:26.289);}
\DoxyCodeLine{\textcolor{keywordflow}{if} (query.firstValue())}
\DoxyCodeLine{    printf(\textcolor{stringliteral}{"{}got results\(\backslash\)n"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
This method returns all the data available immediately; to process query data piecewise, use the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{SQLStatement}} class 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a05b1d0d126d815b2d7578e5ce8b9a0de}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_acafe45a0cf883bc51917e7a0bb8e77fd}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a6d4bd90ff3b28a637b19254a7f09dfba}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a6d4bd90ff3b28a637b19254a7f09dfba}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!selectRow@{selectRow}}
\index{selectRow@{selectRow}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{selectRow()}{selectRow()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::select\+Row (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL select statement on the server and returns the first row as a hash (the column values) 

If more than one row is returned, then it is treated as an error and a {\ttfamily DBI-\/\+SELECT-\/\+ROW-\/\+ERROR} is returned (however the DBI driver should raise its own exception here to avoid retrieving more than one row from the server). For a similar method taking a list for all bind arguments, see \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a82bd28bd70590c4519053d058d61e0e6}{Abstract\+Datasource\+::vselect\+Row()}}.

This method also accepts all bind parameters ({\ttfamily \%d}, {\ttfamily \%v}, etc) as documented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_sql_binding}{Binding by Value and Placeholder}}

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em ...} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
This method normally returns a hash (the keys are the column names) of row data or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no row is found for the query when executed with an SQL select statement, however some DBI drivers allow any SQL statement to be executed through this method (not only select statements), in this case other data types can be returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*list<auto> h = db.selectRow(\textcolor{stringliteral}{"{}select * from example\_table where id = 1"{}});}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em DBI-\/\+SELECT-\/\+ROW-\/\+ERROR} & more than 1 row retrieved from the server \\
\hline
\end{DoxyExceptions}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a0e52be43b0b00086d771288a2404a853}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_ac194599669509211cc64e9caf0aa56b3}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!selectRows@{selectRows}}
\index{selectRows@{selectRows}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{selectRows()}{selectRows()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::select\+Rows (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{}]{... }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL select statement on the server and returns the result as a list (rows) of hashes (the column values) 

The return format of this method is not as memory efficient as that returned by the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}} method, therefore for larger amounts of data, it is recommended to use \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}}. The usual return value of this method can be iterated with the \mbox{\hyperlink{class_qore_1_1_list_hash_iterator}{List\+Hash\+Iterator}} class.

This method also accepts all bind parameters ({\ttfamily \%d}, {\ttfamily \%v}, etc) as documented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_sql_binding}{Binding by Value and Placeholder}}

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em ...} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Normally returns a list (rows) of hash (where the keys are the column names of each row) or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no rows are found for the query, however some DBI drivers allow any SQL statement to be executed through this method (not only select statements), in this case other data types can be returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*list<auto> list = db.selectRows(\textcolor{stringliteral}{"{}select * from example\_table"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
This method returns all the data available immediately; to process query data piecewise, use the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{SQLStatement}} class 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a41126ab5a3d9e11ee7dd6d7975dfd65a}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a9298e44c0af5bb93330c929b47cde5c9}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a68f3f2fd0d820097db47aac8cc9912fe}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a68f3f2fd0d820097db47aac8cc9912fe}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!vexec@{vexec}}
\index{vexec@{vexec}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{vexec()}{vexec()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::vexec (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{\+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes an SQL command on the server and returns either the integer row count (for example, for updates, inserts, and deletes) or the data retrieved (for example, if a stored procedure is executed that returns values), taking a list for all bind arguments. 

Same as \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a71cd33bd6be7230e8481b3b6a0d33892}{Abstract\+Datasource\+::exec()}} except takes an explicit list for bind arguments


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em vargs} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The return value depends on the DBI driver; normally, for commands with placeholders, a hash is returned holding the values acquired from executing the SQL statement. For all other commands, normally an integer row count is returned. However, some DBI drivers also allow select statements to be executed through this interface, which would also return a hash (column names) of lists (values for each column).
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int rows = db.vexec(\textcolor{stringliteral}{"{}insert into example\_table value (\%v, \%v, \%v)"{}}, arg\_list);}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_aeba8bbff7570f5696e78ecb33a6a6fe0}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_af3013ed0756f9bfa1e7ddf5232e0bf7e}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac1dd6bceaddef45dc6db0001dc142180}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_ac1dd6bceaddef45dc6db0001dc142180}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!vselect@{vselect}}
\index{vselect@{vselect}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{vselect()}{vselect()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::vselect (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{\+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes a select statement on the server and returns the results in a hash (column names) of lists (column values per row), taking a list for all bind arguments. 

The usual return format of this method is suitable for use with \mbox{\hyperlink{statements_context}{context statements}}, for easy iteration and processing of query results. Alternatively, the \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+Iterator}} class can be used to iterate the return value of this method.

This method also accepts all bind parameters ({\ttfamily \%d}, {\ttfamily \%v}, etc) as documented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_sql_binding}{Binding by Value and Placeholder}}

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em vargs} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Normally returns a hash (the keys are the column names) of list (each hash key\textquotesingle{}s value is a list giving the row data), however some DBI drivers allow any SQL statement to be executed through this method (not only select statements), in this case other data types can be returned. If no rows are found, a hash of column names assigned to empty lists is returned.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto> query = db.vselect(\textcolor{stringliteral}{"{}select * from example\_table where id = \%v and name = \%v"{}}, arg\_list);}
\DoxyCodeLine{\textcolor{keywordflow}{if} (query.firstValue())}
\DoxyCodeLine{    printf(\textcolor{stringliteral}{"{}got results\(\backslash\)n"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
This method returns all the data available immediately; to process query data piecewise, use the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{SQLStatement}} class 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_ad3c563a57ad19083a2bce99b17d1a59c}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a1162ad06aa3f4fc5fb31531ef5ca624b}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_a82bd28bd70590c4519053d058d61e0e6}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_a82bd28bd70590c4519053d058d61e0e6}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!vselectRow@{vselectRow}}
\index{vselectRow@{vselectRow}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{vselectRow()}{vselectRow()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::vselect\+Row (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{\+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes a select statement on the server and returns the first row as a hash (column names and values), taking a list for all bind arguments. 

This method is the same as the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a6d4bd90ff3b28a637b19254a7f09dfba}{Abstract\+Datasource\+::select\+Row()}} method, except this method takes a single argument after the SQL command giving the list of bind value parameters

This method also accepts all bind parameters ({\ttfamily \%d}, {\ttfamily \%v}, etc) as documented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_sql_binding}{Binding by Value and Placeholder}}

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute on the server \\
\hline
{\em vargs} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
This method normally returns a hash (the keys are the column names) of row data or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no row is found for the query when executed with an SQL select statement, however some DBI drivers allow any SQL statement to be executed through this method (not only select statements), in this case other data types can be returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<auto> h = db.vselectRow(\textcolor{stringliteral}{"{}select * from example\_table where id = \%v and type = \%v"{}}, arg\_list);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a6d4bd90ff3b28a637b19254a7f09dfba}{Abstract\+Datasource\+::select\+Row()}} 
\end{DoxySeeAlso}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_ab6ea0b7e3f9abdaa6516d7131eea4455}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_a9cfedca21f0be7698893b5e5cc5d394a}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

\mbox{\Hypertarget{class_qore_1_1_s_q_l_1_1_abstract_datasource_afe2104486bab27d21e47760edae79cf3}\label{class_qore_1_1_s_q_l_1_1_abstract_datasource_afe2104486bab27d21e47760edae79cf3}} 
\index{Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}!vselectRows@{vselectRows}}
\index{vselectRows@{vselectRows}!Qore::SQL::AbstractDatasource@{Qore::SQL::AbstractDatasource}}
\doxysubsubsection{\texorpdfstring{vselectRows()}{vselectRows()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+SQL\+::\+Abstract\+Datasource\+::vselect\+Rows (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{sql,  }\item[{\+\_\+\+\_\+7\+\_\+ softlist$<$ auto $>$}]{vargs }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Executes a select statement on the server and returns the results in a list (rows) of hashes (column names and values), taking a list for all bind arguments. 

Same as the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}{Abstract\+Datasource\+::select\+Rows()}} method, except this method takes a single argument after the SQL command giving the list of bind value parameters.

The usual return value of this method can be iterated with the \mbox{\hyperlink{class_qore_1_1_list_hash_iterator}{List\+Hash\+Iterator}} class.

The return format of this method is not as memory efficient as that returned by the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}} method, therefore for larger amounts of data, it is recommended to use \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_a594c9f65813ada4668a67aca0a5c0331}{Abstract\+Datasource\+::select()}}.

This method also accepts all bind parameters ({\ttfamily \%d}, {\ttfamily \%v}, etc) as documented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_sql_binding}{Binding by Value and Placeholder}}

To execute select statements that begin a transaction (such as {\ttfamily \char`\"{}select for update\char`\"{}}), execute \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_ab879515333fbb878b567d3f9a80e4ba8}{Abstract\+Datasource\+::begin\+Transaction()}} first to signal that a transaction is starting; this is particularly important when the object is shared among more than one thread.


\begin{DoxyParams}{Parameters}
{\em sql} & The SQL command to execute \\
\hline
{\em vargs} & Include any values to be bound (using {\ttfamily v} in the command string) or placeholder specifications (using {\ttfamily \+:}{\itshape key\+\_\+name} in the command string) in order after the command string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Normally returns a list (rows) of hash (where the keys are the column names of each row) or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if no rows are found for the query, however some DBI drivers allow any SQL statement to be executed through this method (not only select statements), in this case other data types can be returned
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*list<auto> list = db.vselectRows(\textcolor{stringliteral}{"{}select * from example\_table where id = \%v and type = \%v"{}}, arg\_list);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_datasource_af4a40e6be75f11ea926378b6815a9654}{Abstract\+Datasource\+::select\+Rows()}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
This method returns all the data available immediately; to process query data piecewise, use the \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement}{SQLStatement}} class 
\end{DoxyNote}


Implemented in \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a9145f5c598980a4685943e194a899ed4}{Qore\+::\+SQL\+::\+Datasource}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_ae214619fc06c77270ed38e7c013538e9}{Qore\+::\+SQL\+::\+Datasource\+Pool}}.

