SQL Queries Using OptoDataLink


#1

Can I query a SQL database using OptoScript and the ODL? I want the capabilities of a relational database for my project which is why I’m asking. I want to be able to query the database using SQL, get the data back, and read it into a table.

Thanks,

Dave


#2

Dave, Do you have PAC Project Pro or OptoDataLink installed on your PC?
If so, check out document 1705 (OptoDataLink User Guide).
You will find a lot of help there.


#3

I do, and I have looked over the ODL User Guide. It tells me all about manually connecting to the database but my question is can I send SQL queries using OptoScript either in MySQL or SQL Server.

Thanks,

Dave


#4

Wouldn’t that be a good use of the Restful API? The database connection gives you a spot for the query


#5

Thanks for pointing me to the REST interface. I think it will do exactly what I needed.

Dave


#6

So I’ve spent some time looking over the site and I can’t find any reference to accessing a SQL database. When I say that, I mean I want to execute a simple SQL query like “SELECT * FROM PARTS_TBL” from within a strategy. I found a couple of tech notes, one for Excel and one for MS Access but not for MySQL or SQL Server. I looked at the REST API docs and there’s no mention there either.

Is this documented somewhere and can someone point me to it?

Thanks,

Dave