Skip to content

Commit 915f7b9

Browse files
committed
Misc doc updates
1 parent 552227d commit 915f7b9

File tree

7 files changed

+34
-21
lines changed

7 files changed

+34
-21
lines changed

docs/INTRODUCTION.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,19 @@ $include:"rwltest.rwl"
4141
# Declare some variables, and possibly initialize them
4242
integer empno, deptno:=10, numemps:=0; $useroption:deptno
4343
string ename, dname;
44-
double monthsal;
44+
double monthsal, comm;
4545
4646
for # execute a cursor loop
47-
select e.ename, d.dname, e.sal/12 monthsal
47+
select -- names in select list match variables
48+
e.ename, d.dname
49+
, e.sal/12 monthsal, comm
4850
from emp e join dept d
4951
on e.deptno = d.deptno
50-
where d.deptno = :deptno
52+
where d.deptno = :deptno -- bind matches variable
5153
/
52-
loop # Execute a cursor loop
53-
printf "%s works in %s and makes %.2f monthly\n", ename, dname, monthsal;
54+
loop
55+
printf "%-10s works in %10s and makes %6.2f monthly plus %t5.0f annual commission\n"
56+
, ename, dname, monthsal, "no", comm;
5457
numemps += 1; # count the number of rows
5558
end loop;
5659

docs/NEWS30.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ In previous versions, it was necessary to have two rwl statements
8282
associated with each sql; the first would declare the sql as
8383
a variable, and the second would execute this variable as is
8484
(for e.g. DML, PL/SQL or single row queries) or as a cursor
85-
loops for queries with an unknown number of rows.
85+
loop for queries with an unknown number of rows.
8686
In version 3, you can now combine these into one for immediate
8787
execution.
8888

@@ -128,7 +128,7 @@ end loop;
128128
To prevent having passwords in clear text in either .rwl files or on the command line
129129
(from where rwloadsim does overwrite the memory), you can now use external authentication
130130
via wallets.
131-
This is achieved by declaraing a database with a connect string that matches a name in the wallet
131+
This is achieved by declaring a database with a connect string that matches a name in the wallet
132132
but neither the username nor password attributes,
133133
or alternatively by giving empty username and password using /@name to the -l option
134134
similar to how SQL*Plus does it.

docs/PRINTF.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
The printline and associated statements are useful to provide
33
simple output with default formatting, that can be generally
44
modified using the $dformat or $iformat directives for
5-
respectivele double and integer.
5+
respectively double and integer.
66

77
For more advanced output, you can use the fprintf statement
88
or the sprintf statement to output to a string.
@@ -17,11 +17,13 @@ but using a syntax that include ||, the formatted output
1717
will append to the string.
1818

1919
All statements work like their C equivalents but do additionally have
20-
a flag 'z', 'b', 'n' or 'N' that control how a NULL integer or double
20+
a flag 'z', 'b', 'n', 'N' or 't' that control how a NULL integer or double
2121
value is formatted.
2222
By default, if an integer or double is NULL, an empty string will be output.
2323
Using the 'z' flag, a NULL will be output as zero, using 'b' blanks will be
2424
used and using 'n' or 'N', the text null or NULL will be used.
25+
Using 't', the subsitution text will be taken from an argument to the printf
26+
statement.
2527

2628
Some examples are shown here
2729
```
@@ -32,6 +34,7 @@ string s := "fourtytwo";
3234
# Show 0-padding and output of null
3335
printf ">%07d|%d<\n", a, b;
3436
printf ">%07d|%nd<\n", a, b;
37+
printf "%td\n", "no value", b;
3538
3639
b:=4;
3740
# Show how field width and precision
@@ -48,6 +51,7 @@ which will generate this output:
4851
```
4952
>0000042|<
5053
>0000042|null<
54+
no value
5155
>12.3457 <
5256
fourtytwo=42 |
5357
```

docs/SQL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ to modify any of its attributes, you can use a syntax that immediately executes
239239
your sql statement.
240240
The syntax combines the declaration - although with the keyword ```execute```
241241
in stead of a name - with the execution as shown in the following examples.
242-
Note that implicit bind and define is automatically enabled for immediate SQL.
242+
Note that implicit bind and define is automatically enabled for immediate SQL, so
243+
the $implicit directive is not required.
243244

244245
Effectively, immediated SQL has most of the simplicity of embedded SQL without
245-
having the constriants such as lack of output bind.
246+
having the constraints such as lack of output bind.
246247

247248
Immediately execute an insert with a returning clause
248249
```
@@ -302,7 +303,7 @@ it _will_ be treated as a dynamic SQL and will also have the implicit bind and
302303
define done.
303304
Doing so implies array dml cannot be used, as the sql statement potentially could
304305
changed for each execution inside a loop.
305-
If you need dynmically generated dml to use an array, use declared dynamic SQL.
306+
If you need dynamically generated dml to use an array, use declared dynamic SQL.
306307

307308
Declaration and use of dynamic SQL variables, where the sql text and possibly
308309
bind/define are done at runtime is described in [DYNAMICSQL.md](DYNAMICSQL.md).

docs/WORKING.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ interface and is primarily targeted at scripting environments, where
77
sqlplus together with things like shell, sed, awk and other Unix tools
88
doesn't allow sufficient control of how to execute SQL statements or a
99
mix of concurrently executing SQL statements.
10-
Rwloadsim has several ways to specify random values for SQL or PL/SQL
10+
11+
As a simulation tool, rwloadsim has several ways to specify random
12+
values for SQL or PL/SQL
1113
with bind variables, and it can control things like frequency of
1214
execution, mix of "transactions", several connection mechanisms
1315
including session pooling, while it also may gather run-time execution
@@ -17,6 +19,13 @@ schema to allow for reporting.
1719
The rwloadsim language is also sufficient to allow automatic generation
1820
of awr reports.
1921

22+
In addition to actual workload simulations, rwloadsim is a relatively
23+
powerful scripting tool.
24+
One example of such usage is that database administrators easily can
25+
create scripts, which combine execution of SQL with procedural logic.
26+
If you only use it for its scripting capabilities, there is no need for
27+
the repository database that stores execution statistics.
28+
2029
Some of the rwloadsim behavior is controlled via options to the
2130
executable, and the actual RWL program is specified in text files that
2231
are read by rwloadsim; several options can be set globally using
@@ -33,11 +42,6 @@ It is also possible to include rwl files within others similar to using
3342
the @ clause in SQL\*Plus or #include in C,
3443
and you can conditionally include code similar to #if in C.
3544

36-
In addition to actual workload simulations, rwloadsim is a relatively
37-
powerful scripting tool.
38-
If you only use it for its scripting capabilities, there is no need for
39-
the repository database, that stores execution statistics.
40-
4145
### Manual pages
4246

4347
Your distribution includes reference documentation in the form of manual

docs/refman/printfstatement.html

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/man1rwl/printfstatement.1rwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ text null or the user provided text "nothing":
8686
.P
8787
.nf
8888
integer a;
89-
printf "|%Nd|%td|\n", a, "nothing", a;
89+
printf "|%Nd|%td|\\n", a, "nothing", a;
9090
.fi
9191
.P
9292
which will produce the following output:

0 commit comments

Comments
 (0)