Creating a super Q-pointer

The data to be accessed is defined through a Super Q-pointer.

To create a Super Q-pointer use the Update Processor.

Syntax

          qptr.name
<001>     q
<002>
<003>     {dm,hosts,}host.name:driver:qptr.name\maxcolsize
<004,1>   {schema.}table.name
<004,2>  {where.clause}
<004,3>   {candidate.key}
<004,4>   columnname
<004,5>   columnname
Note:
  • The syntax for the Super Q-pointer has changed from that used in the D3 OSFI Remote Server (for example, attribute 4 no longer contains subvalue marks). The subvalue marks used in D3 OSFI Remote Server have been replaced by value marks. The subvalue marks are no longer compatible in D3.

  • When creating a q-pointer, all fields in the q-pointer must be updatable if any of the fields are to be written. Otherwise a second q-pointer must be created with only the updatable columns defined.

Paramter(s)

Value Description
qptr.name User-defined. This is the name used at TCL or in FlashBASIC to access data. This name is repeated in attribute 3 of this item.
host.name An OSFI host data source, as described in the previous topic, identifies an entry in the dm,hosts, file which is a link to OpenDB.

The colon (:) separator is entered after the host name.

driver Directs OpenDB to send all requests to the ODBC data source specified in the host name field. Type ODBC: as the name of the driver.

The colon (:) separator is entered after the driver is entered.

Q-Pointer Options Q-Pointer options are set on attribute 3 as subvalues.
  • The maxcolsize option sets the maximum column size in bytes or KB.

  • The emptystring option to handle pick null strings as empty strings.

  • The nullstring option to handle pick null strings as SQL NULL (default behavior).

tables Identifies the schema and table names (or tables in the case of a join) to be accessed. If multiple tables are involved, this is a comma-delimited list. For Oracle, tables are case-sensitive.
where.clause (Optional) Any desired where clause can be placed in this MultiValue using the and or or connector. For example:
City = 'Irvine' and Zip = '92614'
Note: The keyword where should not appear in the clause.
When creating Super Q-pointers to access data from Microsoft Access or Microsoft SQL Server, use double-quotations around the column names (only in the where clause). For example:
City = "Irvine" and Zip = "92614"

If multiple tables are involved, the where clause must contain the joining statement required to join the tables. For example:

customers.custid = orders.custid
For Microsoft Access or Microsoft SQL Server, use double quotations around both the column names and table names. For example:
"customers"."custid" = "orders"."custid"
candidate.key (Optional) Identifies the column(s) of the table that uniquely identifies each row. Without this part, the Super Q-pointer is read-only. Typically, the candidate key contains the primary key column(s) but an alternate key can be used.

The column(s) entered are implicitly mapped to attribute 0 of the D3 item.

  • For tables that do not contain a primary or alternate key, skip this value.

  • In the case of a join involving multiple tables, the Super Q-pointer is read-only so no candidate key is required.

  • For tables with a multiple-column key, the format of this subvalue is:

keycol1|delim|keycol2|delimkey  col3
Where delim is a single character, such as the asterisk (*) or the number sign (#), and the pipe (|) as the separator. For example, a table with a candidate key that consists of three columns: col1, col2, and col3. The candidate key might contain:
<004,3>col1|*|col2|#|col3
If more than two columns are involved in the key, as in the previous example, the delimiters can be either the same between the columns or different (*, #).
column Identifies the column from the table or tables specified above. The column definition format is:
{tablename}columnname
  • tablename is the Microsoft SQL Server’s table name. It is needed when using multiple tables that have the same column names.

  • columnname is the Microsoft SQL Server’s column name. It must not contain a comma (,) character.

  • There are no spaces allowed in a tablename or columnname. For example, the field Customer ID should be entered as customerid. If a space is inserted, an error message displays stating that the tablename or columnname cannot be found. The longest column permitted is that of the data type longvarchar (see Supported data types for more information on this data type), which is limited (truncated) to 65535 characters. When a row is read from an ODBC database, only 65535 characters are displayed in the column.

Procedure

  1. Type u md qptr.name at the TCL prompt.
  2. Type q in attribute 1.
  3. Press ENTER to leave attribute 2 blank.
  4. Type {dm,hosts,}host.name:odbc:qptr.name\maxcolsize 64k in attribute 3.
    Note: To move from attribute <004,1> to <004,2>, a value mark must be entered by pressing CTRL+V.
  5. Type the optional schema.name and table.name in attribute 4, and then press CTRL+V.
  6. (Optional) Type where.clause, and then press CTRL+V.
  7. (Optional) Type candidate.key, and then press CTRL+V.
  8. Type columnname, and then press CTRL+V to enter another column name.