*** Settings ***
Library           ../CodeLibWrapper.py
Library           DatabaseLibrary

*** Keywords ***
KW_Database_ODBC_Select1
    [Arguments]    ${dsn}    ${selectscript}
    [Documentation]    Access database by ODBC in RobotFramework interface.
    DatabaseLibrary.Connect To Database Using Custom Params    pyodbc    ${dsn}
    @{queryresultset}=    query    ${selectscript}
    Disconnect From Database
    Log many    @{queryresultset}
    [Return]    @{queryresultset}    # Result set of query

KW_Database_SQLServer_SelectDataSet
    [Arguments]    ${DATABASE_Name}    ${DATABASE_USER}    ${DATABASE_PASSWORD}    ${DATABASE_IP}    ${DATABASE_PORT}    ${QueryScript}
    [Documentation]    Access SQL Server database and return dataset result by pymssql.
    Connect To Database    pymssql    ${DATABASE_Name}    ${DATABASE_USER}    ${DATABASE_PASSWORD}    ${DATABASE_IP}    ${DATABASE_PORT}
    @{ResultSet}    Query    ${QueryScript}
    Comment    Log many    @{ResultSet}
    Disconnect From Database
    [Return]    @{ResultSet}
