|
Function Description:
Use this function to retrieve the Column count from Database after executing the specified sql query.
How to Define:
initDB("1.1")
result=getDBTableColumnCount("sql query")
Example:
initDB("1.1")
result=getDBTableColumnCount("Select * from LoginTable")
displayMessage(result)
In the above case, the database
will be initialized and the column count
will be taken from the result set obtained by executing the query
given. The column count will be stored in the variable named "result".
Return Values:
String - column count obtained from
executing the sql query.
Function Description:
Use this function to retrieve the Row count from Database after executing the specified sql query
How to Define:
initDB("1.1")
result=getDBTableRowCount("sql query")
Example:
To display the row count of the query result.
initDB("1.1")
result=getDBTableRowCount("Select * from LoginTable")
displayMessage(result)
In the above case, the database will be initialized and the row count will be taken from the result set obtained by executing the query given. The row count will be stored in the variable named "result".
Return Values:
String - row count obtained from executing the sql query.
Function Description:
Use this function to retrieve the value from the specified row and column from Database after executing the specified sql query.
How to Define:
initDB("1.1")
result=getDBValueAt("sql query,rowIndex,columnIndex")
Example:
To display the value at the 1st row, 2nd column value of the query result.
initDB("1.1")
result=getDBValueAt("Select * from LoginTable",1,2)
displayMessage(result)
In the above case, the database
will be initialized and the given query
will be executed to retrieve the value from the given row ,
column index. The value obtained will be stored in the variable named
"result".
Return Values:
String - value obtained from the
row,column index.
Function Description:
Use this function to retrieve the
databse values after executing the specified sql query. The database
values will be stored in the result array.
How to Define:
initDB("1.1")
result=getDBValues("sqlquery")
Example:
To display all the values retrieved by the below query.
initDB("1.1")
result=getDBValues("Select * from LoginTable")
for i in range (0,len (result)):
for j in range (0,len (result[i])):
displayMessage (result[i][j])
Return Values:
Two dimensional String array
containing the retrieved values after executing the sql query.
Function Description:
Use this function to write the values in to database by executing the specified sql query.
How to Define:
initDB("1.1")
result=writeToDB("sql")
Example:
initDB("1.1")
result=writeToDB("Insert into
employee ("emp_id","emp_name","dept") values("emp1","peter",payroll")")
In the
above case, the database will be initialized and the query will be
executed to insert the data in to the database. If insertion is
successful then the "SUCCESS" value will be inserted.
Return Values:
0 for Success
1 for Failure
|