Contributions
Re: Connect to Mysql DB and write query to verify data
hi Alex, Thanks for the reply. Currently I connected db using the below command but i need to get the query result. Please let me know how to overcome this issue. Thanks Error: JavaScript runtime error. Field 'date' not found Error location: Line: 64 Column: 18. -------------------------------------------------------------------------------------------------- function Main() { var Qry; var fieldName = "date"; // Create a query Qry = ADO.CreateADOQuery(); // Specify the connection string Qry.ConnectionString = 'db connection; // Specify the SQL expression Qry.SQL =' select count(distinct store_id) from tb_name where date = "2021-02-16"'; // Execute the query Qry.Open(); // Process results and insert data into the test log Log.AppendFolder("Disbursement"); Qry.First(); //EOF _Returns true if the current record position is after the last record, otherwise while (! Qry.EOF) { // result = (Qry.FieldByName(fieldName).Value); Log.Message(Qry.FieldByName(fieldName).Value); Qry.Next(); }; // Close the query Qry.Close(); };1.6KViews0likes2CommentsConnect to Mysql DB and write query to verify data
Hi, Im looking for a function to connect to MYsql Db and write query to verify data function connDB() { // Create and open a connection to the OrdersDB.mdb database var connection = getActiveXObject("ADODB.Connection"); Connection.connectionString = "Provider=MSDASQL;Driver={MySQL ODBC 8.0 ANSI Driver};[Server="");Database="";User="";password=""Option=3;"; // use above format with your server/db details and assign the string value to this variable connection.Open(); var rs = getActiveXObject("ADODB.Recordset"); rs.Open('select count(distinct STORE_CODE),CLAIM_PAY_DATE from eyos_dwh_uat.aud_campaign_claims where CLAIM_PAY_DATE ="2021-01-16"; ', connection); connection.close; } ReferenceError: Connection is not defined Please let me know if i can do database connection by project variables thanks1.7KViews0likes8Comments