<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://gretlwiki.econ.univpm.it/index.php?action=history&amp;feed=atom&amp;title=SQLite</id>
	<title>SQLite - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://gretlwiki.econ.univpm.it/index.php?action=history&amp;feed=atom&amp;title=SQLite"/>
	<link rel="alternate" type="text/html" href="https://gretlwiki.econ.univpm.it/index.php?title=SQLite&amp;action=history"/>
	<updated>2026-05-20T14:04:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.7</generator>
	<entry>
		<id>https://gretlwiki.econ.univpm.it/index.php?title=SQLite&amp;diff=117&amp;oldid=prev</id>
		<title>DeFeroci: fixed environment variable</title>
		<link rel="alternate" type="text/html" href="https://gretlwiki.econ.univpm.it/index.php?title=SQLite&amp;diff=117&amp;oldid=prev"/>
		<updated>2024-08-10T00:38:15Z</updated>

		<summary type="html">&lt;p&gt;fixed environment variable&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:38, 10 August 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot;&gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As a final step, you need to create an environment variable that points to the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.ini file&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As a final step, you need to create an environment variable that points to the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;/etc&amp;lt;/code&amp;gt; folder&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the example, a global environment variable is created by adding a line to the &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; file.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the example, a global environment variable is created by adding a line to the &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DeFeroci</name></author>
	</entry>
	<entry>
		<id>https://gretlwiki.econ.univpm.it/index.php?title=SQLite&amp;diff=116&amp;oldid=prev</id>
		<title>DeFeroci: Page created</title>
		<link rel="alternate" type="text/html" href="https://gretlwiki.econ.univpm.it/index.php?title=SQLite&amp;diff=116&amp;oldid=prev"/>
		<updated>2024-08-10T00:36:01Z</updated>

		<summary type="html">&lt;p&gt;Page created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://www.sqlite.org/ SQLite] is a lightweight, serverless database engine often used for small-scale applications and embedded systems.&lt;br /&gt;
==Setup==&lt;br /&gt;
===GNU/Linux===&lt;br /&gt;
To connect to the database Gretl uses the [https://en.wikipedia.org/wiki/Open_Database_Connectivity ODBC] driver . The process for setting it up is described by Andrew B. Collier in an [https://datawookie.dev/blog/2015/09/setting-up-odbc-for-sqlite-on-ubuntu/ article on his blog]. The article describes how to set it up on a computer running Ubuntu but it also works for other distributions.&lt;br /&gt;
&lt;br /&gt;
====Packages download====&lt;br /&gt;
You need to download and install the [https://www.unixodbc.org/odbcinst.html unixODBC] and [http://ch-werner.de/sqliteodbc/html/index.html SQLiteODBC] packages depending on the distribution you use.&lt;br /&gt;
&lt;br /&gt;
====Setup files====&lt;br /&gt;
If it is not already present you need to create an odbcinst.ini file in the &amp;lt;code&amp;gt;/etc&amp;lt;/code&amp;gt; folder as shown below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; /etc/odbcinst.ini file content&lt;br /&gt;
&lt;br /&gt;
[SQLite]&lt;br /&gt;
Description=SQLite ODBC Driver&lt;br /&gt;
Driver=libsqliteodbc.so&lt;br /&gt;
Setup=libsqliteodbc.so&lt;br /&gt;
UsageCount=1&lt;br /&gt;
&lt;br /&gt;
[SQLite3]&lt;br /&gt;
Description=SQLite3 ODBC Driver&lt;br /&gt;
Driver=libsqlite3odbc.so&lt;br /&gt;
Setup=libsqlite3odbc.so&lt;br /&gt;
UsageCount=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and an &amp;lt;code&amp;gt;.odbc.ini&amp;lt;/code&amp;gt; file in the home directory that specifies the name and path to the database file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ~/.odbc.ini file content&lt;br /&gt;
&lt;br /&gt;
[databaseFileName]&lt;br /&gt;
Description = Database description&lt;br /&gt;
Driver = SQLite3&lt;br /&gt;
Database = /path/to/database/file&lt;br /&gt;
Timeout = 2000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a final step, you need to create an environment variable that points to the .ini file.&lt;br /&gt;
In the example, a global environment variable is created by adding a line to the &amp;lt;code&amp;gt;/etc/environment&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# Content of /etc/environment&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
ODBCSYSINI=/etc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Connecting via Gretl====&lt;br /&gt;
Once everything is set up to create a connection via Gretl and be able to retrieve data, simply use the &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; command with the &amp;lt;code&amp;gt;--odbc&amp;lt;/code&amp;gt; flag specifying the database name given in the &amp;lt;code&amp;gt;.odbc.ini&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
open dsn=databaseFileName --odbc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you can use the &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; commands as specified in the command reference.&lt;/div&gt;</summary>
		<author><name>DeFeroci</name></author>
	</entry>
</feed>