_____  

From: Mike Willhite [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 12:13 PM
To: '[EMAIL PROTECTED]'
Subject: SQL error: no such column: State

 

System Configuration:

 

Microsoft Windows Server 2003 Ver. 5.2.3790

CoreLab MySQLDirect.NET Ver. 2.70.0 05.11.04

Microsoft Development Environment 2003  Ver 7.1.3088

Microsoft .Net 1.1 Ver 1.1.4322 SP1

 

When The Table is created in code with the following statements

 

cmd.CommandText = "CREATE TABLE BillingNumbers(id int default 0 not null, "
& _

"clecID int default 0 not null, " & _

"ilecID int default 0 not null, " & _

"BillingNumber varchar(20) default "" not null, " & _

"State varchar(20) default "" not null, " & _

"Resale int default 0 not null, " & _

"UNEP int default 0 not null, " & _

"PctDiscount decimal(8,2) default 0 not null)"

 

cmd.ExecuteNonQuery()

 

This Insert statement returns the error "SQL error: no such column: State"

INSERT INTO BillingNumbers (id, clecID, ilecID, BillingNumber, State,
Resale, UNEP, PctDiscount) VALUES (15, 2, 0, '318Q802095', 'LA', 1, 0, 0)

 

Executing 

sqlite> .schema BillingNumbers shows the column to be there

 

CREATE TABLE BillingNumbers(id int default 0 not null, clecID int default 0
not null, ilecID int default 0 not null, BillingNumber

 varchar(20) default " not null, State varchar(20) default " not null,
Resale int default 0 not null, UNEP int default 0 not null,

 PctDiscount decimal(8,2) default 0 not null);

sqlite>

 

Executing 

sqlite> select State from BillingNumbers;

SQL error: no such column: State

 

I can use SQLite3.exe to drop the table and then create it again using the
SQLite3.exe Command Line and the INSERT and Select statements then work.

 

sqlite> drop table BillingNumbers;

sqlite> CREATE TABLE BillingNumbers(id int default 0 not null,

   ...> clecID int default 0 not null,

   ...> ilecID int default 0 not null,

   ...> BillingNumber varchar(20) default "" not null,

   ...> State varchar(20) default "" not null,

   ...> Resale int default 0 not null,

   ...> UNEP int default 0 not null,

   ...> PctDiscount decimal(8,2) default 0 not null)

   ...> ;

 

sqlite> select State from BillingNumbers;

sqlite>

 

sqlite> INSERT INTO BillingNumbers (id, clecID, ilecID, BillingNumber,
State, Resale, UNEP, PctDiscount) VALUES (15, 2, 0, '318Q80

2095', 'LA', 1, 0, 0);

sqlite>

 

Thanks

 

Mike

 

 

 

Reply via email to