Editing
Primes Software Specification
(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!
=== 2.2 Paragraph Specifications === ==== r80-get-next-prime ==== <pre>PERFORM s02-fetch</pre> ==== r81-get-next-divider ==== <pre>new-ident = old-ident + 1 SQL: SELECT prime FROM primes WHERE ident = :new-ident INTO :test-divider IF SQLCODE = 0 (test-divider now holds the next divisor prime) ELSE DISPLAY SQLCODE to console DISPLAY "select new-divider nok" to console old-ident = new-ident</pre> ==== r83-write-prime ==== <pre>SQL: INSERT INTO primes (prime) VALUES (:prime) IF SQLCODE != 0 DISPLAY SQLCODE to console DISPLAY "insert next prime nok" + prime-number to console</pre> <span id="r90-generate-primes-first-run-initialisation-not-via-dal-dispatch"></span> ==== r90-generate-primes ''(first-run initialisation, not via DAL dispatch)'' ==== <pre>PERFORM s00-connect IF dal-method-ok SQL: INSERT INTO primes (prime) VALUES (2) -- seed record IF SQLCODE = 0 primes-sequence = 1 prime-number = 2 dal-result = 0 LOG "Initial insert ok." ELSE LOG "Initial insert failed, terminating." dal-result = 1 CALL primesui (log-message)</pre> ==== s00-connect ==== <pre>SQL: CONNECT TO :DATASRC AS primes USER :DBUSR USING :DBPWD IF SQLCODE = 0 dal-result = 0 LOG "Database initialisation ok." ELSE LOG "Database initialisation failed, terminating." dal-result = 1 CALL primesui</pre> ==== s01-cursor ==== <pre>SQL: START TRANSACTION IF SQLCODE = 0 LOG "Start transaction ok." ELSE LOG "Start transaction nok." dal-result = 1 CALL primesui IF dal-method-ok OPEN CURSOR primescursor (SELECT * FROM primes) IF SQLCODE = 0 LOG "Start primescursor ok." ELSE LOG "Start primescursor nok." dal-result = 1 CALL primesui</pre> ==== s02-fetch ==== <pre>SQL: FETCH primescursor INTO :r-ident, :r-prime IF SQLCODE = 0 primes-sequence = r-ident prime-number = r-prime dal-result = 0 ELSE LOG "Fetch row nok." dal-result = 1 CALL primesui</pre> ==== s99-disconnect ==== <pre>SQL: CONNECT RESET primes IF SQLCODE = 0 dal-result = 0 LOG "Close database ok." ELSE LOG "Database initialisation failed, ending." dal-result = 1 CALL primesui DISPLAY "s99 disconnect from database" to console DISPLAY SQLCODE to console</pre> ----- <span id="data-dictionary"></span>
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