Reputation: 48
I am trying to automate JSL script and I need to update some records from SQL Server using JMP JSL Script. I have found below connection string, but I am not sure how to use this.
Open Database("DSN=ODBC Databasexxx;UID=xxxx;PWD=xxxxxxx;DBQ=mydatabasexxxx;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;",
Upvotes: 2
Views: 1184
Reputation: 11
I know I am a few years late here, but in case someone finds this down the road, you can also connect directly to a SQL database and skip the ODBC entirely.
dt = Open Database(
"Driver=SQL Server;
Server=__(server address here)__;
DATABASE=__(database name here)__;
Trusted_Connection=Yes;",
"SQL Code",
"Table Name"
);
There are also some additional optional values you can use in the connection string, such as username and password. If you do not specify these, it will use the account information of the PC user.
dt = Open Database(
"Driver=SQL Server;
Server=__(server address here)__;
DATABASE=__(database name here)__;
UID=__(UserID to use for connection)__;
PWD=__(Password to use for connection)__;,
"SQL Code",
"Table Name"
);
Upvotes: 1
Reputation: 344
Setup your ODBC Connection in ODBC Data Source Administrator.
Then you can just simply do this in your script.
dbc = Create database connection("DSN=sqljmp;Server=;UID=;PWD=;Database=;");
result = Execute SQL(dbc,"SELECT * FROM yourTable");
Upvotes: 2