• Tidak ada hasil yang ditemukan

CURRENT SPUFI DEFAULTS panel

Dalam dokumen Application Programming and SQL Guide (Halaman 122-125)

User theCURRENTSPUFIDEFAULTSpaneltospecifySPUFIdefaults.

The followingdescriptionsexplaintheinformationontheCURRENTSPUFI DEFAULTS panel.

1 SQLTERMINATOR

Specify thecharacterthatyouusetoendeachSQLstatement. Youcan specifyanycharacterexceptthecharacterslistedinTable23.Asemicolon(;) isthedefaultSQLterminator.

Table23.InvalidspecialcharactersfortheSQLterminator

Name Character

Hexadecimal representation

blank X'40'

comma , X'5E'

doublequote ″ X'7F'

leftparenthesis ( X'4D'

rightparenthesis ) X'5D'

singlequote ’ X'7D'

underscore _ X'6D'

Usea characterotherthana semicolonifyouplantoexecutea statement thatcontains embeddedsemicolons.For example,supposeyouchoosethe character# asthestatementterminator.ThenaCREATETRIGGER

statementwithembedded semicolonslooks likethefollowingstatement:

CREATE TRIGGER NEW_HIRE

AFTER INSERT ON EMP

FOR EACH ROW MODE DB2SQL

BEGIN ATOMIC

UPDATE COMPANY_STATS SET NBEMP = NBEMP + 1;

END#

ACREATEPROCEDUREstatementwith embeddedsemicolons lookslike thefollowingstatement:

CREATE PROCEDURE PROC1 (IN PARM1 INT, OUT SCODE INT)

LANGUAGE SQL

BEGIN

DECLARE SQLCODE INT;

DECLARE EXIT HANDLER FOR SQLEXCEPTION

SET SCODE = SQLCODE;

UPDATE TBL1 SET COL1 = PARM1;

END #

Be carefultochoosea characterfortheSQLterminatorthatisnotused within thestatement.

Youcanalsoset orchangetheSQLterminatorwithin aSPUFIinputdata set byusingthe--#SETTERMINATORstatement. See“EnteringSQL

statementsinSPUFI” onpage88fordetails.

2 ISOLATIONLEVEL

Specify theisolationlevelforyourSQLstatements.See“TheISOLATION option”onpage471formore information.

3 MAXSELECT LINES

Themaximum numberofrowsthataSELECTstatementcanreturn.To limitthenumberof rowsretrieved,enteranothermaximumnumber greaterthan1.

4 ALLOWSQLWARNINGS

EnterYES(thedefault)orNOtoindicatewhetherSPUFIwillcontinueto process anSQLstatementafterreceivingSQLwarnings:

YES Ifa warningoccurswhenSPUFIexecutesan OPENorFETCHfor a SELECTstatement,SPUFIcontinuestoprocesstheSELECT statement.

NO Ifa warningoccurswhenSPUFIexecutesan OPENorFETCHfor a SELECTstatement,SPUFIstopsprocessingtheSELECT

statement. IfSQLCODE+802occurswhenSPUFIexecutesa FETCHforaSELECTstatement, SPUFIcontinuestoprocessthe SELECTstatement.

5 CHANGEPLANNAMES

IfyouenterYESinthis field,youcanchangeplannamesona subsequent SPUFIdefaults panel,DSNESP07.EnterYESinthisfieldonlyifyouare certainthatyouwanttochangetheplannamesthatareusedbySPUFI.

Consultwith yourDB2system administratorifyouare uncertainwhether youwanttochangetheplannames.Using aninvalidorincorrectplan namemightcauseSPUFItoexperienceoperationalerrorsoritmightcause datacontamination.

6 SQLFORMAT

Specify howSPUFIwillpre-processtheSQLinputbefore passingit to DB2.Selectoneofthefollowingoptions:

SQL ThisisthepreferredmodeforSQLstatementsotherthanSQL procedurallanguage.Whenyouusethisoption,whichisthe default,SPUFIcollapseseachlineofan SQLstatementintoasingle linebeforepassingthestatementtoDB2.SPUFIalsodiscardsall SQLcomments.

SQLCOMNT

ThismodeissuitableforallSQL,butitisintendedprimarilyfor SQLprocedurallanguageprocessing.Whenthisoptionisineffect, behaviorissimilartoSQLmode,exceptthatSPUFIdoesnot discardSQLcomments.Instead,itautomaticallyterminateseach SQLcommentwith alinefeedcharacter(hex25),unlessthe commentisalreadyterminatedbyoneormorelineformatting characters.Usethis optiontoprocessSQLprocedurallanguage with minimalmodification bySPUFI.

SQLPL

ThismodeissuitableforallSQL,butitisintendedprimarilyfor

|

|

|

|

||

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

SQLprocedurallanguageprocessing.Whenthisoptionisineffect, SPUFIretainsSQLcommentsand terminateseachlineofan SQL statementwitha linefeed character(hex25)before passingthe statementtoDB2.Linesthatendwithasplittoken arenot terminatedwith alinefeedcharacter.Use thismodetoobtain improveddiagnosticsanddebuggingofSQLprocedurallanguage.

7 SPACEUNIT

Specify howspacefortheSPUFIoutputdataset istobe allocated.

TRK Track

CYL Cylinder

8 PRIMARYSPACE

Specify howmanytracksorcylindersofprimary spaceare tobeallocated.

9 SECONDARYSPACE

Specify howmanytracksorcylindersofsecondaryspacearetobe allocated.

10RECORD LENGTH

Therecord lengthmustbe atleast80bytes.Themaximumrecord length dependsonthedevicetypeyouuse. Thedefaultvalueallowsa 32756-byte record.

Eachrecord canholdasingle lineofoutput.Ifa lineislongerthana record,theoutputistruncated,and SPUFIdiscardsfieldsthatextend beyondtherecordlength.

11 BLOCKSIZE

Followthenormalrulesforselectingtheblocksize.Forrecord formatF, theblocksizeisequaltotherecordlength.For FBandFBA,choose a blocksizethatisanevenmultipleofLRECL.ForVBand VBAonly,the blocksizemust be4 byteslargerthantheblocksizeforFB orFBA.

12RECORD FORMAT

Specify F,FB, FBA,V,VB,orVBA.FBAand VBAformatsinsert aprinter controlcharacterafterthenumberoflinesspecifiedintheLINES/PAGE OFLISTING fieldontheDB2IDefaultspanel. Therecordformatdefaultis VB(variable-lengthblocked).

13DEVICETYPE

Specify astandardz/OSnamefordirect-accessstoragedevicetypes. The defaultisSYSDA.SYSDAspecifiesthatz/OSistoselectanappropriate directaccessstoragedevice.

14MAXNUMERICFIELD

Themaximum widthofa numericvaluecolumninyour output.Choosea value greaterthan0.Thedefaultis33.Formoreinformation,see

“FormattingrulesforSELECTstatementresultsinSPUFI” onpage93.

15MAXCHARFIELD

Themaximum widthofa charactervaluecolumninyour output.

DATETIMEand GRAPHICdatastringsareexternallyrepresentedas characters,and SPUFIincludestheirdefaults withthedefaultvaluesfor characterfields.Choosea valuegreaterthan0.TheIBM-supplieddefaultis 250. Formoreinformation,see“FormattingrulesforSELECTstatement resultsinSPUFI” onpage93.

16COLUMN HEADING

YoucanspecifyNAMES,LABELS,ANY,orBOTHforcolumnheadings.

|

|

|

|

|

|

|

|

||

||

|

|

|

|

|

|

|

|

|

|

|

|

|

|

v NAMES usescolumnnamesonly.

v LABELS (default)usescolumn labels.Leave thetitleblankifnolabel exists.

v ANYusesexistingcolumnlabelsorcolumnnames.

v BOTHcreatestwotitlelines,onewith namesandonewithlabels.

Columnnamesare thecolumnidentifiers thatyoucanuseinSQL statements.IfanSQLstatementhasanASclauseforacolumn,SPUFI displays thecontentsoftheASclauseintheheading,ratherthanthe columnname.YoudefinecolumnlabelswithLABELstatements.

17FORBITDATA

Specify howSPUFIistodisplaythedatafromFORBIT DATAcolumns.

ASIS SPUFIdisplaysthedatafromFORBIT DATAcolumnsasitis stored.ThedefaultisASIS.

IfyouspecifyASISwhena graphiccharactersetisineffect, SPUFI replacesalloccurrencesoftheshift-out(X'0E')and shift-in(X'0F') charactersintheoutputoftheFORBITDATAcolumns witha substitutioncharacterof'.'(X'4B').Toavoidthis substitution, specifyHEX.

HEX SPUFIdisplaysthedatafromFORBIT DATAcolumnsin hexadecimal format.

Dalam dokumen Application Programming and SQL Guide (Halaman 122-125)