You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.MD
+80-20Lines changed: 80 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,12 @@
1
1
# SQL-dumper
2
2
3
-
Command line tool, that dumps the result of SQL to an CSV on the filesystem. Queries can be using "extended SQL"
4
-
split into subqueries, reducing the complexity on the server side.
3
+
Command line tool, that dumps the result of SQL to an CSV on the filesystem.
4
+
Queries can be using "extended SQL" split into subqueries, reducing the complexity
5
+
on the server side.
5
6
6
-
**Installation**:
7
+
If you want to contribute, please see the [contribution guidelines](#contributing).
8
+
9
+
**Installation**:
7
10
8
11
Download [Oracle JDBC Driver 12c](http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html) (tested with this version.) and put sql-dumper.jar and ojdbc7.jar in one folder. Note that the ojdbc7.jar file can not be gathered by maven, it has to be added manually to the project. To do so in IntelliJ IDEA, press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>, go to "Libraries", and select the file from your local disc.
9
12
@@ -22,10 +25,10 @@ with the arguments being:
22
25
The outputted CSV files will be saved to a sub directory of `outpath` following the convention `YYYY_MM_DD\` and be
23
26
named after the SQL script file in the input directory (`myScript.SQL` will lead to a resultfile named `myScript.CSV`).
24
27
25
-
## extended SQL
28
+
## Extended SQL
26
29
27
-
The following "extended SQL" commands are supported. Since being hidden as a comment (indicated by `--`, which is mandatory),
28
-
the SQL files are still executable by every other SQL Tool (like the Oracle SQL Developer). Extended SQL is likely used
30
+
The following "extended SQL" commands are supported. Since being hidden as a comment (indicated by `--`, which is mandatory),
31
+
the SQL files are still executable by every other SQL Tool (like the Oracle SQL Developer). Extended SQL is likely used
29
32
in the `WHERE` clause of your SQL script.
30
33
31
34
All subquery results will be concatenated into a single, output CSV file.
@@ -38,10 +41,10 @@ Inserts the given text. This is necessary because extended SQL is hidden in comm
38
41
39
42
#### Example
40
43
41
-
The following code
44
+
The following code
42
45
43
46
-- $ESQL_text("WHERE mw.WERT_CODE = 123")
44
-
47
+
45
48
Will simply output the text `"WHERE mw.WERT_CODE = 123` to sql query.
46
49
47
50
### Generate subqueries by an array of strings (`$ESQL_textArray`)
@@ -54,7 +57,7 @@ queried at a time can be set explicitly.
54
57
The following code
55
58
56
59
-- $ESQL_text("AND MY_COL IN ") $ESQL_textArray(2, "VALA", "VALB", "VALC", "VALD")
57
-
60
+
58
61
Will result in two subqueries, with the first one having `AND MY_COL IN ('VALA', 'VALB')`.
59
62
60
63
@@ -67,8 +70,8 @@ Generates a subquery for the given numbers. Encapsulates multiple numbers into o
67
70
The following code
68
71
69
72
-- $ESQL_text("AND MY_COL IN ") $ESQL_numArray(2, 117, 118, 119)
70
-
71
-
Will generate two subqueries from the given SQL file. The first one will contain `AND MY_COL IN (2, 117)` and the second
73
+
74
+
Will generate two subqueries from the given SQL file. The first one will contain `AND MY_COL IN (2, 117)` and the second
72
75
one `AND MY_COL IN (118, 119)`.
73
76
74
77
### Generate subquery for every number in range (`$ESQL_spreadNum`)
@@ -80,7 +83,7 @@ Generates a subquery for every number in the given range.
0 commit comments