Jump to content


Photo

SQLite and table names with spaces


  • Please log in to reply
3 replies to this topic

#1 kickstart

kickstart

    Advanced Member

  • Staff Alumni
  • 2,715 posts

Posted 04 November 2009 - 06:00 AM

Hi

I am trying to extract the contents of an Access database into SQLite so it can be downloaded and used in another app.

One of the table names has a space in it and if I can I would prefer to keep all the table and column names the same. However I cannot see how to delimit table names in SQLite to allow me to use spaces.

I have tried delimiting with `, [] and ", and all result in an invalid database.

All the best

Keith
There are 10 types of people in the world. Those who understand binary and those who don't

#2 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 04 November 2009 - 07:34 AM

Double-quotes should work. Is there a chance that the name is all numeric characters?

I would convert spaces to an under-score
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

#3 nadeemshafi9

nadeemshafi9

    Advanced Member

  • Members
  • PipPipPip
  • 1,245 posts
  • LocationUK

Posted 04 November 2009 - 07:38 AM

yes bad idea to keep spaces in table names but you just hit the reason why
DONT LAY AN EGG OVER IT

#4 kickstart

kickstart

    Advanced Member

  • Staff Alumni
  • 2,715 posts

Posted 04 November 2009 - 08:25 AM

Double-quotes should work. Is there a chance that the name is all numeric characters?

I would convert spaces to an under-score


Double quotes do work for column names, but don't appear to work for table names.

In many ways I would prefer to use underscores, but would also prefer to keep the table names the same between the master copy and the SQLite extract copy.

I really wish people wouldn't use spaces in any table or column name, or any reserved words :'( .

All the best

Keith
There are 10 types of people in the world. Those who understand binary and those who don't




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com