Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: odbc insert issues


From   Steve Cicala <[email protected]>
To   [email protected]
Subject   st: odbc insert issues
Date   Wed, 16 Mar 2011 12:12:11 -0400

Hi All--I am trying to export a few variables from a stata dataset to
.dbf via odbc insert, but am having trouble.

First, querying and loading .dbf's does not appear to be a problem:

. odbc query "frs"

DataSource: frs
Path      : C:\ARCGIS\EPA\FRS
-------------------------------------------------------------------------------
GEODATA_Shape_FEB2011
test
-------------------------------------------------------------------------------

. odbc desc "test"

DataSource: frs (query)
Table:      test (load)
-------------------------------------------------------------------------------
Variable Name                               Variable Type
-------------------------------------------------------------------------------
VARNAME                                     Numeric
-------------------------------------------------------------------------------

. odbc load, table("test")

. list

     +---------+
     | VARNAME |
     |---------|
  1. |       1 |
  2. |       2 |
  3. |       3 |
     +---------+
__________________________________________________

I run into problems when I try to use the insert command. For example,
with this dataset loaded, I try to save a copy as new.dbf:


. odbc insert VARNAME, table("new") dsn("frs") create noquote

The ODBC driver reported the following diagnostics
[Microsoft][ODBC dBASE Driver] Syntax error in CREATE TABLE statement.
SQLSTATE=42000
r(682);

I get the same error when I've started with a stata file and try to
export a set of variables to a fresh database. I've searched for info
on the error codes, but it hasn't been informative. What am I missing
here?

Thanks,

Steve
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index