On 23/09/2017 05:36, mikeegg1 wrote:
I’m using the statement:
select count(*) from sqlite_master where type = 'table' and name = ‘$NAME’;
This statement works fine in the sqlite3 shell. This statement does not work in
my API.
Is there a PRAGMA I need to issue so I can check for table existen
ver need to do writable_schema = on for any normal
> operation. You can always read the schema even without that.
> >>>
> >>> -To my untrained eye it looks like you made a "name" variable, but
> never actually bound it to the statement. Usually that
n: cur.execute(, >> values to bind>)
>>> cur.execute("select count(*) from sqlite_master where type = 'table' and
>>> name = ?;", (,))
>>>
>>>
>>> -----Original Message-
>>> From: sqlite-users [mailto:sqli
bind>)
>> cur.execute("select count(*) from sqlite_master where type = 'table' and
>> name = ?;", (,))
>>
>>
>> -Original Message-
>> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
>> Behalf Of mikeegg1
>> Sent:
*) from sqlite_master where type = 'table' and name
> = ?;", (,))
>
>
> -Original Message-
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
> Behalf Of mikeegg1
> Sent: Friday, September 22, 2017 3:36 PM
> To: SQLi
sers [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of mikeegg1
Sent: Friday, September 22, 2017 3:36 PM
To: SQLite mailing list
Subject: [sqlite] checking if a table exists
I’m using the statement:
select count(*) from sqlite_master where type = 'table' and name = ‘$NAME’;
I’m using the statement:
select count(*) from sqlite_master where type = 'table' and name = ‘$NAME’;
This statement works fine in the sqlite3 shell. This statement does not work in
my API.
Is there a PRAGMA I need to issue so I can check for table existence?
TIA
Mike
PERL code to check for ta
7 matches
Mail list logo