> On 6 May 2015, at 16:00, Mike Kerner wrote:
>
> Neither the PRAGMA nor the SELECT name FROM sqlite_master WHERE
> type='table' AND name='table_name' rely on that function.
I have used your suggestion to modify my original function to:
function doesTableExist tTableName
put replaceText(tTa
Neither the PRAGMA nor the SELECT name FROM sqlite_master WHERE
type='table' AND name='table_name' rely on that function.
On Wed, May 6, 2015 at 2:35 AM, Terence Heaford
wrote:
> Thanks to everyone who has responded.
>
> If the built in LC routine revDatabaseTableNames is not reliable I need to
Thanks to everyone who has responded.
If the built in LC routine revDatabaseTableNames is not reliable I need to use
something similar to that provided in my first post.
I can’t see why that should not be reliable?
All the best
Terry
___
use-livecode
On Tue, May 5, 2015 at 10:55 AM, Richard Gaskin
wrote:
> Dr. Hawkins wrote:
> > On Tue, May 5, 2015 at 7:27 AM, Richard Gaskin wrote:
> >
> >> The example given in the Dictionary entry for the
> >> revDatabaseTableNames function may do what you need:
> >>
> >>if tTableName is among the lines
Dr. Hawkins wrote:
> On Tue, May 5, 2015 at 7:27 AM, Richard Gaskin wrote:
>
>> The example given in the Dictionary entry for the
>> revDatabaseTableNames function may do what you need:
>>
>>if tTableName is among the lines of \
>>revDatabaseTableNames(sgDatabaseId) then
>
> But be cau
> On 5 May 2015, at 14:41, Mike Bonner wrote:
>
> oh, and you can add a limit 1 to make it faster. (no sense in selecting a
> whole tables data)
What is returned if the table contains no data?
All the best
Terry
___
use-livecode mailing list
use-
> On 5 May 2015, at 15:41, Peter Haworth wrote:
>
> If you need to create the table
> if it doesn't exist, you could CREATE TABLE IF NOT EXISTS.
Was just looking for a generalised method of determining if a table exists
without having to create the table.
Thanks
Terry
_
On Tue, May 5, 2015 at 7:27 AM, Richard Gaskin
wrote:
> The example given in the Dictionary entry for the revDatabaseTableNames
> function may do what you need:
>
>if tTableName is among the lines of \
>revDatabaseTableNames(sgDatabaseId) then
>
But be cautious--I've found that the l
Hi Terry,
I'm curious as to why you need to do this. If you need to create the table
if it doesn't exist, you could CREATE TABLE IF NOT EXISTS.
Pete
lcSQL Software
On May 5, 2015 1:23 AM, "Terence Heaford" wrote:
> Is there a LC function for checking if a table exists in an sqlite
> database or
You can also use PRAGMA, or revDatabaseTableNames(), or SELECT name FROM
sqlite_master WHERE type='table' AND name='table_name';
On Tue, May 5, 2015 at 9:41 AM, Mike Bonner wrote:
> oh, and you can add a limit 1 to make it faster. (no sense in selecting a
> whole tables data)
>
> On Tue, May 5,
Terence Heaford wrote:
Is there a LC function for checking if a table exists in an sqlite database or
do I have to do something like this?
function doesTableExist tTableName
put replaceText(tTableName,"'","''") into tTableName
put merge(“SELECT count() FROM sqlite_master WHERE type = 'ta
oh, and you can add a limit 1 to make it faster. (no sense in selecting a
whole tables data)
On Tue, May 5, 2015 at 7:39 AM, Mike Bonner wrote:
> Probably the easiest way is a select:
>
> put "select * from tablename" into tSql
> revexecutesql tDbId,tSql
>
> if the result contains "no such table
Probably the easiest way is a select:
put "select * from tablename" into tSql
revexecutesql tDbId,tSql
if the result contains "no such table tablename" its not there.
On Tue, May 5, 2015 at 2:23 AM, Terence Heaford
wrote:
> Is there a LC function for checking if a table exists in an sqlite
> d
Is there a LC function for checking if a table exists in an sqlite database or
do I have to do something like this?
function doesTableExist tTableName
put replaceText(tTableName,"'","''") into tTableName
put merge(“SELECT count() FROM sqlite_master WHERE type = 'table' AND name=
'[[tTable
14 matches
Mail list logo