Scripting: Difference between revisions

From Data Islands
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 21: Line 21:
querydb "SELECT NAMECUST,NAMECTAC,TEXTPHON1,TEXTPHON2,EMAIL1,EMAIL2 FROM ARCUS WHERE PRICLIST='WHS'"
querydb "SELECT NAMECUST,NAMECTAC,TEXTPHON1,TEXTPHON2,EMAIL1,EMAIL2 FROM ARCUS WHERE PRICLIST='WHS'"


push arcuslist</blockquote>
push arcuslist</blockquote>dcdc
 
 
USERNAME  = Data Islands acocunt username
USERNAME  = Data Islands acocunt username


Line 35: Line 33:




This creates the region "Sage300Marketing" and an island "arcuslist" with the data from the querydb SQL.
 
This creates the region "Sage300Marketing" (or switches to it if it already exists) and an island "arcuslist" (we delete this and recreate in fact) with the data from the querydb SQL.


This is hosted on the Data Islands cloud.   
This is hosted on the Data Islands cloud.   
Line 55: Line 54:
EG
EG


TSDataIslands.exe "demopush.tsd"
TSDataIslands.exe "c:\myscripts\demopush.tsd"

Latest revision as of 12:21, 21 October 2022

To automate Data Islands flows you can write a script and run this

First we will create a PUSH script.

Here is an example that connects and queries a Sage 300 ERP databse on MSSQL server.

The scenario here is one where you want some customer data (from table ARCUS) to provide to a sales rep. You only want to provide contact information and exclude financial information.

Open notepad and copy the contents below into it (replacing the items in CAPS with your credentials) and save as "demopush.tsd"

connect USERNAME PASSWORD

addserver sql SERVERNAME SQLUSER SQLPASSWORD

usedb saminc

addregion Sage300Marketing

deleteisland arcuslist

querydb "SELECT NAMECUST,NAMECTAC,TEXTPHON1,TEXTPHON2,EMAIL1,EMAIL2 FROM ARCUS WHERE PRICLIST='WHS'"

push arcuslist

dcdc

USERNAME = Data Islands acocunt username

PASSWORD = Data Islands acocunt password

SERVERNAME = Your SQL server name

SQLUSER = Your SQL server user

SQLPASSWORD= Your SQL server password


This creates the region "Sage300Marketing" (or switches to it if it already exists) and an island "arcuslist" (we delete this and recreate in fact) with the data from the querydb SQL.

This is hosted on the Data Islands cloud.

You can test this from within the app also. This is useful when writing. Using the

>script "FILEPATH"

eg

>script "c:\sample\demo\demopush.tsd"

and this will allow you run and test a script.

Next up we want to automate this.

Using windows taskmanager you can run the dataislands app and pass in the "demopush.tsd" as a parameter. The app will then run the script.

EG

TSDataIslands.exe "c:\myscripts\demopush.tsd"