135 lines
7.2 KiB
HTML
135 lines
7.2 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Source member listing for the SQL statement processor" />
|
||
|
<meta name="abstract" content="The following example details a source member listing for the SQL statement processor." />
|
||
|
<meta name="description" content="The following example details a source member listing for the SQL statement processor." />
|
||
|
<meta name="DC.subject" content="examples, QSYSPRT listing, SQL statement processor, SQL statement processor, example, SQL statement processor" />
|
||
|
<meta name="keywords" content="examples, QSYSPRT listing, SQL statement processor, SQL statement processor, example, SQL statement processor" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyrunstat.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbafysrcmember" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Source member listing for the SQL statement processor</title>
|
||
|
</head>
|
||
|
<body id="rbafysrcmember"><a name="rbafysrcmember"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Source member listing for the SQL statement processor</h1>
|
||
|
<div><p>The following example details a source member listing for the SQL
|
||
|
statement processor.</p>
|
||
|
<div class="section"><div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms of <a href="codedisclaimer.htm">Code license and disclaimer information</a></div>
|
||
|
</div>
|
||
|
<div class="example"> <div class="fignone" id="rbafysrcmember__poir"><a name="rbafysrcmember__poir"><!-- --></a><span class="figcap">Figure 1. QSYSPRT listing for SQL statement
|
||
|
processor</span><pre>5722SS1 V5R4M0 060210 Run SQL Statements SCHEMA 02/10/06 15:35:18 Page 1
|
||
|
Source file...............CORPDATA/SRC
|
||
|
Member....................SCHEMA
|
||
|
Commit....................*NONE
|
||
|
Naming....................*SYS
|
||
|
Generation level..........10
|
||
|
Date format...............*JOB
|
||
|
Date separator............*JOB
|
||
|
Time format...............*HMS
|
||
|
Time separator ...........*JOB
|
||
|
Default Collection........*NONE
|
||
|
IBM SQL flagging..........*NOFLAG
|
||
|
ANS flagging..............*NONE
|
||
|
Decimal point.............*JOB
|
||
|
Sort Sequence.............*JOB
|
||
|
Language ID...............*JOB
|
||
|
Printer file..............*LIBL/QSYSPRT
|
||
|
Source file CCSID.........65535
|
||
|
Job CCSID.................0
|
||
|
Statement processing......*RUN
|
||
|
Allow copy of data........*OPTIMIZE
|
||
|
Allow blocking............*READ
|
||
|
SQL rules.................*DB2
|
||
|
Decimal result options:
|
||
|
Maximum precision.......31
|
||
|
Maximum scale...........31
|
||
|
Minimum divide scale....0
|
||
|
Source member changed on 04/01/98 11:54:10</pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="example"><div class="fignone"><pre>5722SS1 V5R4M0 060210 Run SQL Statements SCHEMA 02/10/06 15:35:18 Page 2
|
||
|
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
|
||
|
1
|
||
|
2 DROP COLLECTION DEPT;
|
||
|
3 DROP COLLECTION MANAGER;
|
||
|
4
|
||
|
5 CREATE SCHEMA DEPT
|
||
|
6 CREATE TABLE EMP (EMPNAME CHAR(50), EMPNBR INT)
|
||
|
7 -- EMP will be created in collection DEPT
|
||
|
8 CREATE INDEX EMPIND ON EMP(EMPNBR)
|
||
|
9 -- EMPIND will be created in DEPT
|
||
|
10 GRANT SELECT ON EMP TO PUBLIC; -- grant authority
|
||
|
11
|
||
|
12 INSERT INTO DEPT/EMP VALUES('JOHN SMITH', 1234);
|
||
|
13 /* table must be qualified since no
|
||
|
14 longer in the schema */
|
||
|
15
|
||
|
16 CREATE SCHEMA AUTHORIZATION MANAGER
|
||
|
17 -- this schema will use MANAGER's
|
||
|
18 -- user profile
|
||
|
19 CREATE TABLE EMP_SALARY (EMPNBR INT, SALARY DECIMAL(7,2),
|
||
|
20 LEVEL CHAR(10))
|
||
|
21 CREATE VIEW LEVEL AS SELECT EMPNBR, LEVEL
|
||
|
22 FROM EMP_SALARY
|
||
|
23 CREATE INDEX SALARYIND ON EMP_SALARY(EMPNBR,SALARY)
|
||
|
24
|
||
|
25 GRANT ALL ON LEVEL TO JONES GRANT SELECT ON EMP_SALARY TO CLERK
|
||
|
26 -- Two statements can be on the same line
|
||
|
* * * * * E N D O F S O U R C E * * * * *</pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="example"><div class="fignone"><pre>5722SS1 V5R4M0 060210 Run SQL Statements SCHEMA 02/10/06 15:35:18 Page 3
|
||
|
Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
|
||
|
MSG ID SEV RECORD TEXT
|
||
|
SQL7953 0 1 Position 1 Drop of DEPT in QSYS complete.
|
||
|
SQL7953 0 3 Position 3 Drop of MANAGER in QSYS complete.
|
||
|
SQL7952 0 5 Position 3 Schema DEPT created.
|
||
|
SQL7950 0 6 Position 8 Table EMP created in DEPT.
|
||
|
SQL7954 0 8 Position 8 Index EMPIND created in DEPT on table EMP in
|
||
|
DEPT.
|
||
|
SQL7966 0 10 Position 8 GRANT of authority to EMP in DEPT completed.
|
||
|
SQL7956 0 10 Position 40 1 rows inserted in EMP in DEPT.
|
||
|
SQL7952 0 13 Position 28 Schema MANAGER created.
|
||
|
SQL7950 0 19 Position 9 Table EMP_SALARY created in collection
|
||
|
MANAGER.
|
||
|
SQL7951 0 21 Position 9 View LEVEL created in MANAGER.
|
||
|
SQL7954 0 23 Position 9 Index SALARYIND created in MANAGER on table
|
||
|
EMP_SALARY in MANAGER.
|
||
|
SQL7966 0 25 Position 9 GRANT of authority to LEVEL in MANAGER
|
||
|
completed.
|
||
|
SQL7966 0 25 Position 37 GRANT of authority to EMP_SALARY in MANAGER
|
||
|
completed.
|
||
|
|
||
|
Message Summary
|
||
|
Total Info Warning Error Severe Terminal
|
||
|
13 13 0 0 0 0
|
||
|
00 level severity errors found in source
|
||
|
* * * * * E N D O F L I S T I N G * * * * *</pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyrunstat.htm" title="The SQL statement processor allows SQL statements to be run from a source member. The statements in the source member can be run repeatedly, or changed, without compiling the source. This makes the setup of a database environment easier.">Use the SQL statement processor</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|