AIS provides a virtual database capabilities in the form of stored procedures and views.

Using the AIS SQL interface (NAV_UTIL EXECUTE <datasource>) one can define stored procedures and views as in the following examples:

NavSQL> create procedure SYS:MYPROC as select * from NAVDEMO:NATION where N_NATIONKEY = ?;
NavSQL> create view SYS:MYVIEW as select * from NAVDEMO:REGION,NAVDEMO NATION where R_REGIONKEY = N_REGIONKEY;
When updating to a new version or when re-installing AIS, one must recreate those definitions. For this reason, Attunity recommends that customers using these capabilities would prepare an SQL script, say LOADPV.SQL, that would contain DROP statements for all views and procedures and then CREATE statements for all views and procedures. It is important to order the CREATE statements such that if procedure A calls procedure B, the procedure B is created before procedure A.

An example of such file is:
drop procedure SYS:MYPROC;
drop view SYS:MYVIEW;
create procedure SYS:MYPROC as select * from NAVDEMO:NATION where N_NATIONKEY = ?;
create view SYS:MYVIEW as select * from NAVDEMO:REGION;
The file is executed using a command such as:

Code:
$ nav_util execute SYS LOADPV.SQL
Starting with AIS version 5.0.1, stored procedures and views are handled by the AisDeployer utility like any other AIS definition so the use of such SQL script becomes optional (though definitely supported).