How to: |
Using SQL EX or SQL CPJAVA EX is similar to using EXEC, the difference is that the output from SQL EX is stored into a HOLD file called SQLOUT. The resulting SQLOUT file can then be processed with additional SELECT or TABLE statements which may (or may not) contain additional selection criteria, and possibly return less fields or create a virtual field that is derived from the data.
You can invoke a user-written JAVA class with the EX command if SET EXORDER is also used when considering external programs for execution.
SET SQLENGINE=CPJAVA SQL EX classparameter1,, parameter2, ... ; TABLE FILE SQLOUT PRINT * [ON TABLE [PC]HOLD] SET SQLENGINE=OFF
where:
Is the full name of the class to be invoked and must be preceded by the prefix java.
Are the parameters which must be passed to the JAVA class according to the rules described in Passing Parameters.
SET CPJAVA EX classparameter1,parameter2, , ... ; TABLE FILE SQLOUT PRINT * [ON TABLE [PC]HOLD] END
where:
Is the full name of the class to be invoked and must be preceded by the prefix java.
Are the parameters which must be passed to the JAVA class according to the rules described in Passing Parameters.
The trailing semi-colon is required syntax. Either syntax is valid and one may be stylistically better for any given application.
SQL CPJAVA EX java.ibi.cjsamples.cjsamp parameter1, “subparm1=val1, subparm2=val2”, simple parameter3; TABLE FILE SQLOUT PRINT * END
iWay Software |