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.

Administrator<br />

literals<br />

n = Len(s) ' number of characters in the<br />

query structure<br />

pos = 1 ' starting position<br />

i = 0 ' starting index<br />

segmentLength = 4000 ' the length of a<br />

segment of the query string<br />

While pos < n ' there is remaining part<br />

of a query string to be passed<br />

si = Mid(s, pos, segmentLength) '<br />

get one 4000 character chunk of the<br />

query<br />

Dim v As Variant<br />

v = si '<br />

create parameter expects the value as<br />

variant<br />

parname = ":xpar" + CStr(i) '<br />

parameter name as a stem and running<br />

index<br />

Dim par As ADODB.Parameter '<br />

create the parameter<br />

Set par = com.CreateParameter(parname,<br />

adLongVarChar, adParamInput, Len(si),<br />

v)<br />

com.Parameters.Append par '<br />

append it to the parameters<br />

accompanying the command<br />

sql = sql + parname '<br />

the sql command will have a new<br />

parameter<br />

pos = pos + segmentLength ' move the<br />

position<br />

If pos < n Then '<br />

if there is data still to be processed<br />

sql = sql + "," '<br />

add a comma to separate the parameters<br />

End If<br />

i = i + 1<br />

Wend<br />

sql = sql + "),'FULL=NO')=1" ' finish<br />

up the sql text<br />

com.<strong>Com</strong>mandType = adCmdText<br />

com.ActiveConnection = c<br />

com.<strong>Com</strong>mandText = sql '<br />

set the <strong>Com</strong>mandText field of the<br />

command object<br />

Set r = com.Execute '<br />

and now the command is ready to be<br />

executed<br />

Custom Screening<br />

Custom screening is a tool for a database<br />

administrator to affect the processing of a SELECT<br />

statement. The database administrator can define<br />

any structure to screen the database when<br />

processing a substructure search. If a screen<br />

structure is a substructure of a query structure, then<br />

the processing of that particular query will be faster.<br />

There is no recommendation on how to choose<br />

custom screens. Choosing them should be based on<br />

the particulars of the database and expected interest<br />

of the users.<br />

Custom screen can be defined by calling the<br />

MolScreen procedure.<br />

CALL<br />

CsCartridge.MolScreen('schema_na<br />

me', 'table_name', 'field_name',<br />

'index_name',<br />

'smiles_or_encoded_cdx',<br />

'second_part');<br />

where<br />

• schema_name - is the schema the table is<br />

owned by<br />

• table_name - is the name of the table to be<br />

custom indexed<br />

• field_name - is the name of the field<br />

containing chemical information<br />

202•CS Oracle Cartridge<br />

<strong>CambridgeSoft</strong><br />

Custom Screening

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

Saved successfully!

Ooh no, something went wrong!