14.01.2015 Views

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• field_name - is the name of the index used<br />

to index the chemical information<br />

• smiles_or_encoded_cdx - is the<br />

substructure depicted by a smiles string or an<br />

encoded CDX document.<br />

• second_part - is the second 4000 bytes of<br />

an encoded CDX document.<br />

All of the names must be enclosed by single quotes.<br />

The strings are not processed by Oracle, but rather<br />

the MolScreen procedure.<br />

For example:<br />

CALL<br />

CsCartridge.MolScreen('MySchema'<br />

, 'molecule', 'mol', 'mx',<br />

'Oc1ccccc1', '');<br />

This will improve the speed of the substructuresearch<br />

of phenol derivatives.<br />

Navigation in client<br />

programs<br />

The client program usually provides navigation<br />

buttons or commands to browse through the<br />

recordset, when the result of a query is displayed, or<br />

when a full table is presented to the user.<br />

<strong>Com</strong>mands usually allow moving to the next or<br />

previous, first or last record, and some kind of<br />

direct positioning is provided as well.<br />

When the result of a query is presented, the client<br />

program usually maintains a hit list, and allows<br />

navigation by this list in any direction.<br />

After executing a DML statement it is not<br />

immediately clear if a next or previous record exists,<br />

and if those commands or buttons should be<br />

enabled. The cartridge maintains information to<br />

help the client program in solving this problem.<br />

The client program has to retrieve this information<br />

as it is demonstrated with the following BASIC<br />

program.<br />

Dim c as ADODB.Connection 'must be<br />

an open connection<br />

Dim userName as String 'must<br />

contain the connected user's name<br />

Dim tableName as String 'must<br />

contain the table name processed<br />

Private Function GetIndexName()<br />

As String<br />

Dim s As String<br />

Dim r As ADODB.Recordset<br />

s = "SELECT INDEX_NAME FROM<br />

ALL_INDEXES WHERE TABLE_OWNER =<br />

'" + UCase(UserName) + "' AND<br />

TABLE_NAME = '" +<br />

UCase(tablename) + "' AND<br />

ITYP_OWNER = 'CSCARTRIDGE' AND<br />

ITYP_NAME = 'MOLECULEINDEXTYPE'"<br />

Set r = c.Execute(s)<br />

GetIndexName =<br />

r.Fields("INDEX_NAME").Value<br />

End Function<br />

Private Sub CheckEOFBOF()<br />

Dim s As String<br />

Dim indexName As String<br />

indexName = GetIndexName<br />

s = "CALL<br />

CsCartridge.UpdateEOFBOF('" +<br />

UserName + "', '" + tablename +<br />

"', '" + indexName + "')"<br />

c.Execute (s)<br />

Dim r As ADODB.Recordset<br />

<strong>ChemOffice</strong> Enterprise Workgroup & Databases 2005 CS Oracle Cartridge • 203<br />

Navigation in client programs

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!