Table names length and content

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Table names length and content

jose isaias cabrera

Greetings!

When creating table names, are there any constraints that one must look for?
ie. Length? Characters? etc.?  I quickly browse through this spot,

https://www.sqlite.org/lang_createtable.html

but could not find any information regarding this.  Would someone please
bring light for this subject for me?  Thanks.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Stephan Beal-3
On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera <[hidden email]
> wrote:

> When creating table names, are there any constraints that one must look
> for? ie. Length? Characters? etc.?  I quickly browse through this spot,
>
> https://www.sqlite.org/lang_createtable.html


https://www.sqlite.org/limits.html

might have what you're looking for.

--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

jose isaias cabrera

"Stephan Beal" wrote...

> On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera
> <[hidden email]
>> wrote:
>
>> When creating table names, are there any constraints that one must look
>> for? ie. Length? Characters? etc.?  I quickly browse through this spot,
>>
>> https://www.sqlite.org/lang_createtable.html
>
>
> https://www.sqlite.org/limits.html
>
> might have what you're looking for.

Hmmm... what I am looking for it is not there.  If the "string length"
defined there is what defines the length of the name of a table, I am in
business. :-)  However, there is nothing about problematic characters. ie.
<>!@#$%^&*()_+=-{}\|[]'";:?/.,, etc., etc. in the table name.

Thoughts?  Thanks.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Richard Hipp-3
On Mon, Dec 8, 2014 at 1:22 PM, jose isaias cabrera <[hidden email]
> wrote:

>
> "Stephan Beal" wrote...
>
>  On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera <
>> [hidden email]
>>
>>> wrote:
>>>
>>
>>  When creating table names, are there any constraints that one must look
>>> for? ie. Length? Characters? etc.?  I quickly browse through this spot,
>>>
>>> https://www.sqlite.org/lang_createtable.html
>>>
>>
>>
>> https://www.sqlite.org/limits.html
>>
>> might have what you're looking for.
>>
>
> Hmmm... what I am looking for it is not there.  If the "string length"
> defined there is what defines the length of the name of a table, I am in
> business. :-)  However, there is nothing about problematic characters. ie.
> <>!@#$%^&*()_+=-{}\|[]'";:?/.,, etc., etc. in the table name.
>
>
Put the table name in double-quotes.  If the table name contains a
double-quote mark (ascii 0x22) then double it.  The name of the table
cannot start with "sqlite" but otherwise, there are no other restrictions
that I recall.


--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

jose isaias cabrera

"Richard Hipp" wrote...

> On Mon, Dec 8, 2014 at 1:22 PM, jose isaias cabrera
> <[hidden email]
>> wrote:
>
>>
>> "Stephan Beal" wrote...
>>
>>  On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera <
>>> [hidden email]
>>>
>>>> wrote:
>>>>
>>>
>>>  When creating table names, are there any constraints that one must look
>>>> for? ie. Length? Characters? etc.?  I quickly browse through this spot,
>>>>
>>>> https://www.sqlite.org/lang_createtable.html
>>>>
>>>
>>>
>>> https://www.sqlite.org/limits.html
>>>
>>> might have what you're looking for.
>>>
>>
>> Hmmm... what I am looking for it is not there.  If the "string length"
>> defined there is what defines the length of the name of a table, I am in
>> business. :-)  However, there is nothing about problematic characters.
>> ie.
>> <>!@#$%^&*()_+=-{}\|[]'";:?/.,, etc., etc. in the table name.
>>
>>
> Put the table name in double-quotes.  If the table name contains a
> double-quote mark (ascii 0x22) then double it.  The name of the table
> cannot start with "sqlite" but otherwise, there are no other restrictions
> that I recall.

Thanks, Dr. Hipp.  That is what I was looking for.  I will let you know if
something does not work.

josé

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Roger Binns
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/08/2014 10:30 AM, jose isaias cabrera wrote:
>>> Hmmm... what I am looking for it is not there.  If the "string
>>> length" defined there is what defines the length of the name of
>>> a table, I am in business. :-)  However, there is nothing about
>>> problematic characters. ie. <>!@#$%^&*()_+=-{}\|[]'";:?/.,,
>>> etc., etc. in the table name.

SQLite supports all those, as well as zero length table names, column
types and names.


sqlite> create table " <>!@#$%^&*()_+=-{}\|[]'"";:?/.,, etc., etc. in
the table name"("" "");

sqlite> .header on

sqlite> pragma table_info(" <>!@#$%^&*()_+=-{}\|[]'"";:?/.,, etc.,
etc. in the table name");

cid|name|type|notnull|dflt_value|pk
0|||0||0

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlSF764ACgkQmOOfHg372QRorQCcDbpSsjwclDLcKAiRQlFOC73M
Sc8AnirtIkzx1v/5LWrAc1VYAGJ53MnS
=bj14
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Drago, William @ CSG - NARDA-MITEQ
In reply to this post by Richard Hipp-3
> -----Original Message-----
> From: [hidden email] [mailto:sqlite-users-
> [hidden email]] On Behalf Of Richard Hipp
> Sent: Monday, December 08, 2014 1:28 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Table names length and content
>
> On Mon, Dec 8, 2014 at 1:22 PM, jose isaias cabrera
> <[hidden email]
> > wrote:
>
> >
> > "Stephan Beal" wrote...
> >
> >  On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera <
> >> [hidden email]
> >>
> >>> wrote:
> >>>
> >>
> >>  When creating table names, are there any constraints that one must
> >> look
> >>> for? ie. Length? Characters? etc.?  I quickly browse through this
> >>> spot,
> >>>
> >>> https://www.sqlite.org/lang_createtable.html
> >>>
> >>
> >>
> >> https://www.sqlite.org/limits.html
> >>
> >> might have what you're looking for.
> >>
> >
> > Hmmm... what I am looking for it is not there.  If the "string
> length"
> > defined there is what defines the length of the name of a table, I am
> > in business. :-)  However, there is nothing about problematic
> characters. ie.
> > <>!@#$%^&*()_+=-{}\|[]'";:?/.,, etc., etc. in the table name.
> >
> >
> Put the table name in double-quotes.

Uh oh! I never use quotes when I create my tables. What are the implications of not quoting?

-Bill
CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Stephan Beal-3
In reply to this post by Roger Binns
On Mon, Dec 8, 2014 at 7:36 PM, Roger Binns <[hidden email]> wrote:

> SQLite supports all those, as well as zero length table names, column
> types and names.
>
>
> sqlite> create table " <>!@#$%^&*()_+=-{}\|[]'"";:?/.,, etc., etc. in
> the table name"("" "");
>

To whichl add: sqlite allows it. Your fellow colleagues, on the other hand,
will hopefully not let such things through code review ;).


(Empty strings? Really?)

--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Richard Hipp-3
In reply to this post by Roger Binns
On Mon, Dec 8, 2014 at 1:36 PM, Roger Binns <[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/08/2014 10:30 AM, jose isaias cabrera wrote:
> >>> Hmmm... what I am looking for it is not there.  If the "string
> >>> length" defined there is what defines the length of the name of
> >>> a table, I am in business. :-)  However, there is nothing about
> >>> problematic characters. ie. <>!@#$%^&*()_+=-{}\|[]'";:?/.,,
> >>> etc., etc. in the table name.
>
> SQLite supports all those, as well as zero length table names, column
> types and names.
>

But just because SQLite supports all of that does not mean that you
*should* use it.  I'm worried about what you are contemplating, Jose.  I
think you would be better off to use a short and simple lower-case ASCII
table name.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Stephan Beal-3
In reply to this post by Drago, William @ CSG - NARDA-MITEQ
On Mon, Dec 8, 2014 at 7:37 PM, Drago, William @ CSG - NARDAEAST <
[hidden email]> wrote:

> Uh oh! I never use quotes when I create my tables. What are the
> implications of not quoting?
>

If you restrict yourself to C-style identifiers, the primary implication is
better ease of use and readability! ;)

--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Drago, William @ CSG - NARDA-MITEQ
That's a relief. I thought I was doing something wrong.

Thanks,
--
Bill Drago
Senior Engineer
L3 Communications / Narda Microwave East
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / [hidden email]



> -----Original Message-----
> From: [hidden email] [mailto:sqlite-users-
> [hidden email]] On Behalf Of Stephan Beal
> Sent: Monday, December 08, 2014 1:41 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Table names length and content
>
> On Mon, Dec 8, 2014 at 7:37 PM, Drago, William @ CSG - NARDAEAST <
> [hidden email]> wrote:
>
> > Uh oh! I never use quotes when I create my tables. What are the
> > implications of not quoting?
> >
>
> If you restrict yourself to C-style identifiers, the primary
> implication is better ease of use and readability! ;)
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> "Freedom is sloppy. But since tyranny's the only guaranteed byproduct
> of those who insist on a perfect world, freedom will have to do." --
> Bigby Wolf _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

jose isaias cabrera
In reply to this post by Richard Hipp-3

"Richard Hipp" wrote...

> On Mon, Dec 8, 2014 at 1:36 PM, Roger Binns <[hidden email]> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 12/08/2014 10:30 AM, jose isaias cabrera wrote:
>> >>> Hmmm... what I am looking for it is not there.  If the "string
>> >>> length" defined there is what defines the length of the name of
>> >>> a table, I am in business. :-)  However, there is nothing about
>> >>> problematic characters. ie. <>!@#$%^&*()_+=-{}\|[]'";:?/.,,
>> >>> etc., etc. in the table name.
>>
>> SQLite supports all those, as well as zero length table names, column
>> types and names.
>>
>
> But just because SQLite supports all of that does not mean that you
> *should* use it.  I'm worried about what you are contemplating, Jose.  I
> think you would be better off to use a short and simple lower-case ASCII
> table name.

Most of the time, I use single and lowercase names.  And, I will take your
advice and continue with such.  I was trying to do an easy hack, but, you're
right.  It's a long story, so I will save it for another day...  Thanks all.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Table names length and content

Keith Medcalf
In reply to this post by Drago, William @ CSG - NARDA-MITEQ

You get a palladium star for avoiding the most obvious source of errors (and wasted keystrokes) ...

---
Theory is when you know everything but nothing works.  Practice is when everything works but no one knows why.  Sometimes theory and practice are combined:  nothing works and no one knows why.

>-----Original Message-----
>From: [hidden email] [mailto:sqlite-users-
>[hidden email]] On Behalf Of Drago, William @ CSG - NARDAEAST
>Sent: Monday, 8 December, 2014 11:38
>To: General Discussion of SQLite Database
>Subject: Re: [sqlite] Table names length and content
>
>> -----Original Message-----
>> From: [hidden email] [mailto:sqlite-users-
>> [hidden email]] On Behalf Of Richard Hipp
>> Sent: Monday, December 08, 2014 1:28 PM
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] Table names length and content
>>
>> On Mon, Dec 8, 2014 at 1:22 PM, jose isaias cabrera
>> <[hidden email]
>> > wrote:
>>
>> >
>> > "Stephan Beal" wrote...
>> >
>> >  On Mon, Dec 8, 2014 at 6:32 PM, jose isaias cabrera <
>> >> [hidden email]
>> >>
>> >>> wrote:
>> >>>
>> >>
>> >>  When creating table names, are there any constraints that one must
>> >> look
>> >>> for? ie. Length? Characters? etc.?  I quickly browse through this
>> >>> spot,
>> >>>
>> >>> https://www.sqlite.org/lang_createtable.html
>> >>>
>> >>
>> >>
>> >> https://www.sqlite.org/limits.html
>> >>
>> >> might have what you're looking for.
>> >>
>> >
>> > Hmmm... what I am looking for it is not there.  If the "string
>> length"
>> > defined there is what defines the length of the name of a table, I am
>> > in business. :-)  However, there is nothing about problematic
>> characters. ie.
>> > <>!@#$%^&*()_+=-{}\|[]'";:?/.,, etc., etc. in the table name.
>> >
>> >
>> Put the table name in double-quotes.
>
>Uh oh! I never use quotes when I create my tables. What are the
>implications of not quoting?
>
>-Bill
>CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any
>attachments are solely for the use of the addressee and may contain
>information that is privileged or confidential. Any disclosure, use or
>distribution of the information contained herein is prohibited. In the
>event this e-mail contains technical data within the definition of the
>International Traffic in Arms Regulations or Export Administration
>Regulations, it is subject to the export control laws of the
>U.S.Government. The recipient should check this e-mail and any
>attachments for the presence of viruses as L-3 does not accept any
>liability associated with the transmission of this e-mail. If you have
>received this communication in error, please notify the sender by reply
>e-mail and immediately delete this message and any attachments.
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users