Database Reference
In-Depth Information
2.6.1.3 Variables The variables vAr_Appname, vAr_Dbname, vAr_
maxLreportname, vAr_maxLScriptname, and vAr_Status are either Set or Declare
variables without refreshing code.
vAr_CheckmaxLErr, vAr_kounter, vAr_maxDimCount, vAr_object, and
vAr_recordCount all have refreshing code of either Jython or SQL and are docu-
mented below.
2.6.1.3.1 VAR _Check MaxLEr r Purpose— maxL creates a StDErr file even when
there is no error; StDErr in this case has a zero length. This code (courtesy of John
goodwin's “more to Life Than This Blog”) tests to see if the file has any content. If the
code errors out, the file is empty, so there is no error; if the file has a length greater than
zero, there is an error.
Note: This Jython code uses the oDI variable vAr_maxLScriptname to define the
error file; the error file must match the script name.
Code
select C1
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLE
SNP$CRTABLE_NAME=ERROR_LOG
SNP$CRLOAD_FILE=<%=odiRef.getSchemaName("D")%>\#VAR_MaxLScriptName.
err
SNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=09
SNP$CRFILE_SEP_LINE=0D0A
SNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=
SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=C1
SNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=1000
SNP$CRPRECISION=1000SNP$CR$$SNPS_END_KEY*/
2.6.1.3.2 VAR_Kounter Purpose— Increment vAr_kounter by 1, except where
vAr_kounter <= vAr_maxDimCount using SQL.
Note: The Jython code <%=odiref.getobjectname(“ TableName ”)%> resolves to a fully
qualified database (or schema), owner, and table name; this is common oDI practice to
produce context independent code.
Code
--
Increment the VAR_Kounter variable by one so long as
--
VAR_Kounter + 1 is <= the row count of vDimList.
--
When VAR_Kounter = vDimList's row count, branch
--
to Package stop.
SELECT
#VAR_Kounter+1
FROM
<%=odiRef.getObjectName("DUAL")%>
WHERE #VAR_Kounter + 1 <= #VAR_MaxDimCount
2.6.1.3.3 VAR_MaxDimCount Purpose— get the row count of the table
SuspendParent for use in the Package Pkg_LoopAndLoad.
Code
-- Get the row count of the table SuspendParent
SELECT COUNT(*) FROM <%=odiRef.getObjectName("SuspendParent")%>
Search WWH ::




Custom Search