{"id":1111,"date":"2012-11-20T20:37:57","date_gmt":"2012-11-20T20:37:57","guid":{"rendered":"https:\/\/clarionsharp.com\/blog\/?p=1111"},"modified":"2013-07-09T21:54:28","modified_gmt":"2013-07-09T21:54:28","slug":"sqlite-and-the-new-abc-sqlexecutor","status":"publish","type":"post","link":"https:\/\/clarionsharp.com\/blog\/sqlite-and-the-new-abc-sqlexecutor\/","title":{"rendered":"SQLite and the new ABC SQLexecutor"},"content":{"rendered":"<p>Clarion 9 introduces a new driver for working with SQLite databases.\u00a0 SQLite is one of the most widely deployed databases in use today. SQLite databases are widely used on both iOS and Android tablets and cell phones.\u00a0 SQLite databases are useful in any situations where simplicity of administration and easy maintenance are more important than scalability.<\/p>\n<p>The driver introduces a new prop; PROP:CreateDB. PROP:CreateDB is a command property that tells the SQL driver to create the SQLite physical database file that is specified in the OWNER attribute of the file. If the database file already exists, this command does nothing.\u00a0 The existing database file will not be destroyed.<\/p>\n<p>The CREATE statement converts Clarion data types to SQLite Data types using the following table:<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"181\">Clarion Data Type<\/td>\n<td valign=\"top\" width=\"174\">SQLite Data Type<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">STRING<\/td>\n<td valign=\"top\" width=\"174\">CHAR<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">CSTRING<\/td>\n<td valign=\"top\" width=\"174\">VARCHAR<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">STRING(8);GROUP OVER(STRING);DATE;TIME<\/td>\n<td valign=\"top\" width=\"174\">DATETIME<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">DATE<\/td>\n<td valign=\"top\" width=\"174\">DATE<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">PDECIMAL<\/td>\n<td valign=\"top\" width=\"174\">NUMBER<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">DECIMAL<\/td>\n<td valign=\"top\" width=\"174\">NUMBER<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">BYTE<\/td>\n<td valign=\"top\" width=\"174\">TINYINT<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">SHORT<\/td>\n<td valign=\"top\" width=\"174\">SMALLINT<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">LONG<\/td>\n<td valign=\"top\" width=\"174\">INTEGER<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">SREAL<\/td>\n<td valign=\"top\" width=\"174\">FLOAT<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">REAL<\/td>\n<td valign=\"top\" width=\"174\">REAL<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">BLOB<\/td>\n<td valign=\"top\" width=\"174\">CLOB<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"181\">BLOB,BINARY<\/td>\n<td valign=\"top\" width=\"174\">BLOB<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>However Clarion 9 introduces new ABC support so that you can easily deploy and execute SQL scripts. For example a create script like below;<br \/>\nCREATE TABLE Courses(<br \/>\nNumber INTEGER,<br \/>\nDescription CHAR(40),<br \/>\nCompleteDescription CLOB,<br \/>\nCONSTRAINT KeyNumber PRIMARY KEY (Number));<br \/>\nCREATE INDEX KeyDescription ON Courses(Description);<\/p>\n<p>The new class executes SQL code as a series of commands separated by an end of statement marker which you specify.\u00a0 Any errors encountered executing the script are reported using the passed error handler. In short, you provide an external file that contains your SQL script and its parsed and executed.\u00a0 The SQL code isn&#8217;t limited to just Create and Alter database scenarios, you can execute any valid SQL code. And of course the new ABC SQL script support is applicable across any Driver and SQL backend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clarion 9 introduces a new driver for working with SQLite databases.\u00a0 SQLite is one of the most widely deployed databases in use today. SQLite databases are widely used on both iOS and Android tablets and cell phones.\u00a0 SQLite databases are useful in any situations where simplicity of administration and easy maintenance are more important than &hellip; <a href=\"https:\/\/clarionsharp.com\/blog\/sqlite-and-the-new-abc-sqlexecutor\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SQLite and the new ABC SQLexecutor<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,5],"tags":[],"class_list":["post-1111","post","type-post","status-publish","format-standard","hentry","category-clarion9","category-clarionnews"],"_links":{"self":[{"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/posts\/1111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/comments?post=1111"}],"version-history":[{"count":10,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions"}],"predecessor-version":[{"id":1186,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions\/1186"}],"wp:attachment":[{"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/media?parent=1111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/categories?post=1111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/clarionsharp.com\/blog\/wp-json\/wp\/v2\/tags?post=1111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}