SQLite DOT functions
Peter Haworth
pete at lcsql.com
Tue May 26 11:10:14 EDT 2015
Depending on what information you need to collect, there is another way -
see pragma table_info on the sqlite web site. It gives basic info about
each column in a table, including the name, data type, whether it can be
null or not, default value, and whether it is part of the primary key.
Easier to parse than the CREATE statement (one line per column, tab
delimited) if that's what you need to do.
Pete
lcSQL Software
On May 26, 2015 3:39 PM, "Mike Bonner" <bonnmike at gmail.com> wrote:
> Yeah, I think the dot functions are specific to the interactive client, but
> i'm not positive. Either way, it works well.
>
> On Tue, May 26, 2015 at 12:42 AM, Terence Heaford <t.heaford at icloud.com>
> wrote:
>
> > Thanks Mike,
> >
> > I thought maybe I’d missed a built in function for this.
> >
> > All the best
> >
> > Terry
> >
> >
> > > On 25 May 2015, at 20:18, Mike Bonner <bonnmike at gmail.com> wrote:
> > >
> > > get revdatafromquery(,,sDatabaseId,"select sql from sqlite_master
> where
> > > name='COMPANY'")
> > >
> > > This will return the SQL to create the table as a row of returned data.
> > >
> > >
> > > SDatabaseId is of course the database connection id.
> > >
> > >
> > > On Mon, May 25, 2015 at 12:45 PM, Terence Heaford <
> t.heaford at icloud.com>
> > > wrote:
> > >
> > >> How do you implement the following DOT function in LiveCode
> > >>
> > >> sqlite>.schema COMPANY
> > >>
> > >>
> > >> CREATE TABLE COMPANY(
> > >> ID INT PRIMARY KEY NOT NULL,
> > >> NAME TEXT NOT NULL,
> > >> AGE INT NOT NULL,
> > >> ADDRESS CHAR(50),
> > >> SALARY REAL
> > >> );
> > >>
> > >>
> > >>
> > >> Thanks
> > >>
> > >> Terry
> > >>
> > >>
> > >> _______________________________________________
> > >> use-livecode mailing list
> > >> use-livecode at lists.runrev.com
> > >> Please visit this url to subscribe, unsubscribe and manage your
> > >> subscription preferences:
> > >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > >>
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list