DISCONNECT

Releases a connection to Zim Integrated Server on to an SQL database.

Syntax

DISCONNECT FROM [ “ZIMSERV” | “JDBCSAM” | alias name ]

Parameters

The alias name is one of the defined ones in the zimalias.zim configuration file.

Comments

The DISCONNECT command should only be issued after a CONNECT command has been successfully executed in order to disconnect a previous connected session. The name of the server to be used in DISCONNECT must be the same used in CONNECT.

Example

> connect to ”JDBCSAM” using (“Sales”, “MySQL”, “TheUser”, “ThePassword”,”5455″, “123.123.123.123”)

> disconnect from ”JDBCSAM”

> connect to ”ZIMSERV” using (“Inventory”, “”, “JOE”, “PASSWORD”, “Joes_Server”, “LinuxAirport”)

> disconnect from ”ZIMSERV”

 

See Also

COMPILE

CONNECT

SET COMPILEMODE

SET EXECUTEMODE

SET SQLCOMPILE

SET SQLTRACE

UNCOMPILE

IS [NOT] [$]NULL

Checks a value to see if it is $Null.

Syntax

expression IS [NOT] $NULL

Parameters

expressionAny expression.

Return Value

Logical.

Comments

An IS $NULL comparison is logically true if expression is valueless (unassigned). If expression has been assigned any value (including the null string), then the comparison is logically false.

An IS NOT $NULL comparison is logically true if expression has been assigned any value (including the null string). If expression is valueless (unassigned), then the comparison is logically false.

$NULL can also be written as NULL.

Example

To find all employees whose records have no value recorded in the Age field, and then change that value to 39, enter

change all Employees where Age is $Null let Age = 39

See Also

About Boolean Expressions

About Conditional Expressions

GOTO NEXT

Branches from an exception handler to the command immediately following the command that caused the exception.

Syntax

GOTO NEXT

Comments

GOTO NEXT is used only in an exception handler and only to branch to the command immediately following the one that caused the exception to occur. GOTO NEXT exits the exception handler, and closes it in the same way as ENDON.

Example

procedure DoReports()

 on break

  output “*** Report Terminated by User ***”

  goto next

 endon

 report from clients (unrelated) placed orders

  (report commands)

 endreport

 report from products (unrelated) require orders

  (report commands)

 endreport

 report from orders (unrelated) issued invoices

  (report commands)

 endreport

endprocedure

If a break condition occurs during the generation of a report, a message is output and execution resumes at the command following the one that was interrupted.

See Also

GOTO

GOTO PREVIOUS

ON

SET MEMBERINTERVAL

Sets the interval between set-processing progress messages.

Syntax

SET MEMBERINTERVAL num

Parameters

numNum can be:
an integer constant (e.g., 15, 200)
a variable, form field, menu item, or parameter that evaluates to an integer.

Comments

The MEMBERINTERVAL option is set to 1 by default.

The MEMBERINTERVAL option determines how many records are to be processed between messages tracking the progress of set-processing commands. Set-processing progress messages are turned on or off with the SET MEMBERCOUNT command.

Example

> set membercount on
> set member interval 10
> find Employees
200 processed.
200 selected.
>

The number of records processed and selected are displayed in increments of ten until all records are processed.

See Also

$MemberCount

SET ERRORS

SET MEMBERCOUNT

SET STOP ERRORS

Halts the execution of an application program if an error occurs.

Syntax

SET STOP ERRORS ON|OFF

Comments

The STOP ERRORS option is OFF by default.

When STOP ERRORS is switched ON, execution is halted (by the HALT utility) when an error occurs. To resume execution after the HALT, press Enter at the HALT prompt (>>).

Compiled application programs are not affected by SET STOP ERRORS.

The ET STOP ERRORS command is not affected by the SET RESET and SET RESTORE commands.

Example

> set stop errors on
:
> list all test
procedure test (p_OwnerName)
report from Fields where OwnerName = p_OwnerName % Spelling error
… body of report …
endreport
endprocedure
> test
*** Error *** …
>>

The HALT command is executed when the execution of test results in an error. (The name of the EntitySet Fields is misspelled in the body of the procedure.)

See Also

$ErrCode

SET SELECTIVITY

SET SINGLESTEP

SET EXECUTEMODE

SET EXECUTEMODE

Controls the mode of software execution.

Syntax

SET EXECUTEMODE SQLMODE | ZIMMODE | SERVERMODE

Comments

The EXECUTEMODE option is set to SQLMODE by default.

The SQLMODE option executes SQL database code.

The SERVERMODE option executes integrated Zim server code.

The ZIMMODE option executes standard Zim code. In ZIMMODE, EntType, RelType, and so on are ignored. In this way, it can be used for testing without an effective connection.

When EXECUTEMODE is SQLMODE, Zim executes integrated server requests on the target Zim server if possible. Otherwise, it sends SQL requests to the server. When EXECUTEMODE is SQLMODE, Zim executes code against the target SQL database. By setting EXECUTEMODE to ZIMMODE, Zim executes the code as standard Zim code.

Example

To execute Zim Client-server code as standard Zim code, enter

> set executemode zimmode

See Also

COMPILE

SET COMPILEMODE

SET SQLCOMPILE

UNCOMPILE

$absolute

Returns the absolute value of a number.

Syntax

$absolute(number)

where

numbera number, or an expression that evaluates to a number

Return Value

Number, positive, with the same number of decimal places as number.

Comments

Use $absolute to ensure that a number is positive (for functions such as $sqrt, for example). $absolute returns the absolute (unsigned) value of a number. The absolute value is always treated as positive.

Example

Certain functions – for example, $sqrt – accept only positive arguments. You can use $absolute to ensure that all arguments to these functions are positive.

$sqrt($absolute(-0.98))

evaluates as if it were:

$sqrt(0.98)

See Also

About Functional Expressions

$tolower

Converts alphabetic characters to lower case.

Syntax

$tolower(source)

Parameters

sourceany value, or an expression that yields any value

Return Value

Character string.

Comments

Returns a character string in which all letters are lower case. If source is not of a character data type, it is converted to a character data type before the function is applied.

Example

$tolower("the QUICK BROWN fox is 30 years oLD")

Evaluates to “the quick brown fox is 30 years old”.

output "Do you want output to go to the printer? (y/n)"
input <1>
if $tolower("#<1>") = "y"   % makes user response case insensitive
set output printer
endif

Ensures that the user response is case-insensitive.

See Also

$toupper

About Character Literals

About Functional Expressions

SET CHECKSETS

Controls consistency checking of result sets.

Syntax

SET CHECKSETS ON|OFF

Comments

The CHECKSETS option is set ON by default.
When CHECKSETS is ON, the software checks certain aspects of the component structure of result sets for consistency. This consistency checking is performed when a command creates a result set (using the -> (Result set) subcommand), if the set has already been defined as a result set, either in a previous set-producing command, or as a NamedSet object in the Object Dictionary. Normally, you should always leave CHECKSETS set ON.
The SET CHECKSETS command is not affected by the SET RESET and SET RESTORE commands.

Example

find Employees -> Set1

find Departments -> Set1

With CHECKSETS set ON, the second command in the preceding sequence produces an error (the component structure of the set is not consistent from one command to the next).

set checksets off

find Employees -> Set1

find Departments -> Set1

By setting CHECKSETS OFF, the command sequence produces no error.

See Also

CREATE

SET SQLCOMPILE

SET SQLCOMPILE

Controls the compilation of generated SQL statements within the SQL database.

Syntax

SET SQLCOMPILE ON|OFF

Comments

The SQLCOMPILE option is OFF by default. The software stores SQL statements generated in the compiled code and executes them dynamically at run time.

When SQLCOMPILE is switched ON, the software attempts to compile all generated SQL statements at the SQL database server. Before attempting to compile with SQL compiling switched on, you must be connected to the SQL database.

Changes to this setting provide control over how the SQL statements are to be executed. The query optimizers for certain SQL databases perform differently when processing SQL statements dynamically.

Example

set sqlcompile off
list all Customers format CC LastName
set sqlcompile on

Forces the statement list all Customers format CC LastName to be executed dynamically at the server within a compiled application program.

See Also

COMPILE

SET COMPILEMODE

SET EXECUTEMODE

SET SQLTRACE

UNCOMPILE

pt_BRPortuguese