Sybernet / Supplied Functions Reference
Release 3.00
Mar 03, 2005
backwards forwards

HTTP.SP_CRON_INSERT_PARAMETER

This function allows you to specify and then pass parameters to the procedure that you registered by calling SP_CRON_INSERT. While HTTP.SP_CRON_INSERT allows you to register a stored procedure, this function allows you to specify the parameters that are passed to that procedure.

This function will raise an exception if you attempt to pass an invalid parameter name to the procedure that you registered by calling SP_CRON_INSERT. If the procname that you registered is a script or executable, however, then all parameters are valid and are case-sensitive. Parameters passed to scripts or executables are passed in order by name, not in the order they were submitted to this function. arg1, arg2, and arg3 are typical names, but if you pass more than 9 names, then arg01, arg02, arg03 are better choices here.

When invoking a script or executable, parameter names are case-sensitive. When invoking a stored procedure, parameter names are case-insensitive. If you are passing a case-sensitive parameter name to SP_CRON_INSERT_PARAMETER because it is case-sensitive and you double quoted its name when declared in Oracle, then specify that name as case-sensitive and do not quote it when passed to this function.

Syntax

function sp_cron_insert_parameter
(
    @ROW_ID                        INT
,   @NAME                          VARCHAR(30)
,   @VALUE                         VARCHAR(255)
)

Parameters

Parameter Description
row_id
 
The ROW_ID returned by SP_CRON_INSERT.
name
 
The name of this parameter.
value
 
The value of this parameter.

Returns

-1 if an error occurs. Otherwise, the ROW_ID you passed.

Example

This example illustrate how to register a stored procedure and how two parameters are passed when it is invoked:

declare
    @row_id int
begin
    begin transaction
    exec @row_id=http.dbo.sp_cron_insert

        @PROCNAME   = 'http.dbo.sp_html_xmas'
    ,   @EMAIL      = 'nospam@nospams.com'
    ,   @DATENAME   = 'DECEMBER'
    ,   @DAY        = '25'
    ,   @HOUR       = '8'

    if (@row_id != -1)
    exec @row_id=http.dbo.sp_cron_insert_parameter

        @ROW_ID     = row_id
    ,   @NAME       = 'name1'
    ,   @VALUE      = 'value1'

    if (@row_id != -1)
    exec @row_id=http.dbo.sp_cron_insert_parameter

        @ROW_ID     = row_id
    ,   @NAME       = 'name2'
    ,   @VALUE      = 'value2'

    if (@row_id != -1)
        commit transaction
    else
        rollback transaction
end


See Also

SP_CRON_INSERT
SP_HTML_CRON
SP_HTML_CRON_MONITOR
SP_HTML_CRON_REGISTER



Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/