ml_add_passthrough_script system procedure

Use this system procedure to create a passthrough script. This procedure adds an entry to the ml_passthrough_script system table.

Syntax
ml_passthrough_script ( 
'script_name', 
'flags',
'affected_pubs', 
'script', 
'description' 
)
Parameters

Syntax

Description

script_name

VARCHAR(128). The script name. This value must be unique.

flags

VARCHAR(256). The value that tells clients how to run the script. This value can be null or contain a combination of the following keywords in a semicolon-delimited list:

  • manual   Indicates that the script may only be run in manual execution mode. By default, all scripts can be run in either automatic or manual execution modes.

  • exclusive   Indicates that the script may only be automatically executed at the end of a synchronization where exclusive locks were obtained on all tables being synchronized. This option is ignored if the affected_ publications value lists no publications. This option is only meaningful to SQL Anywhere remotes.

  • schema_diff   Indicates that the script should be run in schema-diffing mode. In this mode, the database schema is altered to match the schema described in the script. For example, a create statement for an existing table is treated as an alter statement. This flag only applies to scripts run on UltraLite remotes.

For example:

'manual;exclusive;schema_diff'

affected_pubs

TEXT. A list of publications that must be synchronized before the script is run. An empty string or null indicates that no synchronization is required. This value is only meaningful for SQL Anywhere clients. For Adaptive Server Enterprise, this parameter is VARCHAR(16384). For DB2 LUW, this parameter is VARCHAR(4000). For Oracle, this parameter is CLOB.

script

TEXT. The contents of the passthrough script. This value cannot be null. For Adaptive Server Enterprise, this parameter is VARCHAR(16384). For DB2 LUW, this parameter is VARCHAR(4000). For Oracle, this parameter is CLOB.

The script content must be non-null. For UltraLite remotes, the script content should be a collection of SQL statements separated by the word go appearing on a separate line. For SQL Anywhere remotes, the script content can be any collection of SQL statements that are valid when enclosed by a begin…end block.

Example of script content on a SQL Anywhere remote:

declare		val	integer;
	select c1 into val from t1 where pk = 5;
	if val > 100 then
	    insert into t2 values( ‘c1 is big’ );
 endif

Example of script content on an UltraLite remote:

create table myScript ( c1 int not null primary key )
go

insert into myScript values ( 1 )
go

description

VARCHAR(2000). A comment or description of the script. This value may be null.

Remarks

This procedure generates an error if the specified script_name already exists in ml_passthrough_script.

For DB2 mainframe consolidated database types, this procedure is called ml_add_pt_script. See IBM DB2 mainframe system procedure name conversions.

See also