Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Igor Korot
Hi, guys,
Parents with the comma before "PRIMARY" fixed it.

Thx.


On Tue, Nov 22, 2016 at 9:39 AM, Niall O'Reilly  wrote:
> On 22 Nov 2016, at 14:35, David Raymond wrote:
>
>> It's needed. The arrow coming out of [column-def] (visually) goes past
>> [table-constraint] first, with the option to loop down to a comma on its way
>> to a [table-constraint]
>
>
>   Thanks.  My gut told me one thing, my eyes another.  Eyes were wrong.
>
>
>   Best regards,
>   Niall O'Reilly
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread David Raymond
It's needed. The arrow coming out of [column-def] (visually) goes past 
[table-constraint] first, with the option to loop down to a comma on its way to 
a [table-constraint]


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Niall O'Reilly
Sent: Tuesday, November 22, 2016 9:22 AM
To: SQLite mailing list
Subject: Re: [sqlite] CREATE TABLE fails


   I was going to add "missing comma before PRIMARY" as well, but
   https://www.sqlite.org/lang_createtable.html doesn't seem to indicate
   that a comma is required between a column-def and a table-constraint.

   Best regards,
   Niall O'Reilly
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Niall O'Reilly

On 22 Nov 2016, at 14:35, David Raymond wrote:

It's needed. The arrow coming out of [column-def] (visually) goes past 
[table-constraint] first, with the option to loop down to a comma on 
its way to a [table-constraint]


  Thanks.  My gut told me one thing, my eyes another.  Eyes were wrong.

  Best regards,
  Niall O'Reilly
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Niall O'Reilly



On 22 Nov 2016, at 14:03, Richard Hipp wrote:


On 11/22/16, Igor Korot  wrote:

Hi, ALL,
SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE IF NOT EXISTS abc("abc_tnam" char(129) NOT NULL,
 "abc_tid" integer, "abc_ownr" char(129) NOT NULL, "abc_cnam" 
char(129) NOT

NULL
, "abc_cid" smallint, "abc_labl" char(254), "abc_lpos" smallint, 
"abc_hdr"

char(
254), "abc_hpos" smallint, "abc_itfy" smallint, "abc_mask" char(31),
"abc_case"
smallint, "abc_hght" smallint, "abc_wdth" smallint, "abc_ptrn" 
char(31),

"abc_bm
ap" char(1), "abc_init" char(254), "abc_cmnt" char(254), "abc_edit"
char(31), "a
bc_tag" char(254) PRIMARY KEY "abc_tnam", "abc_ownr", "abc_cnam");


Missing comma (,) in between "KEY" and "abc_tnam".


  Or perhaps (if Igor's intent is to use three columns as a compound 
primary
  key) missing parens ['(' ... ')'] around the list of columns after 
KEY ?


  I was going to add "missing comma before PRIMARY" as well, but
  https://www.sqlite.org/lang_createtable.html doesn't seem to indicate
  that a comma is required between a column-def and a table-constraint.

  Best regards,
  Niall O'Reilly
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Hick Gunter
Perhaps you mean  ...,"a bc_tag" char(254), PRIMARY KEY ("abc_tnam", 
"abc_ownr", "abc_cnam") );

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Igor Korot
Gesendet: Dienstag, 22. November 2016 14:46
An: Discussion of SQLite Database ; 
General Discussion of SQLite Database 
Betreff: [sqlite] CREATE TABLE fails

Hi, ALL,
SQLite version 3.13.0 2016-05-18 10:57:30 Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE IF NOT EXISTS abc("abc_tnam" char(129) NOT NULL,
 "abc_tid" integer, "abc_ownr" char(129) NOT NULL, "abc_cnam" char(129) NOT 
NULL , "abc_cid" smallint, "abc_labl" char(254), "abc_lpos" smallint, "abc_hdr" 
char( 254), "abc_hpos" smallint, "abc_itfy" smallint, "abc_mask" char(31), 
"abc_case"
smallint, "abc_hght" smallint, "abc_wdth" smallint, "abc_ptrn" char(31), 
"abc_bm ap" char(1), "abc_init" char(254), "abc_cmnt" char(254), "abc_edit" 
char(31), "a bc_tag" char(254) PRIMARY KEY "abc_tnam", "abc_ownr", "abc_cnam");
Error: near ""abc_tnam"": syntax error
sqlite>

Where am I wrong?

Also, just out of curiosity - what symbols are allowed in the table/field name?
Is there any restrictions even for "" syntax?

Thank you.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Quan Yong Zhai
CREATE TABLE IF NOT EXISTS abc("abc_tnam" char(129) NOT NULL,

"abc_tid" integer, "abc_ownr" char(129) NOT NULL, "abc_cnam" char(129) NOT NULL

, "abc_cid" smallint, "abc_labl" char(254), "abc_lpos" smallint, "abc_hdr" char(

254), "abc_hpos" smallint, "abc_itfy" smallint, "abc_mask" char(31), "abc_case"

smallint, "abc_hght" smallint, "abc_wdth" smallint, "abc_ptrn" char(31), "abc_bm

ap" char(1), "abc_init" char(254), "abc_cmnt" char(254), "abc_edit" char(31), "a

bc_tag" char(254), PRIMARY KEY ("abc_tnam", "abc_ownr", "abc_cnam"));



Sent from Mail for Windows 10



From: Igor Korot
Sent: 2016年11月22日 21:46
To: Discussion of SQLite Database; 
General Discussion of SQLite Database
Subject: [sqlite] CREATE TABLE fails



Hi, ALL,
SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE IF NOT EXISTS abc("abc_tnam" char(129) NOT NULL,
 "abc_tid" integer, "abc_ownr" char(129) NOT NULL, "abc_cnam" char(129) NOT NULL
, "abc_cid" smallint, "abc_labl" char(254), "abc_lpos" smallint, "abc_hdr" char(
254), "abc_hpos" smallint, "abc_itfy" smallint, "abc_mask" char(31), "abc_case"
smallint, "abc_hght" smallint, "abc_wdth" smallint, "abc_ptrn" char(31), "abc_bm
ap" char(1), "abc_init" char(254), "abc_cmnt" char(254), "abc_edit" char(31), "a
bc_tag" char(254) PRIMARY KEY "abc_tnam", "abc_ownr", "abc_cnam");
Error: near ""abc_tnam"": syntax error
sqlite>

Where am I wrong?

Also, just out of curiosity - what symbols are allowed in the table/field name?
Is there any restrictions even for "" syntax?

Thank you.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails

2016-11-22 Thread Richard Hipp
On 11/22/16, Igor Korot  wrote:
> Hi, ALL,
> SQLite version 3.13.0 2016-05-18 10:57:30
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> CREATE TABLE IF NOT EXISTS abc("abc_tnam" char(129) NOT NULL,
>  "abc_tid" integer, "abc_ownr" char(129) NOT NULL, "abc_cnam" char(129) NOT
> NULL
> , "abc_cid" smallint, "abc_labl" char(254), "abc_lpos" smallint, "abc_hdr"
> char(
> 254), "abc_hpos" smallint, "abc_itfy" smallint, "abc_mask" char(31),
> "abc_case"
> smallint, "abc_hght" smallint, "abc_wdth" smallint, "abc_ptrn" char(31),
> "abc_bm
> ap" char(1), "abc_init" char(254), "abc_cmnt" char(254), "abc_edit"
> char(31), "a
> bc_tag" char(254) PRIMARY KEY "abc_tnam", "abc_ownr", "abc_cnam");

Missing comma (,) in between "KEY" and "abc_tnam".
>
> Also, just out of curiosity - what symbols are allowed in the table/field
> name?
> Is there any restrictions even for "" syntax?

As long as it is within double-quotes, you can use any characters you
want other than U+.  On the other hand, good style suggests
limiting your choice of characters to ASCII alphanumerics and
underscore.

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE TABLE fails if SQL starts with comment

2007-04-27 Thread Yuriy Martsynovskyy

Update to version version 3.3.17 has solved the problem.
The issue existed in version 3.3.14

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] CREATE TABLE fails if SQL starts with comment

2007-04-27 Thread drh
"Yuriy Martsynovskyy" <[EMAIL PROTECTED]> wrote:
> When I execute the SQL code below on a newly created DB file I get an
> error 'table Tab already exists', and it creates a table
> 
> -- comment
> CREATE TABLE Tab(ID);
> 
> Code below works without error messages:
> 
> CREATE TABLE Tab(ID);
> 

I am unable to reproduce this problem.  Both statements work
fine when I try them.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-