[R] SQL Primer for R

Steve Revilak steve at srevilak.net
Mon Sep 1 14:56:37 CEST 2008

> Date: Sun, 31 Aug 2008 21:29:38 -0400
> From: "ivo welch"
> Subject: Re: [R] SQL Primer for R

> stumped again by SQL...  If I have a table named "main" in an SQLite
> data base, how do I get the names of all its columns?  (I have a mysql
> book that claims the SHOW command does this sort of thing, but it does
> not seem to work on SQLite.)

It sounds like SQLite's ".schema" command might be you're looking for.
Here's an example:

   $ sqlite3 foo.db
   SQLite version 3.5.4
   Enter ".help" for instructions
   sqlite> create table T (c1 integer, c2 integer, c3 integer);
   sqlite> .tables
   sqlite> .schema T
   CREATE TABLE T (c1 integer, c2 integer, c3 integer);
   sqlite> .quit

Steve Revilak

More information about the R-help mailing list