17.11.2014 Views

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To create a primary key index:<br />

• The process is the same as for a structure<br />

index, except that you carry it out on a field of<br />

type Long. This creates an index on the field<br />

and also designates it as the primary key. It will<br />

fail unless the column already contains unique,<br />

non-null values.<br />

NOTE: A new button, Set As Structure, may<br />

appear if you have selected a certain type of column. This<br />

is an advanced feature described in “Configuration Via<br />

CF_SETTINGS Table” on page 704.<br />

TIP: If you want to create a primary key, but don't<br />

have a column of unique integer values, you can create<br />

one using a CAL script. For example (assuming you've<br />

already created a column and form box called “ID”):<br />

CAL<br />

loop<br />

putdata ID $index<br />

record commit<br />

record next<br />

endloop<br />

Some new features have been introduced into<br />

ChemFinder Automation Language (CAL) to<br />

support Oracle. Some are not specific to Oracle,<br />

but of general utility:<br />

• SQL command. When you are connected to an<br />

Oracle database, you can pass any SQL<br />

command which does not return records. The<br />

format is simply SQL where the<br />

command is not quoted.<br />

Example:<br />

SQL create table mytable (id<br />

integer).<br />

• CURR_TABLE variable. This variable<br />

contains the name of the table connected to the<br />

current form. This works whether or not you<br />

are in Oracle.<br />

Example:<br />

MSG Current table is<br />

$CURR_TABLE<br />

• OPENDB allows change of table. Normally<br />

this command takes the name of a database,<br />

followed optionally by the name of a table in<br />

angle brackets. In ChemFinder 9.0, it can now<br />

take just the table name, and causes the form to<br />

become attached to a different table in the<br />

current database — as if you had brought up<br />

Properties and clicked a different table name.<br />

Example:<br />

OPENDB <br />

causes the current form to be connected to the<br />

table CHEM_STRUCTS.<br />

• STATMSG command displays a message on<br />

the status bar. Format: STATMSG .<br />

Example:<br />

STATMSG Search is now in<br />

progress...<br />

• SEARCH SAVE LIST, RESTORE LIST<br />

work with Oracle. Normally you can follow<br />

either of these commands with the name of a<br />

file; in ChemFinder/Oracle you can instead<br />

provide a list name.<br />

ChemFinder<br />

<strong>ChemOffice</strong> 2005/ChemFinder ChemFinder/Oracle • 359<br />

CAL

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

Saved successfully!

Ooh no, something went wrong!