| ODBC |
|
| Primarily, ODBC is used to provide read access to data files from other products such as Crystal reports, Excel, or Word. Most programming languages have an ODBC access facility to allow files to be read or updated as well. The process of bringing PxPlus data to your application begins with making a data connection — the steps involved will vary according to your application and your server technology. For specifics on PxPlus ODBC DSNs and connection information, refer to the Local & Client Configuration. Once a data connection is established, the PxPlus data itself can be accessed from the database using SQL commands. As mentioned earlier, SQL (Structured Query Language) is the standard interactive and programming language for accessing and manipulating databases. This sections describes the specific elements of SQL that can be used with PxPlus ODBC. |
||
| Statements | An SQL statement is used to perform various operations on the database. The PxPlus ODBC driver supports four types of SQL statements: SELECT, which retrieves data from the database; INSERT, which adds new data to the database; DELETE, which removes data from the database; and UPDATE, which changes data in the database. | |
| Joining | SQL statements operate with logical sets of data —they declare what data is required, not how the data is to be retrieved. When data is required from two tables, the statement must establish a relationship between Table 1 and Table 2. In SQL, this concept is called joining. The join operation selects rows from two different tables such that the value in one column of Table 1 also appears in a column of Table 2. For example, a customer table includes a code for sales representatives called SALESREP and the sales representative table includes a SALESREP code among other information about sales representatives (names, addresses etc). A join relationship between the customer table and sales representative table can be established because they each have a SALESREP column. The PxPlus ODBC driver supports three types of joins: |
|
| Returns all the records in Table 2 for each common record in Table 1. To create a cross join, a comma is used to separate the declared tables. As of Version 3.32, the keywords CROSS JOIN can be used in place of the comma; e.g., SELECT * FROM Customer, SalesReps Discards unmatched rows in either table. As of Version 3.32, the keyword INNER is optional; e.g., SELECT * FROM { oj Customer INNER JOIN SalesReps |
||
| ON Customer.SALESREP = SalesReps.SALESREP } LEFT [OUTER] JOIN Will, for each record in Table 1, join the matching record in | ||
| Table 2, if any. As of Version 3.32, the keyword OUTER is optional; e.g., SELECT * FROM {oj Customer LEFT OUTER JOIN SalesReps ON Customer.SALESREP = SalesReps.SALESREP } |
||