Load SQLite


This procedure uses the SQLite "copy" command available in version 2.0 of SQLite. This loads data from an external file into a table.

Before the auditor can use SQLite to analyze a population of data or other transactions, that data must be loaded into an SQLite database. This enables the internal auditor to easily load data which is stored in a tab separated format into an existing SQLite database.

Example screenshot:

View Examples of SQLite SQL as used to load National Drug Code data.

Syntax

/* load data into SQLite */

proc sql data=DATAFILE db=DBTYPE;
connect CONNECT;
table TABLENAME;

Parameters Used

There are four primary parameters for the load data statement:
DATAFILE - the datafile to be loaded
DBTYPE - type of database, always 'sqlite'
CONNECT - name of the file containing the SQLite database
TABLENAME - name of the table to be loaded with data

Example Script

*
* sqliteload.ezs
* sqlite load function
* load SQLite table from data;
*;
libname drug 'c:\test\model';
proc sql data=drug.h2 db=sqlite table=routes;
connect 'C:\test\ccode\cLoadSQLite\test.db';

 

This procedure is part of EZ-R Stats for Windows. View an overview of EZ-R Stats for Windows.

Analysts may also be interested in Proc Means and Proc Univariate, which are also available at no charge. A description of audit uses for SQLite is available for download. Further examples of SQL are available for the National Drug Codes.
 
 

Web Page last updated on 08-29-2006
© EZ-R Stats, LLC 2005-2007

© EZ_R Stats

Visit EZ_R Stats on the web at:

www.ezrstats.com