|
1 | 1 | *** Settings *** |
2 | | -Documentation Tests for the parameter _omitTrailingSemicolon_ in the keyword |
3 | | -... _Execute SQL String_ - special for the issue #184: |
4 | | -... https://github.com/MarketSquare/Robotframework-Database-Library/issues/184 |
5 | | -... The _PLSQL BLOCK_ is most likely valid for Oracle DB only. |
| 2 | +Documentation Tests for the parameter _omitTrailingSemicolon_ in the keyword |
| 3 | +... _Execute SQL String_ - special for the issue #184: |
| 4 | +... https://github.com/MarketSquare/Robotframework-Database-Library/issues/184 |
| 5 | +... The _PLSQL BLOCK_ is most likely valid for Oracle DB only. |
6 | 6 |
|
7 | 7 | Resource ../../resources/common.resource |
| 8 | + |
8 | 9 | Suite Setup Connect To DB |
9 | 10 | Suite Teardown Disconnect From Database |
10 | 11 | Test Setup Create Person Table And Insert Data |
11 | 12 | Test Teardown Drop Tables Person And Foobar |
12 | 13 |
|
13 | 14 |
|
14 | 15 | *** Variables *** |
15 | | -${NORMAL QUERY} SELECT * FROM person; |
16 | | -${PLSQL BLOCK} DECLARE ERRCODE NUMBER; ERRMSG VARCHAR2(200); BEGIN DBMS_OUTPUT.PUT_LINE('Hello!'); END; |
| 16 | +${NORMAL QUERY} SELECT * FROM person; |
| 17 | +${PLSQL BLOCK} DECLARE ERRCODE NUMBER; ERRMSG VARCHAR2(200); BEGIN DBMS_OUTPUT.PUT_LINE('Hello!'); END; |
| 18 | + |
| 19 | +${ERROR SIMPLE QUERY} *ORA-03048: SQL reserved word ';' is not syntactically valid following* |
| 20 | +${ERROR PLSQL} *PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following* |
17 | 21 |
|
18 | 22 |
|
19 | 23 | *** Test Cases *** |
20 | | -Explicitely Omit Semicolon |
21 | | - [Documentation] Check if it works for Oracle - explicitely omitting the semicolon |
22 | | - ... is equal to the default behaviour, otherwise oracle_db throws an error |
| 24 | +Explicitely Omit Semicolon - Simple Query |
| 25 | + [Documentation] Check if it works for Oracle - explicitly omitting the semicolon |
| 26 | + ... is equal to the default behavior |
23 | 27 | Execute Sql String ${NORMAL QUERY} omit_trailing_semicolon=True |
24 | 28 |
|
25 | | -Explicitely Dont't Omit Semicolon |
26 | | - [Documentation] Check if it works for Oracle - it throws an error without a semicolon |
| 29 | +Explicitely Don't Omit Semicolon - Simple Query |
| 30 | + [Documentation] Check if Oracle throws an error |
| 31 | +
|
| 32 | + Run Keyword And Expect Error ${ERROR SIMPLE QUERY} |
| 33 | + ... Execute Sql String ${NORMAL QUERY} omit_trailing_semicolon=False |
| 34 | + |
| 35 | +Explicitely Omit Semicolon - PLSQL Block |
| 36 | + [Documentation] Check if Oracle throws an error |
| 37 | + Run Keyword And Expect Error ${ERROR PLSQL} |
| 38 | + ... Execute Sql String ${PLSQL BLOCK} omit_trailing_semicolon=True |
| 39 | + |
| 40 | +Explicitely Don't Omit Semicolon - PLSQL Block |
| 41 | + [Documentation] Should run without errors, because the semicolon is needed |
| 42 | + ... at the end of the PLSQL block even with Oracle |
27 | 43 | Execute Sql String ${PLSQL BLOCK} omit_trailing_semicolon=False |
| 44 | + |
| 45 | +Explicitely Omit Semicolon With Keyword - Simple Query |
| 46 | + [Documentation] Check if it works for Oracle - explicitly omitting the semicolon |
| 47 | + ... is equal to the default behavior |
| 48 | + Set Omit Trailing Semicolon True |
| 49 | + Execute Sql String ${NORMAL QUERY} |
| 50 | + |
| 51 | +Explicitely Don't Omit Semicolon With Keyword - Simple Query |
| 52 | + [Documentation] Check if Oracle throws an error |
| 53 | + Set Omit Trailing Semicolon False |
| 54 | + Run Keyword And Expect Error ${ERROR SIMPLE QUERY} |
| 55 | + ... Execute Sql String ${NORMAL QUERY} |
| 56 | + |
| 57 | +Explicitely Omit Semicolon With Keyword - PLSQL Block |
| 58 | + [Documentation] Check if Oracle throws an error |
| 59 | + Set Omit Trailing Semicolon True |
| 60 | + Run Keyword And Expect Error ${ERROR PLSQL} |
| 61 | + ... Execute Sql String ${PLSQL BLOCK} |
| 62 | + |
| 63 | +Explicitely Don't Omit Semicolon With Keyword - PLSQL Block |
| 64 | + [Documentation] Should run without errors, because the semicolon is needed |
| 65 | + ... at the end of the PLSQL block even with Oracle |
| 66 | + Set Omit Trailing Semicolon False |
| 67 | + Execute Sql String ${PLSQL BLOCK} |
0 commit comments