stanf 43 Posted October 24, 2018 Report Share Posted October 24, 2018 Can someone tell me how to set up an SQLite database?I have the paid pluginI create the database “ I can see the file”The next command is add table to database .Nothing happened , the file size is 0.What steps am I missing? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 25, 2018 Report Share Posted October 25, 2018 I highly recommend you download and use this to help you with building queries and tables - you can build a table in there and just copy the code like I did then you can test your queries or execute them in there and copy them out: https://sqlitebrowser.org/ Here's an example: set(#db,"{$special folder("Desktop")}\\testdb.sqlite","Global") plugin command("SQLlite.dll", "SQLite Create Database", #db) plugin command("SQLlite.dll", "SQLite Query", #db, "CREATE TABLE `People` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT, `Age` INTEGER );") plugin command("SQLlite.dll", "SQLite Query", #db, "insert into People (\'Name\', \'Age\') values (\'Jane\', 20)") alert($plugin function("SQLlite.dll", "$sqlite data reader", #db, "select Age from People where Name=\'Jane\'")) 1 Quote Link to post Share on other sites
stanf 43 Posted October 25, 2018 Author Report Share Posted October 25, 2018 thanks nick, i didn't realize i actually had to build columns and headers Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 25, 2018 Report Share Posted October 25, 2018 thanks nick, i didn't realize i actually had to build columns and headers The other option is you create the db and table in the DB Browser program and then just call the from Ubot. This is fine if you use it yourself but if you plan to distribute the program I always do a check for the DB and if it doesn't exist I create it from Ubot and that means making the tables in Ubot as well. But I always build my tables originally in the DB Browser and keep a separate copy of the db for testing in DB Browser to make sure all my queries work. Quote Link to post Share on other sites
johnwalton 12 Posted October 25, 2018 Report Share Posted October 25, 2018 Didn't know any SQL but learned on w3 for a week and now can make complex RDBs. Highly suggest W3 and also mapping out the tables in lucidchart to visually see what you're doing. Quote Link to post Share on other sites
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.