Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Fields of the same name in diff tables
Re: Fields of the same name in diff tables [message #21718 is a reply to message #21717] Mon, 01 June 2009 23:58 Go to previous messageGo to previous message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Ok, here is the full definition:

TABLE_(SUPPLIER)
	INT_    (ID) PRIMARY_KEY AUTO_INCREMENT
	STRING_ (NAME, 80) NOT_NULL UNIQUE
	STRING_ (ADDRESS1, 128)
	STRING_ (ADDRESS2, 128)
	STRING_ (CITY, 128)
	STRING_ (STATE, 80)
	STRING_ (POSTAL_CODE, 24)
	STRING_ (PRIMARY_PHONE, 35)
	STRING_ (SECONDARY_PHONE, 35)
	STRING_ (EMAIL, 128)
	STRING_ (WEB_ADDRESS, 500)
	BLOB_   (DESCRIPTION)
END_TABLE


Here is the resulting SQL:

-- From S_BeekPRO.sql
create table SUPPLIER (
 ID integer primary key autoincrement,
 NAME text not null,
 ADDRESS1 text,
 ADDRESS2 text,
 CITY text,
 STATE text,
 POSTAL_CODE text,
 PRIMARY_PHONE text,
 SECONDARY_PHONE text,
 EMAIL text,
 WEB_ADDRESS text,
 DESCRIPTION blob
);

-- From A_BeekPRO.sql
create unique index IDX_SUPPLIER$NAME on SUPPLIER(NAME);


Here is the output from sqlite3 session:

C:\Develop\Tools\upp\out\MSC9.Debug.Debug_full.Gui>sqlite3 BeekPRO.db3
SQLite version 3.6.7
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema SUPPLIER
CREATE TABLE SUPPLIER (  ID integer primary key autoincrement , 
ADDRESS1 text, ADDRESS2 text, CITY text, STATE text, POSTAL_CODE 
text, PRIMARY_PHONE text, SECONDARY_PHONE text, EMAIL text, 
WEB_ADDRESS text, DESCRIPTION blob);


Here is the output from the log:

* C:\develop\tools\upp\out\MSC9.Debug.Debug_full.Gui\BeekPRO.exe 01.06.2009 17:52:23, user: jeremy

ERROR Cannot add a NOT NULL column with default value NULL(0): Preparing: alter table SUPPLIER add  NAME text not null
ERROR table SUPPLIER has no column named NAME(0): Preparing: create unique index IDX_SUPPLIER$NAME on SUPPLIER(NAME)


Jeremy

[Updated on: Tue, 02 June 2009 08:06]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Weird Date bevaviour in Sqlite
Next Topic: SqlLite3 crashes on Fetch()
Goto Forum:
  


Current Time: Fri Apr 19 06:23:18 CEST 2024

Total time taken to generate the page: 0.05571 seconds