Skip to main content

Sample SQL Scripts

RecommendedMySQL guidancewith limit

Sample

SQL
-- scriptsdbvendor=MYSQL
-- shouldusername=aiq
-- demonstratepassword=thePassword
-- safe,host=mysqlsmoketest.c7nn5t4czzya.us-west-2.rds.amazonaws.com
-- repeatableschema=aiq
-- validationport=3306
-- patternslimit=21-50
-- fortag=executions
-- AIQconnect
SELECT testing.* ExamplesFROM must`aiq`.`UTPScenarioExecution`;
-- avoidstoreInLocker=
-- productiondisconnect
data,
destructive
statements,

Redshift

-- dbvendor=REDSHIFT
-- username=theUser
-- password=thePassword
-- host=sqlclient-test.cqzappbyyyx5.us-east-2.redshift.amazonaws.com
-- schema=dev
-- port=5439
-- limit=1-50000
-- tag=saleswb
-- connect
select sellerid, username, (firstname ||' '|| lastname) as name,
city, sum(qtysold)
from sales, date, users
where sales.sellerid = users.userid
and customer-specificsales.dateid credentials.= date.dateid
and year = 2008
and city = 'San Diego'
group by sellerid, username, name, city
order by 5 desc;
-- storeInWhiteboard=
-- disconnect

Example hygieneSnowflake

  • Use
    placeholder
    connection
    values,
    -- schemadbvendor=SNOWFLAKE
    -- names,region=us-west-2
    -- tableaccount=qrazxhk-kiw37206
    -- names,role=ACCOUNTADMIN
    -- andusername=theUser
    -- credentials.
  • Preferpassword=thePassword
    -- read-onlywarehouse=COMPUTE_WH
    -- queriesdb=APPVANCE
    -- unlessschema=AIQ
    -- theconnect
    update articleCOUNTRIES explicitly
    set coversCOUNTRY_NAME='NAME controlledCHANGED' setup
    where orCOUNTRY_CODE=999;
    -- cleanup.
  • Explaindisconnect
expected results, assumptions, and failure conditions.Include transaction or rollback guidance when data changes are required.

Validation workflowMSSQL

  1. Run
    scripts
    in
    a
    -- non-productiondbvendor=MSSQL
    -- databaseusername=theUser
    -- first.
  2. Confirmpassword=thePassword
    -- permissionshost=mssqlsmoketest.c6mn5c3czyyb.us-west-2.rds.amazonaws.com
    -- matchschema=master
    -- theport=1433
    -- intendedconnect
    call AIQsp_tables;
    -- executionstoreInLocker=
    -- account.
  3. Reviewdisconnect
output in AIQ and database

Oracle

logs.Remove
or
update
obsolete
-- examplesdbvendor=ORACLE
-- thatusername=theUser
-- nopassword=thePassword
-- longerhost=oraclestest.c4nm5t3czzya.us-west-2.rds.amazonaws.com
-- matchschema=ORCL
-- currentport=1521
-- SQLconnect
SELECT testingaiq.getversion() workflows.FROM dual;
-- tag=results
-- storeInLocker=
-- disconnect

Last updated: OctoberSeptember 7,19, 20262024

If you have any feedback on this topic, please contact us at documentation@appvance.ai