Editing
Data-Dictionary
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Data Dictionary = <blockquote>'''Document ID:''' PGCBL-DDD-001 Β· '''Version:''' 1.0 Β· '''Status:''' Approved Β· '''Last updated:''' 2026-03-17 </blockquote> '''β [[Technical-Specification|Technical Specification]]''' | [[Flow-Diagrams|Flow Diagrams β]] ----- <span id="contents"></span> == Contents == # [[#conventions|Conventions]] # [[#1-control-blocks-copybooks|Control Blocks β Copybooks]] #* [[#11-primes-session|1.1 primes-session]] #* [[#12-primes-dal|1.2 primes-dal]] #* [[#13-primes-ui|1.3 primes-ui]] #* [[#14-primes-table--sql-host-variable-character|1.4 primes-table (character)]] #* [[#15-primes_table--sql-host-variable-packed|1.5 primes_table (packed)]] #* [[#16-sqlca--sql-communications-area|1.6 SQLCA]] # [[#2-working-storage-variables|Working-Storage Variables]] #* [[#21-primesmain|2.1 primesmain]] #* [[#22-primesgen|2.2 primesgen]] #* [[#23-primes-dal|2.3 primes (DAL)]] #* [[#24-primesui|2.4 primesui]] # [[#3-database-objects|Database Objects]] #* [[#31-schema-primes|3.1 Schema primes]] #* [[#32-table-primesprimes|3.2 Table primes.primes]] #* [[#33-sequence-asc_ident|3.3 Sequence asc_ident]] #* [[#34-cursor-primescursor-runtime|3.4 Cursor primescursor]] ----- <span id="conventions"></span> == Conventions == {| !width="50%"| Symbol !width="50%"| Meaning |- | <code>PIC X(n)</code> | Alphanumeric, n characters |- | <code>PIC 9(n)</code> | Unsigned packed decimal display, n digits |- | <code>PIC S9(n)</code> | Signed packed decimal display, n digits |- | <code>PIC 9(n)V9(m)</code> | Unsigned numeric with m implied decimal places (no decimal point stored) |- | <code>PIC Z(n)</code> | Zero-suppressed display numeric, n digits |- | <code>COMP-3</code> | Packed-decimal binary storage (2 digits per byte + sign nibble) |- | <code>COMP-5</code> | Native binary integer (platform word size) |- | <code>88</code> | Condition-name β a boolean alias tested via <code>IF <name></code> or <code>WHEN <name></code> |- | <code>β</code> | Not applicable (group item or 88-level) |- | β οΈ | Known issue or deviation from standard |} '''Level hierarchy used in this codebase:''' <pre>01 Group root 03 Sub-group or elementary item 05 Nested elementary item 07 Doubly-nested elementary item 49 Special level for variable-length groups (SQLERRM in SQLCA) 88 Condition-name (under any level)</pre> ----- <span id="control-blocks-copybooks"></span> == 1. Control Blocks β Copybooks == <span id="primes-session"></span> === 1.1 primes-session === <blockquote>'''Source file:''' <code>primes-session.cpy</code><br /> '''Included by:''' <code>primesmain.cbl</code> (WORKING-STORAGE) Β· <code>primesgen.cbl</code> (LINKAGE SECTION)<br /> '''Purpose:''' Session-tier control block. primesmain sets <code>methods</code>; primesgen reads it and sets <code>session-result</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-session</code> | β | β | β | Root of session control block |- | 03 | <code>methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb β set by primesmain before calling primesgen |- | 88 | <code>report-primes</code> | β | β | <code>"report"</code> | Run the cursor report path |- | 88 | <code>generate-primes</code> | β | β | <code>"generate"</code> | Run the sieve generation path |- | 88 | <code>start-primes</code> | β | β | <code>"start"</code> | Reserved β not used in current flow |- | 88 | <code>stop-primes</code> | β | β | <code>"stop"</code> | Reserved β not used in current flow |- | 88 | <code>invalid-method</code> | β | β | <code>"bad"</code> | Sentinel for unrecognised verb |- | 03 | <code>session-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primesgen |- | 88 | <code>session-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>session-method-nok</code> | β | β | 1 | Operation failed |- | 88 | <code>session-method-eof</code> | β | β | 9 | End of data (cursor exhausted) |} <blockquote>β οΈ <code>session-method-eof</code> (value 9) is never explicitly set in the current code. Fetch failure sets <code>session-result = 1</code> (nok), not 9. See [[Technical-Specification#7-known-technical-issues|Technical Specification β Defect T7]]. </blockquote> ----- <span id="primes-dal"></span> === 1.2 primes-dal === <blockquote>'''Source file:''' <code>primes-dal.cpy</code><br /> '''Included by:''' <code>primesgen.cbl</code> (WORKING-STORAGE, caller) Β· <code>primes.cbl</code> (LINKAGE SECTION, callee)<br /> '''Purpose:''' DAL-tier control block. primesgen sets <code>dal-methods</code> and reads back <code>dal-result</code> and <code>primes-data</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-dal</code> | β | β | β | Root of DAL control block |- | 03 | <code>dal-methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb |- | 88 | <code>next-prime</code> | β | β | <code>"next-prime"</code> | Fetch next row from open cursor |- | 88 | <code>next-divider</code> | β | β | <code>"next-divider"</code> | SELECT a prime by ident for use as trial divisor |- | 88 | <code>write-prime</code> | β | β | <code>"write"</code> | INSERT a confirmed prime into the table |- | 88 | <code>db-cursor</code> | β | β | <code>"cursor"</code> | START TRANSACTION and OPEN primescursor |- | 88 | <code>db-connect</code> | β | β | <code>"connect"</code> | Establish the PostgreSQL connection |- | 88 | <code>db-disconnect</code> | β | β | <code>"disconnect"</code> | Release the connection |- | 88 | <code>invalid-method</code> | β | β | <code>"bad"</code> | Sentinel for unrecognised verb |- | 03 | <code>primes-data</code> | β | β | β | Single-row data payload (one prime) |- | 05 | <code>primes-sequence</code> | <code>9(9)</code> | DISPLAY | β | Row identity (<code>ident</code>) of the fetched prime |- | 05 | <code>prime-number</code> | <code>9(9)</code> | DISPLAY | β | The prime value itself |- | 03 | <code>dal-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primes |- | 88 | <code>dal-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>dal-method-nok</code> | β | β | 1 | Operation failed |- | 88 | <code>dal-method-eof</code> | β | β | 99 | Cursor exhausted (no more rows) |} ----- <span id="primes-ui"></span> === 1.3 primes-ui === <blockquote>'''Source file:''' <code>primes-ui.cpy</code><br /> '''Included by:''' all four programs<br /> '''Purpose:''' UI-tier control block. Any program sets <code>ui-methods</code> and <code>process-message</code> / <code>u-primes</code>, then calls primesui; primesui sets <code>ui-method-result</code>. </blockquote> {| !width="16%"| Level !width="16%"| Name !width="16%"| PIC !width="16%"| Usage !width="16%"| Initial !width="16%"| Description |- | 01 | <code>primes-ui</code> | β | β | β | Root of UI control block |- | 03 | <code>ui-methods</code> | <code>X(32)</code> | DISPLAY | β | Method dispatch verb |- | 88 | <code>write-ui</code> | β | β | <code>"write"</code> | Add one prime row to the print buffer |- | 88 | <code>message-ui</code> | β | β | <code>"log-message"</code> | Write <code>process-message</code> to the console |- | 88 | <code>start-ui</code> | β | β | <code>"start"</code> | Open <code>primes.prt</code> |- | 88 | <code>stop-ui</code> | β | β | <code>"stop"</code> | Flush print buffer and close file |- | 03 | <code>process-message</code> | β | β | β | Structured 132-char console log record |- | 05 | <code>program-name</code> | <code>X(20)</code> | DISPLAY | β | Name of the calling program |- | 05 | <code>program-line</code> | β | β | β | Location within the calling program |- | 07 | <code>program-paragraph</code> | <code>X(20)</code> | DISPLAY | β | Name of the calling paragraph |- | 07 | <code>program-message</code> | <code>X(92)</code> | DISPLAY | β | Human-readable status or error text |- | 03 | <code>u-primes</code> | β | β | β | One prime row for the print writer |- | 05 | <code>u-sequence</code> | <code>9(9)</code> | DISPLAY | β | Sequence number (ident) to write to print buffer |- | 05 | <code>u-number</code> | <code>9(9)</code> | DISPLAY | β | Prime value to write to print buffer |- | 03 | <code>ui-method-result</code> | <code>9(2)</code> | DISPLAY | 0 | Outcome code written by primesui |- | 88 | <code>ui-method-ok</code> | β | β | 0 | Operation succeeded |- | 88 | <code>ui-method-nok</code> | β | β | 1 | Operation failed |} '''Console message layout''' (132 characters, left-to-right): <pre>ββββββββββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β program-name (20) β program-paragraph(20)β program-message (92) β ββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ</pre> ----- <span id="primes-table-sql-host-variable-character"></span> === 1.4 primes-table β SQL Host Variable (character) === <blockquote>'''Source file:''' <code>primes-table.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> via <code>EXEC SQL INCLUDE primes-table END-EXEC</code><br /> '''Purpose:''' Host variable layout for GixSQL to bind the <code>primes.primes</code> table columns. </blockquote> {| !width="20%"| Level !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Description |- | 01 | <code>primes-table</code> | β | β | Host variable group (character format) |- | 03 | <code>ident</code> | <code>S9(9)</code> | DISPLAY | Maps to <code>primes.ident</code>; signed for SQL compatibility |- | 03 | <code>prime</code> | <code>S9(9)</code> | DISPLAY | Maps to <code>primes.prime</code>; signed for SQL compatibility |} ----- <span id="primes_table-sql-host-variable-packed"></span> === 1.5 primes_table β SQL Host Variable (packed) === <blockquote>'''Source file:''' <code>primes_table.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> (alternative layout)<br /> '''Purpose:''' COMP-3 variant of <code>primes-table</code>. The underscore in both the filename and root name is a deviation from the projectβs hyphen convention. </blockquote> {| ! Level ! Name ! PIC ! Usage ! Description |- | 01 | <code>primes_table</code> | β | β | Host variable group (COMP-3 format) |- | 03 | <code>ident</code> | <code>S9(9)</code> | COMP-3 | Row identity β packed decimal |- | 03 | <code>prime</code> | <code>S9(9)</code> | COMP-3 | Prime value β packed decimal |} <blockquote>β οΈ Two nearly identical copybooks exist. <code>primes-table.cpy</code> (hyphens, DISPLAY) is used by the cursor FETCH target (<code>primes-row</code>). The canonical version should be designated and the other retired. See [[Technical-Specification#7-known-technical-issues|Technical Specification β Defect T6]]. </blockquote> ----- <span id="sqlca-sql-communications-area"></span> === 1.6 SQLCA β SQL Communications Area === <blockquote>'''Source file:''' <code>SQLCA.cpy</code><br /> '''Included by:''' <code>primes.cbl</code> via <code>EXEC SQL INCLUDE SQLCA END-EXEC</code><br /> '''Purpose:''' Standard GixSQL communications area. Updated after every SQL statement. </blockquote> {| !width="20%"| Level !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Description |- | 01 | <code>SQLCA</code> | β | β | SQL communications area |- | 05 | <code>SQLCAID</code> | <code>X(8)</code> | DISPLAY | SQLCA identifier string |- | 05 | <code>SQLCABC</code> | <code>S9(9)</code> | COMP-5 | Byte length of SQLCA structure |- | 05 | <code>SQLCODE</code> | <code>S9(9)</code> | COMP-5 | '''SQL return code:''' 0=success Β· negative=error Β· +100=not found |- | 05 | <code>SQLERRM</code> | β | β | Error message group |- | 49 | <code>SQLERRML</code> | <code>S9(4)</code> | COMP-5 | Length of error message text |- | 49 | <code>SQLERRMC</code> | <code>X(70)</code> | DISPLAY | Error message text from the database engine |- | 05 | <code>SQLERRP</code> | <code>X(8)</code> | DISPLAY | Error procedure name (not used in this application) |- | 05 | <code>SQLERRD</code> | <code>S9(9)</code> OCCURS 6 | COMP-5 | Diagnostic array; <code>SQLERRD(3)</code> = number of rows processed |- | 05 | <code>SQLWARN</code> | β | β | Warning flags group (not used in this application) |- | 05 | <code>SQLSTATE</code> | <code>X(5)</code> | DISPLAY | ISO/ANSI SQL state code (5-char string) |} '''SQLCODE reference (PostgreSQL / GixSQL):''' {| ! Value ! Meaning |- | 0 | Statement succeeded |- | +100 | No rows found (SELECT returned empty, cursor exhausted) |- | negative | Database error β see <code>SQLERRMC</code> for description |} ----- <span id="working-storage-variables"></span> == 2. Working-Storage Variables == <span id="primesmain"></span> === 2.1 primesmain === <blockquote>'''Source:''' <code>primesmain.cbl</code> WORKING-STORAGE SECTION<br /> '''Copybooks included:''' <code>primes-session</code> Β· <code>primes-ui</code> </blockquote> {| !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Initial !width="20%"| Description |- | <code>filler</code> | <code>X(32)</code> | DISPLAY | <code>"Start WS primesmain"</code> | Debug marker β locates WS start in memory dumps |- | <code>commandline-args</code> | <code>X(32)</code> | DISPLAY | β | Command-line argument from <code>ACCEPT β¦ FROM COMMAND-LINE</code> |- | <code>execute-generate</code> (88) | β | β | <code>"generate"</code> | True when commandline-args = βgenerateβ |- | <code>execute-report</code> (88) | β | β | <code>"report"</code> | True when commandline-args = βreportβ |- | <code>primes-session</code> | (group) | β | β | COPY primes-session β see [[#11-primes-session|Β§1.1]] |- | <code>primes-ui</code> | (group) | β | β | COPY primes-ui β see [[#13-primes-ui|Β§1.3]] |} ----- <span id="primesgen"></span> === 2.2 primesgen === <blockquote>'''Source:''' <code>primesgen.cbl</code> WORKING-STORAGE SECTION<br /> '''Copybooks included:''' <code>primes-ui</code> (WS) Β· <code>primes-dal</code> (WS) Β· <code>primes-session</code> (LINKAGE) </blockquote> '''Print control group (unused β print handled by primesui):''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Initial !width="25%"| Description |- | <code>file-buffer</code> | <code>X(132)</code> | β | FD record area for fprinter β declared but file never opened here β οΈ |- | <code>print-buffer</code> | <code>X(132)</code> | β | Working print line buffer |- | <code>line-number</code> | <code>99</code> | 99 | Current line within page |- | <code>page-number</code> | <code>9999</code> | 0 | Current page number |} '''Sieve control group (01 <code>primes</code>, local to primesgen):''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Initial !width="25%"| Description |- | <code>gen-methods</code> | <code>X(32)</code> | β | Verb for the local <code>primes</code> group calls to primes.cbl |- | <code>query-process</code> (88) | β | <code>"query"</code> | Internal: query |- | <code>start-process</code> (88) | β | <code>"start"</code> | Internal: start |- | <code>next-divider</code> (88) | β | <code>"get"</code> | Internal: fetch next divider |- | <code>write-prime</code> (88) | β | <code>"put"</code> | Internal: write prime |- | <code>stop-process</code> (88) | β | <code>"stop"</code> | Internal: stop |- | <code>primes-result</code> | <code>9(2)</code> | 0 | Internal result code for local DAL calls |- | <code>init-primes-ok</code> (88) | β | 1 | Initialisation succeeded |- | <code>first-divider-ok</code> (88) | β | 2 | First divisor retrieved |- | <code>next-divider-ok</code> (88) | β | 3 | Next divisor retrieved |- | <code>test-number</code> | <code>9(9)</code> | β | '''Current candidate being tested for primality''' |- | <code>test-number-sqr</code> | <code>9(9)V9(9)</code> | β | Square root of <code>test-number</code> β upper bound for divisors |- | <code>test-divider</code> | <code>9(9)</code> | β | Current trial divisor (prime fetched from DB) |- | <code>test-rest</code> | <code>9(9)V9(9)</code> | β | Remainder: <code>test-number MOD test-divider</code> |- | <code>old-test-number</code> | <code>9(9)</code> | β | Previous candidate β diagnostic use only, not active |- | <code>old-ident</code> | <code>9(9)</code> | β | DB <code>ident</code> of the most recently fetched divisor |- | <code>new-ident</code> | <code>9(9)</code> | β | <code>old-ident + 1</code> β used as key for the next divider SELECT |} '''Other:''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Initial !width="25%"| Description |- | <code>test-quot</code> | <code>9(9)</code> | β | Integer quotient from <code>DIVIDE test-number BY test-divider</code> |} ----- <span id="primes-dal-1"></span> === 2.3 primes (DAL) === <blockquote>'''Source:''' <code>primes.cbl</code> WORKING-STORAGE SECTION<br /> '''Copybooks included:''' <code>primes-ui</code> (WS) Β· <code>SQLCA</code> (via EXEC SQL INCLUDE) Β· <code>primes-table</code> (via EXEC SQL INCLUDE) Β· <code>primes-dal</code> (LINKAGE) </blockquote> '''Database credentials:''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Initial !width="25%"| Description |- | <code>DATASRC</code> | <code>X(64)</code> | <code>"pgsql://localhost:5432/primes&default_schema=primes"</code> | GixSQL connection string β οΈ hard-coded |- | <code>DBUSR</code> | <code>X(64)</code> | <code>"primes_user"</code> | Database user name β οΈ hard-coded |- | <code>DBPWD</code> | <code>X(64)</code> | <code>"pr1mes_user"</code> | Database password β οΈ hard-coded in plain text |- | <code>CUR-STEP</code> | <code>X(16)</code> | β | Diagnostic step label (<code>"CONNECT"</code> / <code>"DISCONNECT"</code>) |} '''Cursor fetch buffer:''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Usage !width="25%"| Description |- | <code>primes-row</code> | (group) | β | Target group for <code>FETCH primescursor INTO :primes-row</code> |- | <code>r-ident</code> | <code>9(9)</code> | COMP-3 | Fetched row identity value |- | <code>r-prime</code> | <code>9(9)</code> | COMP-3 | Fetched prime value |} '''Unused declarations:''' {| ! Name ! PIC ! Note |- | <code>prime-count</code> | <code>9(9)</code> | Declared; not written to in current flow |- | <code>prime_seq</code> | <code>9(9)</code> | Declared; not written to |- | <code>divider</code> | <code>9(9)</code> | Declared; not written to |} '''Local sieve control group (01 <code>primes</code>, mirrors primesgen layout):''' Mirrors the <code>01 primes</code> group in primesgen. Contains <code>test-divider</code>, <code>old-ident</code>, <code>new-ident</code> etc., used internally by <code>r81-get-next-divider</code>. See [[#22-primesgen|Β§2.2]] for field descriptions. ----- <span id="primesui"></span> === 2.4 primesui === <blockquote>'''Source:''' <code>primesui.cbl</code> WORKING-STORAGE SECTION<br /> '''Copybooks included:''' <code>primes-ui</code> (LINKAGE) </blockquote> '''Print row buffer:''' {| !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Initial !width="20%"| Description |- | <code>primes-table</code> (01) | β | β | β | 6-element row accumulator |- | <code>primes-cel</code> | OCCURS 6 INDEXED <code>primes-idx</code> | β | β | One cell = one prime entry in the output line |- | <code>t-ident</code> | <code>Z(9)</code> | DISPLAY | β | Zero-suppressed sequence number for this cell |- | filler | <code>X(2)</code> | DISPLAY | spaces | Column separator |- | <code>t-prime</code> | <code>Z(9)</code> | DISPLAY | β | Zero-suppressed prime value for this cell |- | filler | <code>X(2)</code> | DISPLAY | spaces | Column separator |- | <code>primes-idx</code> | INDEX | β | β | Current cell position (1β6); set by <code>SET primes-idx</code> |} '''Column header:''' {| !width="33%"| Name !width="33%"| PIC !width="33%"| Description |- | <code>table-header</code> (01) | OCCURS 6 | Static header row β <code>"Sequence Prime "</code> repeated 6 times |} '''Print control:''' {| !width="20%"| Name !width="20%"| PIC !width="20%"| Usage !width="20%"| Initial !width="20%"| Description |- | <code>print-buffer</code> | <code>X(132)</code> | DISPLAY | β | Working buffer written to <code>fprinter</code> |- | <code>primes-prt-status</code> | <code>X(2)</code> | DISPLAY | β | File status from last <code>fprinter</code> operation |- | <code>page-number</code> | <code>9(4)</code> | DISPLAY | 1 | Current page number |- | <code>print-new-page</code> | <code>9</code> | DISPLAY | 1 | New-page flag β 1 = heading must be written |- | <code>new-page</code> (88) | β | β | 1 | True when <code>print-new-page = 1</code> |} '''Static strings:''' {| !width="25%"| Name !width="25%"| PIC !width="25%"| Value !width="25%"| Description |- | <code>primes-heading</code> | <code>X(118)</code> | <code>"primes overview"</code> | Left-justified page heading text |- | <code>primes-footing</code> | (group) | β | Page footer group |- | filler | <code>X(118)</code> | SPACE | Left padding of footer |- | filler | <code>X(6)</code> | <code>"page: "</code> | Footer label |- | <code>f-page-number</code> | <code>Z(3)9</code> | 1 | Formatted page number (zero-suppressed 4-digit) |} '''Unused:''' {| ! Name ! PIC ! Note |- | <code>primes-line</code> | <code>X(132)</code> | Declared; not written to in current flow |- | <code>primes-count</code> | <code>9(8)</code> | Declared; not used |} ----- <span id="database-objects"></span> == 3. Database Objects == <span id="schema-primes"></span> === 3.1 Schema <code>primes</code> === {| !width="25%"| Object !width="25%"| Type !width="25%"| Owner !width="25%"| Description |- | <code>primes</code> | SCHEMA | <code>primes_user</code> | Container schema for all application objects |- | <code>asc_ident</code> | SEQUENCE | <code>primes_user</code> | Auto-incrementing identity for <code>primes.ident</code> |- | <code>primes.primes</code> | TABLE | <code>primes_user</code> | The prime numbers store |} ----- <span id="table-primes.primes"></span> === 3.2 Table <code>primes.primes</code> === <blockquote>'''DDL source:''' <code>primes_schema.sql</code> </blockquote> <syntaxhighlight lang="sql">CREATE TABLE primes.primes ( ident integer DEFAULT nextval('primes.asc_ident'::regclass), prime integer );</syntaxhighlight> {| !width="20%"| Column !width="20%"| Data type !width="20%"| Nullable !width="20%"| Default !width="20%"| Description |- | <code>ident</code> | INTEGER | YES | <code>nextval('primes.asc_ident')</code> | Auto-assigned insertion sequence; acts as primary key but has no formal PK constraint |- | <code>prime</code> | INTEGER | YES | β | The prime number value |} <blockquote>β οΈ No PRIMARY KEY, UNIQUE constraint, or index is defined on either column. The <code>ident</code> column is the key used by <code>r81-get-next-divider</code> (<code>SELECT prime WHERE ident = :new-ident</code>). Without an index, this is a sequential scan. See [[Technical-Specification#7-known-technical-issues|Technical Specification β Defect T5]] (performance concern). </blockquote> ----- <span id="sequence-primes.asc_ident"></span> === 3.3 Sequence <code>primes.asc_ident</code> === {| ! Attribute ! Value |- | Data type | INTEGER |- | Start value | 1 |- | Increment | 1 |- | Minimum | 1 (default) |- | Maximum | 2,147,483,647 (INTEGER max) |- | Cache | 1 |- | Cycle | No |} ----- <span id="cursor-primescursor-runtime"></span> === 3.4 Cursor <code>primescursor</code> (runtime) === <blockquote>Declared at compile time in <code>primes.cbl</code>. Opened and used only in the '''report path'''. </blockquote> {| !width="50%"| Attribute !width="50%"| Value |- | Declaration | <code>DECLARE primescursor CURSOR FOR SELECT * FROM primes</code> |- | Connection alias | <code>primes</code> |- | Declared at | Compile time in <code>primes.cbl</code> |- | Transaction | Opened inside <code>START TRANSACTION</code> in <code>s01-cursor</code> |- | Opened at | <code>s01-cursor</code> paragraph (<code>EXEC SQL OPEN primescursor</code>) |- | Fetch target | <code>primes-row</code> group (<code>r-ident</code>, <code>r-prime</code>) β COMP-3 fields |- | Close | Not explicit; closed implicitly when <code>CONNECT RESET primes</code> is issued |} <blockquote>β οΈ <code>SELECT * FROM primes</code> is used. Best practice is to name columns explicitly (<code>SELECT ident, prime FROM primes</code>) to guard against schema changes. The pre-compiler listing (<code>primes_cbsql.out</code>) shows this was expanded from a <code>SELECT ident, prime</code> form in an earlier version. </blockquote> ----- '''β [[Technical-Specification|Technical Specification]]''' | [[Flow-Diagrams|Flow Diagrams β]]
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information