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
  T
  sqlite> .schema T
  CREATE TABLE T (c1 integer, c2 integer, c3 integer);
  sqlite> .quit

Steve Revilak

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to