ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzmstincludesqlca.htm

229 lines
11 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?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 xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="dc.language" scheme="rfc1766" 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. -->
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<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="keywords" content="C, SQLCA, application program,
SQLCA (SQL communication area), COBOL, FORTRAN, PL/I, RPG/400, ILE RPG" />
<title>INCLUDE SQLCA declarations</title>
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
<link rel="stylesheet" type="text/css" href="ic.css" />
</head>
<body>
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
<a name="includesqlca"></a>
<h2 id="includesqlca"><a href="rbafzmst02.htm#ToC_1495">INCLUDE SQLCA declarations</a></h2><a id="idx3416" name="idx3416"></a><a id="idx3417" name="idx3417"></a><a id="idx3418" name="idx3418"></a>
<p>In <span class="bold">C and C++</span>, INCLUDE SQLCA declarations are equivalent
to the following: </p>
<pre class="xmp">#ifndef SQLCODE
struct sqlca
{
unsigned char sqlcaid[8];
long sqlcabc;
long sqlcode;
short sqlerrml;
unsigned char sqlerrmc[70];
unsigned char sqlerrp[8];
long sqlerrd[6];
unsigned char sqlwarn[11];
unsigned char sqlstate[5];
};
#define SQLCODE sqlca.sqlcode
#define SQLWARN0 sqlca.sqlwarn[0]
#define SQLWARN1 sqlca.sqlwarn[1]
#define SQLWARN2 sqlca.sqlwarn[2]
#define SQLWARN3 sqlca.sqlwarn[3]
#define SQLWARN4 sqlca.sqlwarn[4]
#define SQLWARN5 sqlca.sqlwarn[5]
#define SQLWARN6 sqlca.sqlwarn[6]
#define SQLWARN7 sqlca.sqlwarn[7]
#define SQLWARN8 sqlca.sqlwarn[8]
#define SQLWARN9 sqlca.sqlwarn[9]
#define SQLWARNA sqlca.sqlwarn[10]
#define SQLSTATE sqlca.sqlstate
#endif
struct sqlca sqlca;</pre><p class="indatacontent"> <a id="idx3419" name="idx3419"></a> <a id="idx3420" name="idx3420"></a> <a id="idx3421" name="idx3421"></a></p>
<p>In <span class="bold">COBOL</span>, INCLUDE SQLCA declarations are equivalent
to the following: </p>
<pre class="xmp">01 SQLCA.
05 SQLCAID PIC X(8).
05 SQLCABC PIC S9(9) BINARY.
05 SQLCODE PIC S9(9) BINARY.
05 SQLERRM.
49 SQLERRML PIC S9(4) BINARY.
49 SQLERRMC PIC X(70).
05 SQLERRP PIC X(8).
05 SQLERRD OCCURS 6 TIMES
PIC S9(9) BINARY.
05 SQLWARN.
10 SQLWARN0 PIC X(1).
10 SQLWARN1 PIC X(1).
10 SQLWARN2 PIC X(1).
10 SQLWARN3 PIC X(1).
10 SQLWARN4 PIC X(1).
10 SQLWARN5 PIC X(1).
10 SQLWARN6 PIC X(1).
10 SQLWARN7 PIC X(1).
10 SQLWARN8 PIC X(1).
10 SQLWARN9 PIC X(1).
10 SQLWARNA PIC X(1).
05 SQLSTATE PIC X(5).</pre><p class="indatacontent"> </p>
<a name="wq1970"></a>
<div class="notetitle" id="wq1970">Note:</div>
<div class="notebody">In COBOL, INCLUDE SQLCA
must not be specified outside the Working Storage Section.</div><p class="indatacontent"> <a id="idx3422" name="idx3422"></a> <a id="idx3423" name="idx3423"></a> <a id="idx3424" name="idx3424"></a></p>
<p>In <span class="bold">FORTRAN</span>, INCLUDE SQLCA declarations are equivalent
to the following: </p>
<pre class="xmp"> CHARACTER SQLCA(136)
CHARACTER SQLCAID*8
INTEGER*4 SQLCABC
INTEGER*4 SQLCODE
INTEGER*2 SQLERRML
CHARACTER SQLERRMC*70
CHARACTER SQLERRP*8
INTEGER*4 SQLERRD(6)
CHARACTER SQLWARN*11
CHARACTER SQLSTOTE*5
EQUIVALENCE (SQLCA( 1), SQLCAID)
EQUIVALENCE (SQLCA( 9), SQLCABC)
EQUIVALENCE (SQLCA( 13), SQLCODE)
EQUIVALENCE (SQLCA( 17), SQLERRML)
EQUIVALENCE (SQLCA( 19), SQLERRMC)
EQUIVALENCE (SQLCA( 89), SQLERRP)
EQUIVALENCE (SQLCA( 97), SQLERRD)
EQUIVALENCE (SQLCA(121), SQLWARN)
EQUIVALENCE (SQLCA(132), SQLSTOTE)
INTEGER*4 SQLCOD,
C SQLERR(6)
INTEGER*2 SQLTXL
CHARACTER SQLERP*8,
C SQLWRN(0:7)*1,
C SQLWRX(1:3)*1,
C SQLTXT*70,
C SQLSTT*5,
C SQLWRNWK*8,
C SQLWRXWK*3,
C SQLERRWK*24,
C SQLERRDWK*24
EQUIVALENCE (SQLWRN(1), SQLWRNWK)
EQUIVALENCE (SQLWRX(1), SQLWRXWK)
EQUIVALENCE (SQLCA(97), SQLERRDWK)
EQUIVALENCE (SQLERR(1), SQLERRWK)
COMMON /SQLCA1/SQLCOD,SQLERR,SQLTXL
COMMON /SQLCA2/SQLERP,SQLWRN,SQLTXT,SQLWRX,SQLSTT</pre><p class="indatacontent"> <a id="idx3425" name="idx3425"></a> <a id="idx3426" name="idx3426"></a> <a id="idx3427" name="idx3427"></a></p>
<p>In <span class="bold">PL/I</span>; INCLUDE SQLCA declarations are equivalent
to the following: </p>
<a name="insqlca"></a>
<pre id="insqlca" class="xmp">DCL 1 SQLCA,
2 SQLCAID CHAR(8),
2 SQLCABC BIN FIXED(31),
2 SQLCODE BIN FIXED(31),
2 SQLERRM CHAR(70) VAR,
2 SQLERRP CHAR(8),
2 SQLERRD(6) BIN FIXED(31),
2 SQLWARN,
3 SQLWARN0 CHAR(1),
3 SQLWARN1 CHAR(1),
3 SQLWARN2 CHAR(1),
3 SQLWARN3 CHAR(1),
3 SQLWARN4 CHAR(1),
3 SQLWARN5 CHAR(1),
3 SQLWARN6 CHAR(1),
3 SQLWARN7 CHAR(1),
3 SQLWARN8 CHAR(1),
3 SQLWARN9 CHAR(1),
3 SQLWARNA CHAR(1),
2 SQLSTATE CHAR(5);</pre><p class="indatacontent"> <a id="idx3428" name="idx3428"></a> <a id="idx3429" name="idx3429"></a> <a id="idx3430" name="idx3430"></a></p>
<p>In <span class="bold">RPG/400&reg;</span>; SQLCA declarations are equivalent to the
following:</p>
<p></p>
<pre class="xmp">ISQLCA DS
I 1 8 SQLAID SQL
I B 9 120SQLABC SQL
I B 13 160SQLCOD SQL
I B 17 180SQLERL SQL
I 19 88 SQLERM SQL
I 89 96 SQLERP SQL
I 97 120 SQLERR SQL
I B 97 1000SQLER1 SQL
I B 101 1040SQLER2 SQL
I B 105 1080SQLER3 SQL
I B 109 1120SQLER4 SQL
I B 113 1160SQLER5 SQL
I B 117 1200SQLER6 SQL
I 121 131 SQLWRN SQL
I 121 121 SQLWN0 SQL
I 122 122 SQLWN1 SQL
I 123 123 SQLWN2 SQL
I 124 124 SQLWN3 SQL
I 125 125 SQLWN4 SQL
I 126 126 SQLWN5 SQL
I 127 127 SQLWN6 SQL
I 128 128 SQLWN7 SQL
I 129 129 SQLWN8 SQL
I 130 130 SQLWN9 SQL
I 131 131 SQLWNA SQL
I 132 136 SQLSTT SQL</pre><p class="indatacontent"> <a id="idx3431" name="idx3431"></a> <a id="idx3432" name="idx3432"></a> <a id="idx3433" name="idx3433"></a></p>
<p>In <span class="bold">ILE RPG</span>; SQLCA declarations are equivalent to
the following: </p>
<pre class="xmp"> D* SQL Communications area
D SQLCA DS
D SQLCAID 8A INZ(X'0000000000000000')
D SQLAID 8A OVERLAY(SQLCAID)
D SQLCABC 10I 0
D SQLABC 9B 0 OVERLAY(SQLCABC)
D SQLCODE 10I 0
D SQLCOD 9B 0 OVERLAY(SQLCODE)
D SQLERRML 5I 0
D SQLERL 4B 0 OVERLAY(SQLERRML)
D SQLERRMC 70A
D SQLERM 70A OVERLAY(SQLERRMC)
D SQLERRP 8A
D SQLERP 8A OVERLAY(SQLERRP)
D SQLERR 24A
D SQLER1 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLER2 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLER3 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLER4 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLER5 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLER6 9B 0 OVERLAY(SQLERR:*NEXT)
D SQLERRD 10I 0 DIM(6) OVERLAY(SQLERR)
D SQLWRN 11A
D SQLWN0 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN1 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN2 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN3 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN4 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN5 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN6 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN7 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN8 1A OVERLAY(SQLWRN:*NEXT)
D SQLWN9 1A OVERLAY(SQLWRN:*NEXT)
D SQLWNA 1A OVERLAY(SQLWRN:*NEXT)
D SQLWARN 1A DIM(11) OVERLAY(SQLWRN)
D SQLSTATE 5A
D SQLSTT 5A OVERLAY(SQLSTATE)
D* End of SQLCA </pre>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstfielddescsqlca.htm">Previous Page</a> | <a href="rbafzmstsqldda.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
<a href="rbafzmstindex.htm#index">Index</a> ]
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
</body>
</html>