You can reference client-supplied variables when you pass them as host parameters of a function or procedure call.
The following example illustrates how to access the host parameters used in a web service named ShowTable:
CREATE SERVICE ShowTable TYPE 'RAW' AUTHORIZATION ON AS CALL ShowTable( :user_name, :table_name ); CREATE PROCEDURE ShowTable(IN username VARCHAR(128), IN tblname VARCHAR(128)) BEGIN -- write SQL code utilizing the username and tblname variables here. END;
Service host parameters are mapped in the declaration order of procedure parameters. In the above example, the user_name and table_name host parameters map to the username and tblname parameters, respectively.