SQL_PARAMSCSV

LANSA Composer

SQL_PARAMSCSV

This activity sets parameter values to be used subsequently by one of the following SQL database activities , using values from a specified CSV file:

SQL_CALL

Execute an SQL stored procedure

SQL_CALLQRYCSV

Query database using an SQL stored procedure to CSV

SQL_CALLQUERY

Query database using an SQL stored procedure

SQL_UPDATE

Update database using SQL

 

 

The parameter values are used in the SQL statement used by one of the above activities in place of any parameter markers (usually designated by a question mark) that are specified in the SQL statement.

Note that any parameter values that have been set will be cleared after executing any of the above activities or the SQL_QUERY or SQL_QUERYTOCSV activities.  If you need to use the same set of parameters more than once, then you will need to repeat this activity before each activity that uses the parameters.

Refer also to the description of the SQL_PARAMS activity, which performs a similar function but using processing sequence variables instead of a CSV file.

For more information about the SQL database activities, refer to the description of the SQL_CONNECT activity.  For a list of supplied working (*) examples using the SQL database activities, refer to:

Example Processing Sequences using the SQL database activities

INPUT Parameters:

SQLHANDLE : Required

This parameter must specify the connection handle value that identifies the SQL connection upon which this activity should operate.  The connection handle value is returned by the SQL_CONNECT activity.

SQLFILEPATH : Required

This parameter must specify the path and file name of the CSV file containing the values to be used.  The CSV file should contain one or more columns, up to a maximum of 25, each "row" of which supplies one set of the parameter values to be used.

A subsequent SQL_CALL, SQL_CALLQRYCSV or SQL_CALLQUERY will use only one set (or "row) of parameter values.

In the case of a subsequent SQL_UPDATE activity, the requested operation (such as insert, update or delete) specified for the activity will be performed once for each set of entries (or "row") of parameter values.

COLSEPARATOR : Optional

You may specify the separator character that is used to separate the column values in each line of the CSV file.  The most common form of CSV uses a comma as the separator, and that is the default value for this parameter if you do not specify it.

If a non-comma separator is specified, it should be 1 character in length and can consist of any character.

HEADINGSROW : Optional

If the first row of the CSV file contains column headings, you should specify YES for this parameter.  If this parameter specifies YES, then the activity will ignore the first row read.  The default value is NO, which will cause the activity to process every row contained in the CSV file.

OUTPUT Parameters:

There are no output parameters.