@@ -28,8 +28,7 @@ def query(
2828 self , selectStatement : str , sansTran : bool = False , returnAsDict : bool = False , alias : Optional [str ] = None , parameters : Optional [List ] = None
2929 ):
3030 """
31- Uses the input ``selectStatement`` to query for the values that will be returned as a list of tuples. Set
32- optional input ``sansTran`` to True to run command without an explicit transaction commit or rollback.
31+ Uses the input ``selectStatement`` to query for the values that will be returned as a list of tuples.
3332 Set optional input ``returnAsDict`` to True to return values as a list of dictionaries.
3433
3534 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
@@ -61,7 +60,12 @@ def query(
6160 And get the following
6261 See, Franz Allan
6362
64- Using optional ``sansTran`` to run command without an explicit transaction commit or rollback:
63+ Use optional ``parameters`` for query variable substitution (variable substitution syntax may be different
64+ depending on the database client):
65+ | parameters | Create List | person |
66+ | Query | SELECT * FROM %s | parameters=${parameters} |
67+
68+ Use optional ``sansTran`` to run command without an explicit transaction commit or rollback:
6569 | @{queryResults} | Query | SELECT * FROM person | True |
6670 """
6771 db_connection = self .connection_store .get_connection (alias )
@@ -81,8 +85,7 @@ def query(
8185
8286 def row_count (self , selectStatement : str , sansTran : bool = False , alias : Optional [str ] = None , parameters : Optional [List ] = None ):
8387 """
84- Uses the input ``selectStatement`` to query the database and returns the number of rows from the query. Set
85- optional input ``sansTran`` to True to run command without an explicit transaction commit or rollback.
88+ Uses the input ``selectStatement`` to query the database and returns the number of rows from the query.
8689
8790 For example, given we have a table `person` with the following data:
8891 | id | first_name | last_name |
@@ -107,7 +110,12 @@ def row_count(self, selectStatement: str, sansTran: bool = False, alias: Optiona
107110 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
108111 than one connection open.
109112
110- Using optional ``sansTran`` to run command without an explicit transaction commit or rollback:
113+ Use optional ``parameters`` for query variable substitution (variable substitution syntax may be different
114+ depending on the database client):
115+ | parameters | Create List | person |
116+ | ${rowCount} | Row Count | SELECT * FROM %s | parameters=${parameters} |
117+
118+ Use optional ``sansTran`` to run command without an explicit transaction commit or rollback:
111119 | ${rowCount} | Row Count | SELECT * FROM person | True |
112120 """
113121 db_connection = self .connection_store .get_connection (alias )
@@ -126,8 +134,7 @@ def row_count(self, selectStatement: str, sansTran: bool = False, alias: Optiona
126134
127135 def description (self , selectStatement : str , sansTran : bool = False , alias : Optional [str ] = None , parameters : Optional [List ] = None ):
128136 """
129- Uses the input ``selectStatement`` to query a table in the db which will be used to determine the description. Set
130- optional input ``sansTran` to True to run command without an explicit transaction commit or rollback.
137+ Uses the input ``selectStatement`` to query a table in the db which will be used to determine the description.
131138
132139 For example, given we have a table `person` with the following data:
133140 | id | first_name | last_name |
@@ -146,6 +153,11 @@ def description(self, selectStatement: str, sansTran: bool = False, alias: Optio
146153 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
147154 than one connection open.
148155
156+ Use optional ``parameters`` for query variable substitution (variable substitution syntax may be different
157+ depending on the database client):
158+ | parameters | Create List | person |
159+ | ${desc} | Description | SELECT * FROM %s | parameters=${parameters} |
160+
149161 Using optional `sansTran` to run command without an explicit transaction commit or rollback:
150162 | @{queryResults} | Description | SELECT * FROM person | True |
151163 """
@@ -166,8 +178,7 @@ def description(self, selectStatement: str, sansTran: bool = False, alias: Optio
166178
167179 def delete_all_rows_from_table (self , tableName : str , sansTran : bool = False , alias : Optional [str ] = None ):
168180 """
169- Delete all the rows within a given table. Set optional input `sansTran` to True to run command without an
170- explicit transaction commit or rollback.
181+ Delete all the rows within a given table.
171182
172183 For example, given we have a table `person` in a database
173184
@@ -184,7 +195,7 @@ def delete_all_rows_from_table(self, tableName: str, sansTran: bool = False, ali
184195 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
185196 than one connection open.
186197
187- Using optional `sansTran` to run command without an explicit transaction commit or rollback:
198+ Use optional `sansTran` to run command without an explicit transaction commit or rollback:
188199 | Delete All Rows From Table | person | True |
189200 """
190201 db_connection = self .connection_store .get_connection (alias )
@@ -207,8 +218,7 @@ def delete_all_rows_from_table(self, tableName: str, sansTran: bool = False, ali
207218 def execute_sql_script (self , sqlScriptFileName : str , sansTran : bool = False , alias : Optional [str ] = None ):
208219 """
209220 Executes the content of the `sqlScriptFileName` as SQL commands. Useful for setting the database to a known
210- state before running your tests, or clearing out your test data after running each a test. Set optional input
211- `sansTran` to True to run command without an explicit transaction commit or rollback.
221+ state before running your tests, or clearing out your test data after running each a test.
212222
213223 Sample usage :
214224 | Execute Sql Script | ${EXECDIR}${/}resources${/}DDL-setup.sql |
@@ -262,7 +272,7 @@ def execute_sql_script(self, sqlScriptFileName: str, sansTran: bool = False, ali
262272 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
263273 than one connection open.
264274
265- Using optional `sansTran` to run command without an explicit transaction commit or rollback:
275+ Use optional `sansTran` to run command without an explicit transaction commit or rollback:
266276 | Execute Sql Script | ${EXECDIR}${/}resources${/}DDL-setup.sql | True |
267277 """
268278 db_connection = self .connection_store .get_connection (alias )
@@ -333,8 +343,7 @@ def execute_sql_script(self, sqlScriptFileName: str, sansTran: bool = False, ali
333343
334344 def execute_sql_string (self , sqlString : str , sansTran : bool = False , alias : Optional [str ] = None , parameters : Optional [List ] = None ):
335345 """
336- Executes the sqlString as SQL commands. Useful to pass arguments to your sql. Set optional input `sansTran` to
337- True to run command without an explicit transaction commit or rollback.
346+ Executes the sqlString as SQL commands. Useful to pass arguments to your sql.
338347
339348 SQL commands are expected to be delimited by a semicolon (';').
340349
@@ -348,7 +357,12 @@ def execute_sql_string(self, sqlString: str, sansTran: bool = False, alias: Opti
348357 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
349358 than one connection open.
350359
351- Using optional `sansTran` to run command without an explicit transaction commit or rollback:
360+ Use optional ``parameters`` for query variable substitution (variable substitution syntax may be different
361+ depending on the database client):
362+ | parameters | Create List | person_employee_table |
363+ | Execute Sql String | SELECT * FROM %s | parameters=${parameters} |
364+
365+ Use optional `sansTran` to run command without an explicit transaction commit or rollback:
352366 | Execute Sql String | DELETE FROM person_employee_table; DELETE FROM person_table | True |
353367 """
354368 db_connection = self .connection_store .get_connection (alias )
@@ -381,8 +395,6 @@ def call_stored_procedure(
381395 It also depends on the database, how the procedure returns the values - as params or as result sets.
382396 E.g. calling a procedure in *PostgreSQL* returns even a single value of an OUT param as a result set.
383397
384- Set optional input `sansTran` to True to run command without an explicit transaction commit or rollback.
385-
386398 Simple example:
387399 | @{Params} = | Create List | Jerry | out_second_name |
388400 | @{Param values} @{Result sets} = | Call Stored Procedure | Get_second_name | ${Params} |
@@ -404,7 +416,7 @@ def call_stored_procedure(
404416 Use optional ``alias`` parameter to specify what connection should be used for the query if you have more
405417 than one connection open.
406418
407- Using optional `sansTran` to run command without an explicit transaction commit or rollback:
419+ Use optional `sansTran` to run command without an explicit transaction commit or rollback:
408420 | @{Param values} @{Result sets} = | Call Stored Procedure | DBName.SchemaName.StoredProcName | ${Params} | True |
409421 """
410422 db_connection = self .connection_store .get_connection (alias )
0 commit comments