X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/998abc150616484b2bce17454cda2e1ff1f29b7b..ca3af3370188fe169f6d3fd6f741775868634260:/docs/latex/wx/db.tex

diff --git a/docs/latex/wx/db.tex b/docs/latex/wx/db.tex
index 7b9da764bb..1056eeabbb 100644
--- a/docs/latex/wx/db.tex
+++ b/docs/latex/wx/db.tex
@@ -373,10 +373,10 @@ datasources.  Repeatedly call this function to obtain all the datasources
 available through the ODBC driver manager on the current workstation.
 
 \begin{verbatim}
-    wxStringList strList;
+    wxArrayString strArray;
 
     while (wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, SQL_MAX_DSN_LENGTH+1, DsDesc, 255))
-        strList.Add(Dsn);
+        strArray.Add(Dsn);
 \end{verbatim}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
@@ -711,12 +711,20 @@ If the view does not exist, this function will return true.  Note that views are
 
 \func{bool}{ExecSql}{\param{const wxString \&}{pSqlStmt}}
 
+\func{bool}{ExecSql}{\param{const wxString \&}{pSqlStmt}, \param{wxDbColInf **}{columns}, \param{short \&}{numcols}}
+
 Allows a native SQL command to be executed directly against the datasource.  In addition to being able to run any standard SQL command, use of this function allows a user to (potentially) utilize features specific to the datasource they are connected to that may not be available through ODBC.  The ODBC driver will pass the specified command directly to the datasource.
 
+To get column amount and column names or other information about returned columns, pass {\it 'columns'} and {\it 'numcols'} parameters to the function also.
+
 \wxheading{Parameters}
 
 \docparam{pSqlStmt}{Pointer to the SQL statement to be executed.}
 
+\docparam{columns}{On success, this function will set this pointer to point to array of \helpref{wxDbColInf}{wxdbcolinf} objects, holding information about columns returned by the query. You need to call delete[] for the pointer you pass here after you don't use it anymore to prevent memory leak.}
+
+\docparam{numcols}{Reference to variable where amount of objects in {\it 'columns'}-parameter will be set.}
+
 \wxheading{Remarks}
 
 This member extends the wxDb class and allows you to build and execute ANY VALID
@@ -1605,6 +1613,12 @@ public.
 \helpref{database classes overview}{odbcoverview},
 \helpref{wxDbTable::GetColDefs}{wxdbtablegetcoldefs}, \helpref{wxDb constructor}{wxdbctor}
 
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 \membersection{wxDbColDef::Initialize}\label{wxdbcoldefinitialize}
 
 Simply initializes all member variables to a cleared state.  Called by
@@ -1616,12 +1630,12 @@ Beginning support for handling international formatting specifically on dates
 and floats.
 
 \begin{verbatim}
-    wxString       s_Field;       // Formated String for Output
-    wxString       s_Format[7];   // Formated Objects - TIMESTAMP has
+    wxString       s_Field;       // Formatted String for Output
+    wxString       s_Format[7];   // Formatted Objects - TIMESTAMP has
                                      the biggest (7)
-    wxString       s_Amount[7];   // Formated Objects - amount of
+    wxString       s_Amount[7];   // Formatted Objects - amount of
                                      things that can be formatted
-    int            i_Amount[7];   // Formated Objects -
+    int            i_Amount[7];   // Formatted Objects -
                                         TT MM YYYY HH MM SS m
     int            i_Nation;      // 0 = timestamp
                                      1 = EU
@@ -1643,6 +1657,12 @@ Only one function is provided with this class currently.
 See the \helpref{database classes overview}{odbcoverview} for
 an introduction to using the ODBC classes.
 
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 \membersection{wxDbColFor::Format}\label{wxdbcolforformat}
 
 \func{int }{Format}{\param{int }{Nation}, \param{int }{dbDataType},
@@ -1699,6 +1719,12 @@ it is non-NULL.
 See the \helpref{database classes overview}{odbcoverview} for
 an introduction to using the ODBC classes.
 
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 \membersection{wxDbColInf::Initialize}\label{wxdbcolinfinitialize}
 
 Simply initializes all member variables to a cleared state.  Called by
@@ -1978,6 +2004,11 @@ There are no constructors/destructors as of this time, and no member functions.
 See the \helpref{database classes overview}{odbcoverview} for
 an introduction to using the ODBC classes.
 
+
+\wxheading{Include files}
+
+<wx/db.h>
+
 \section{\class{wxDbInf}}\label{wxdbinf}
 
 Contains information regarding the database connection (datasource name,
@@ -2005,6 +2036,12 @@ it is non-NULL.
 See the \helpref{database classes overview}{odbcoverview} for
 an introduction to using the ODBC classes.
 
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 \membersection{wxDbInf::Initialize}\label{wxdbinfinitialize}
 
 Simply initializes all member variables to a cleared state.  Called by
@@ -2168,7 +2205,7 @@ this function.
 Constructs the full SQL statement that can be used to update all rows matching
 the criteria in the pWhereClause.
 
-If typeOfUpd is DB\_UPD\_KEYFIELDS, then the current values in the bound columns
+If typeOfUpdate is DB\_UPD\_KEYFIELDS, then the current values in the bound columns
 are used to determine which row(s) in the table are to be updated. The
 exception to this is when a datasource supports ROW IDs (Oracle).  The ROW ID
 column is used for efficiency purposes when available.
@@ -2184,9 +2221,9 @@ by this function.
 \docparam{pSqlStmt}{Pointer to storage for the SQL statement retrieved.  To be
 sure you have adequate space allocated for the SQL statement, allocate
 DB\_MAX\_STATEMENT\_LEN bytes.}
-\docparam{typeOfUpd}{The type of update statement being performed.  Can be one
+\docparam{typeOfUpdate}{The type of update statement being performed.  Can be one
 of two values: DB\_UPD\_KEYFIELDS or DB\_UPD\_WHERE.}
-\docparam{pWhereClause}{{\it OPTIONAL}.  If the typeOfUpd is DB\_UPD\_WHERE,
+\docparam{pWhereClause}{{\it OPTIONAL}.  If the typeOfUpdate is DB\_UPD\_WHERE,
 then you must also pass in a SQL WHERE clause in this argument. Default is "".}
 
 \wxheading{Remarks}
@@ -2199,9 +2236,10 @@ WHERE and FROM clauses specified using \helpref{wxDbTable::SetWhereClause}{wxdbt
 and \helpref{wxDbTable::SetFromClause}{wxdbtablesetfromclause} are ignored by
 this function.
 
-\membersection{wxDbTable::BuildWhereStmt}\label{wxdbtablebuildwherestmt}
 
-\func{void}{BuildSelectStmt}{\param{wxString \&}{pWhereClause},
+\membersection{wxDbTable::BuildWhereClause}\label{wxdbtablebuildwhereclause}
+ 
+\func{void}{BuildWhereClause}{\param{wxString \&}{pWhereClause},
 \param{int }{typeOfWhere}, \param{const wxString \&}{qualTableName=""},
 \param{bool }{useLikeComparison=false}}
 
@@ -2234,6 +2272,7 @@ If using 'typeOfWhere' set to DB\_WHERE\_MATCHING, any bound columns currently
 containing a NULL value are not included in the WHERE clause's list of
 columns to use in the comparison.
 
+
 \membersection{wxDbTable::CanSelectForUpdate}\label{wxdbtablecanselectforupdate}
 
 \func{bool}{CanSelectForUpdate}{\void}
@@ -2414,8 +2453,8 @@ this function.
 
 \membersection{wxDbTable::CreateIndex}\label{wxdbtablecreateindex}
 
-\func{bool}{CreateIndex}{\param{const wxString \&}{idxName}, \param{bool }{unique},
-\param{UWORD }{noIdxCols}, \param{wxDbIdxDef *}{pIdxDefs},
+\func{bool}{CreateIndex}{\param{const wxString \&}{IndexName}, \param{bool }{unique},
+\param{UWORD }{numIndexColumns}, \param{wxDbIdxDef *}{pIndexDefs},
 \param{bool }{attemptDrop=true}}
 
 This member function allows you to create secondary (non primary) indexes on
@@ -2430,11 +2469,11 @@ take advantage of those indexes.
 
 \wxheading{Parameters}
 
-\docparam{idxName}{Name of the Index.  Name must be unique within the table
+\docparam{IndexName}{Name of the Index.  Name must be unique within the table
 space of the datasource.}
 \docparam{unique}{Indicates if this index is unique.}
-\docparam{noIdxCols}{Number of columns in the index.}
-\docparam{pIdxDefs}{A pointer to an array wxDbIdxDef structures. }
+\docparam{numIndexColumns}{Number of columns in the index.}
+\docparam{pIndexDefs}{A pointer to an array \helpref{wxDbIdxDef}{wxdbidxdef} structures. }
 \docparam{attemptDrop}{{\it OPTIONAL}.  Indicates if the function should try
 to execute a \helpref{wxDbTable::DropIndex}{wxdbtabledropindex} on the index
 name provided before trying to create the index name.  Default is true.}
@@ -2444,7 +2483,7 @@ name provided before trying to create the index name.  Default is true.}
 The first parameter, index name, must be unique and should be given a
 meaningful name.  Common practice is to include the table name as a prefix
 in the index name (e.g. For table PARTS, you might want to call your index
-PARTS\_IDX1).  This will allow you to easily view all
+PARTS\_Index1).  This will allow you to easily view all
 of the indexes defined for a given table grouped together alphabetically.
 
 The second parameter indicates if the index is unique or not.  Uniqueness
@@ -2453,12 +2492,12 @@ indexes from being inserted into the table when violating a unique index's
 uniqueness.
 
 In the third parameter, specify how many columns are in your index.  This
-number must match the number of columns defined in the 'pIdxDefs' parameter.
+number must match the number of columns defined in the 'pIndexDefs' parameter.
 
 The fourth parameter specifies which columns make up the index using the
-wxDbIdxDef structure.  For each column in the index, you must specify two
+\helpref{wxDbIdxDef}{wxdbidxdef} structure.  For each column in the index, you must specify two
 things, the column name and the sort order (ascending / descending).  See
-the example below to see how to build and pass in the wxDbIdxDef structure.
+the example below to see how to build and pass in the \helpref{wxDbIdxDef}{wxdbidxdef} structure.
 
 The fifth parameter is provided to handle the differences in datasources as
 to whether they will automatically overwrite existing indexes with the same
@@ -2483,18 +2522,18 @@ after executing this function.
 
 \begin{verbatim}
     // Create a secondary index on the PARTS table
-    wxDbIdxDef  idxDef[2];  // 2 columns make up the index
+    wxDbIdxDef  IndexDef[2];  // 2 columns make up the index
 
-    wxStrcpy(idxDef[0].ColName, "PART_DESC");  // Column 1
-    idxDef[0].Ascending = true;
+    wxStrcpy(IndexDef[0].ColName, "PART_DESC");  // Column 1
+    IndexDef[0].Ascending = true;
 
-    wxStrcpy(idxDef[1].ColName, "SERIAL_NO");  // Column 2
-    idxDef[1].Ascending = false;
+    wxStrcpy(IndexDef[1].ColName, "SERIAL_NO");  // Column 2
+    IndexDef[1].Ascending = false;
 
     // Create a name for the index based on the table's name
     wxString indexName;
-    indexName.Printf("%s_IDX1",parts->GetTableName());
-    parts->CreateIndex(indexName, true, 2, idxDef);
+    indexName.Printf("%s_Index1",parts->GetTableName());
+    parts->CreateIndex(indexName, true, 2, IndexDef);
 \end{verbatim}
 
 \membersection{wxDbTable::CreateTable}\label{wxdbtablecreatetable}
@@ -2692,18 +2731,18 @@ this function.
 
 \membersection{wxDbTable::DropIndex}\label{wxdbtabledropindex}
 
-\func{bool}{DropIndex}{\param{const wxString \&}{idxName}}
+\func{bool}{DropIndex}{\param{const wxString \&}{IndexName}}
 
 Allows an index on the associated table to be dropped (deleted) if the user
 login has sufficient privileges to do so.
 
 \wxheading{Parameters}
 
-\docparam{idxName}{Name of the index to be dropped.}
+\docparam{IndexName}{Name of the index to be dropped.}
 
 \wxheading{Remarks}
 
-If the index specified in the 'idxName' parameter does not exist, an error
+If the index specified in the 'IndexName' parameter does not exist, an error
 will be logged, and the function will return a result of false.
 
 It is not necessary to call \helpref{wxDb::CommitTrans}{wxdbcommittrans}
@@ -2743,7 +2782,7 @@ of this function).
 
 \wxheading{Parameters}
 
-\docparam{From}{A comma separated list of table names that are to be outer
+\docparam{From}{A comma separated list of table names that are to be inner
 joined with the base table's columns so that the joined table's columns
 may be returned in the result set or used as a portion of a comparison with
 the base table's columns.  NOTE that the base tables name must NOT be included
@@ -3218,7 +3257,7 @@ records to be retrieved (e.g. All users with a first name of "JOHN").
 Use \helpref{wxDbTable::SetOrderByClause}{wxdbtablesetorderbyclause} to
 change the sequence in which records are returned in the result set from
 the datasource (e.g. Ordered by LAST\_NAME).  Use
-\helpref{wxDbTable::SetFromClause}{wxdbtablesetfromclause} to allow outer
+\helpref{wxDbTable::SetFromClause}{wxdbtablesetfromclause} to allow inner
 joining of the base table (the one being associated with this instance of
 wxDbTable) with other tables which share a related field.
 
@@ -3513,10 +3552,10 @@ table's columns are refreshed to reflect the current data in the database.
 
 \membersection{wxDbTable::SetColDefs}\label{wxdbtablesetcoldefs}
 
-\func{void}{SetColDefs}{\param{UWORD }{index}, \param{const wxString \&}{fieldName},
+\func{bool}{SetColDefs}{\param{UWORD }{index}, \param{const wxString \&}{fieldName},
 \param{int }{dataType}, \param{void *}{pData}, \param{SWORD }{cType},
-\param{int }{size}, \param{bool }{keyField = false}, \param{bool }{upd = true},
-\param{bool }{insAllow = true}, \param{bool }{derivedCol = false}}
+\param{int }{size}, \param{bool }{keyField = false}, \param{bool }{updateable = true},
+\param{bool }{insertAllowed = true}, \param{bool }{derivedColumn = false}}
 
 \func{wxDbColDataPtr *}{SetColDefs}{\param{wxDbColInf *}{colInfs}, \param{UWORD }{numCols}}
 
@@ -3533,6 +3572,8 @@ wxDbTable constructor was called.}
     DB_DATA_TYPE_INTEGER        : non-floating point numbers
     DB_DATA_TYPE_FLOAT          : floating point numbers
     DB_DATA_TYPE_DATE           : dates
+    DB_DATA_TYPE_BLOB           : binary large objects
+    DB_DATA_TYPE_MEMO           : large strings
 \end{verbatim}
 
 \docparam{pData}{Pointer to the data object that will hold the column's
@@ -3560,11 +3601,11 @@ Other valid types are available also, but these are the most common ones:}
 \docparam{size}{Maximum size in bytes of the {\it pData} object.}
 \docparam{keyField}{{\it OPTIONAL}.  Indicates if this column is part of the
 primary index.  Default is false.}
-\docparam{upd}{{\it OPTIONAL}.  Are updates allowed on this column?
+\docparam{updateable}{{\it OPTIONAL}.  Are updates allowed on this column?
 Default is true.}
-\docparam{insAllow}{{\it OPTIONAL}.  Inserts allowed on this column?
+\docparam{insertAllowed}{{\it OPTIONAL}.  Inserts allowed on this column?
 Default is true.}
-\docparam{derivedCol}{{\it OPTIONAL}.  Is this a derived column (non-base
+\docparam{derivedColumn}{{\it OPTIONAL}.  Is this a derived column (non-base
 table column for query only)?  Default is false.}
 
 \docparam{colInfs}{Pointer to an array of wxDbColInf instances which contains
@@ -3577,6 +3618,14 @@ to by {\it colInfs}, which are to have column definitions created from them.}
 If {\it pData} is to hold a string of characters, be sure to include enough
 space for the NULL terminator in pData and in the byte count of {\it size}.
 
+Using the first form of this function, if the column definition is not able 
+to be created, a value of false is returned.  If the specified index of the 
+column exceeds the number of columns defined in the wxDbTable instance, an
+assert is thrown and logged (in debug builds) and a false is returned.
+
+A failure to create the column definition in the second form results in a 
+value of NULL being returned.
+
 Both forms of this function provide a shortcut for defining the columns in
 your wxDbTable object.  Use this function in any derived wxDbTable
 constructor when describing the column/columns in the wxDbTable object.
@@ -3610,7 +3659,7 @@ were to be copied over to another datasource or table.
 
 \membersection{wxDbTable::SetCursor}\label{wxdbtablesetcursor}
 
-\func{bool}{SetCursor}{\param{HSTMT *}{hstmtActivate = (void **) wxDB\_DEFAULT\_CURSOR}}
+\func{void}{SetCursor}{\param{HSTMT *}{hstmtActivate = (void **) wxDB\_DEFAULT\_CURSOR}}
 
 \wxheading{Parameters}
 
@@ -3642,14 +3691,14 @@ and saving a pointer to that cursor.
 \func{void}{SetFromClause}{\param{const wxString \&}{From}}
 
 Accessor function for setting the private class member wxDbTable::from
-that indicates what other tables should be outer joined with the wxDbTable's
+that indicates what other tables should be inner joined with the wxDbTable's
 base table for access to the columns in those other tables.
 
 Synonym to this function is one form of \helpref{wxDbTable::From}{wxdbtablefrom}
 
 \wxheading{Parameters}
 
-\docparam{From}{A comma separated list of table names that are to be outer
+\docparam{From}{A comma separated list of table names that are to be inner
 joined with the base table's columns so that the joined table's columns
 may be returned in the result set or used as a portion of a comparison with
 the base table's columns.  NOTE that the base tables name must NOT be included
@@ -3659,7 +3708,7 @@ in constructing query statements.}
 \wxheading{Remarks}
 
 Used by the \helpref{wxDbTable::Query}{wxdbtablequery} and
-\helpref{wxDbTable::Count}{wxdbtablecount} member functions to allow outer
+\helpref{wxDbTable::Count}{wxdbtablecount} member functions to allow inner
 joining of records from multiple tables.
 
 Do {\bf not} include the keyword "FROM" when setting the FROM clause.
@@ -3674,7 +3723,7 @@ the datasource knows on which column values the tables should be joined on.
 \begin{verbatim}
     ...
     // Base table is the "LOCATION" table, and it is being
-    // outer joined to the "PART" table via the the field "PART_NUMBER"
+    // inner joined to the "PART" table via the field "PART_NUMBER"
     // that can be related between the two tables.
     location->SetWhereClause("LOCATION.PART_NUMBER = PART.PART_NUMBER")
     location->SetFromClause("PART");
@@ -3808,7 +3857,7 @@ Do {\bf not} include the keywords "WHERE" when setting the WHERE clause.
     // Using parameters and multiple logical combinations
     parts->Where("((QTY > 10) OR (ON_ORDER > 0)) AND ON_HOLD = 0");
     ...
-    // This query uses an outer join (requiring a FROM clause also)
+    // This query uses an inner join (requiring a FROM clause also)
     // that joins the PART and LOCATION table on he common field
     // PART_NUMBER.
     parts->Where("PART.ON_HOLD = 0 AND \
@@ -3958,6 +4007,12 @@ Eventually, accessor functions will be added for this class
 See the \helpref{database classes overview}{odbcoverview} for
 an introduction to using the ODBC classes.
 
+\wxheading{Include files}
+
+<wx/db.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
 \membersection{wxDbTableInf::Initialize}\label{wxdbtableinfinitialize}
 
 Simply initializes all member variables to a cleared state.  Called by
