Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Do you have the ODBC connection?
You should use the API. ActiveX-Control of the Programmers Toolkit.
Take a look here:
http://www-03.ibm.com/systems/i/software/access/windows/toolkit/remote_command.html
I think you need to create a procedure using the 'create procedure' instruction in sq session on AS/400
you can call the procedure with the sql 'Call' instruction
also make sure your odbc connection alows running procedures and has th enecessary libraries in the library list
I think you need to create a procedure using the 'create procedure' instruction in sq session on AS/400
you can call the procedure with the sql 'Call' instruction
also make sure your odbc connection alows running procedures and has th enecessary libraries in the library list
The best way is create a STORED PROCEDURE on ISeries.
On Iseries there are two differents type of procedures:
"SQL stored procedure" and "External stored procedure".
An Sql stored procedure is vincolate at SQL
with External procedure you can call an external program on Iseries (RPGLE, CL, C , COBOL.....)
there are two way to create a procedure:
1) in a SQL session on Iseries ( IBM manual "DB2 for i SQL Reference"
I.e.
Create procedure procedure_name
(in field1 char(5), out field2 decimal(3))
language sql reads sql data
seletct max(qta) from pfile_name where fieldx=field1
2) on Windows program bar "IBM System I Access for Windows" and then "System I Navigator".
In System I Navigator open your Iseries tree Database/library/Procedure.
Here you can create a procedure
In a procedure you can define IN, OUT and INOUT parameters.
Simple example without parameters:
On Iseries create a CL program lib/procedure_name
es:
PGM
CLRPFM FILE(LIB/FILENAME)
ENDPGM
On SQL session on Iseries
CRATE PROCEDURE lib/procedure_name
LANGUAGE CL
PARAMETER STYLE GENERAL
this create in lib the procedure procedure_name that start program with the same name.
So in lib there are the procedure and the program with the same name.
On Qlik script you create the ODBC string to connect to iseries and the command to call the procedure:
CONNECT TO [Provider..................
sql
call iseries.procedure_name;
When you call a iSeries program , the list library used is the ODBC driver library list.
On configuration ODBC system i Access for Windows there is Server/Library list