Zeal Posted June 13, 2020 Share Posted June 13, 2020 I have a database and i am able to read write the data in tables of database. Now i want all tables name in DAQFactory. so, how to get table name in String Channel using sql query? Following query i try but not work qr = db.Query(dbase,"SELECT name FROM sys.Tables") Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 15, 2020 Share Posted June 15, 2020 That is going to depend on the database you are using, not DAQFactory. Test your select statement in your databases user interface / command line tool first to make sure it works, then try it in DAQFactory. Also, I recommend using db.queryToClass() instead of db.Query(). Quote Link to comment Share on other sites More sharing options...
Zeal Posted January 9 Author Share Posted January 9 Thank you for the response, but I would like know the difference between both the query. And what exactly is the usage of db.queryToclass(). Also can I know the status of database(like open,close). Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 10 Share Posted January 10 A regular query() returns a record set that you then need to traverse to read each record. Because DAQFactory is an interpreted language this is quite slow, so we came up with QueryToClass(). This function instead returns an object with member variable arrays for each of the fields across all records. This is much, much faster. In addition, two member variables, classNames, and recordCount are returned. The details of this function are described in section 9.5 of the user's guide. With the new QueryToClass() there really are only a few use cases where the regular Query() should be used, usually ones that involve aggregate functions. You can telll if open() worked by whether you get 0 for a handle (failed) or another number. Once it is open you can't tell except that your database commands will throw an error, which you can then catch. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.