NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)
DROP❍
HELP TEXT❍
UPDATE STATISTICS❍
In the Data Manipulation Language (DML):
DECLARE CURSOR❍
DELETE❍
INSERT❍
SELECT❍
UPDATE❍
●
Substitution also works on subqueries.
The alias substitution mechanism does not substitute Guardian filenames and Guardian DEFINEs. If your SQL query
uses a DEFINE, you cannot use this alias substitution mechanism.
In the following example, no alias substitution is possible:
select jobcode, deptnum, first_name, last_name from persnl.employee
where jobcode > 500 and deptnum <= 3000 order by jobcode browse access
In the following example of a nested statement, the candidates for substitution are printed in bold type:
update employee set salary = salary*1.1
where deptnum in (select deptnum from dept where location = "San Francisco")
In the following example, the candidates for substitution are printed in bold type. Candidates include the correlation
names, o and p, because they can be user-defined names that can be replaced by Guardian table names (such as parts).
select ordernum,
sum(qty_ordered*price) from parts p, odetail o
where o.partnum = parts.partnum
and ordernum in (select ordernum from orders o, customer c
where o.custnum = c.custnum and state = "CALIFORNIA" group by ordernum)
Note: Mapping parts to a fully qualified Guardian name (such as $sys1.vol.subvol.parts)
results in an invalid SQL statement, because the substitution procedure also replaces the second occurrence
of parts.
To check the effect of alias substitution during development, use the SQLMPConnection.nativeSQL(String
str) function. This function returns the SQL statement that results from performing alias substitutions on the SQL
statement str.
Troubleshooting
This subsection explains the following subjects:
No suitable driver error●
Data truncation●
Dangling statements●