revdb error: MUST be select SQL

Ivan ivan at internet-marketing-today.com
Mon May 8 01:47:45 EDT 2006


Jan Schenkel <janschenkel at ...> writes:

> 
> --- Ivan <ivan at ...> wrote:
> > Hello,
> > 
> > I have been testing the revDataFromQuery function
> > with a SQL pragma query for 
> > sqlite3: PRAGMA table_info("articles")
> > 
> > However, whenever I run it, I get an error message:
> > 
> > "revdberr,Database Error: MUST be select SQL!"
> > 
> > 
> > The reason seems to be because PRAGMA is not a
> > select statement?
> > 
> > I have not been able to find a solution in the docs
> > - would anyone be able to 
> > help me on this please?
> > 
> > 
> > thanks,
> > Ivan Wong
> > Internet-Marketing-Today.com
> > 
> 
> Hi Ivan,
> 
> The revDataFromQuery function is used to find and
> return records from the database as one block of text
> in a column and row-delimited format.
> 
> If you want to execute non-SELECT queries on a
> database, use the revExecuteSQL command:
> --
> revExecuteSQL tConnectionID, tSQLQuery
> --
> 
> Oh, and if you're going to read a lot of data from the
> database without displaying it all right away, you
> might want to look into the revQueryDatabase function,
> which uses cursors (record sets).
> 
> Hope this helped,
> 
> Jan Schenkel.
> 
> Quartam Reports for Revolution
> <http://www.quartam.com>
> 
> =====
> "As we grow older, we grow both wiser and more foolish at the same time."  
(La Rochefoucauld)


Hi Jan,

Many thanks for the help - I'm still facing an issue with PRAGMA.

I was actually trying to use libDatabase from Trevor DeVore, but my database 
insert was failing on libDB_addToTable.  In trying to get it to work, I 
isolated the problem to the revDataFromQuery call above.

It seemed that the PRAGMA sql call was not working.

I tried to use revExecuteSQL, but this only executes sql and does not return 
the table field information produced by PRAGMA table_info?

I'm sure there is a simpler way to do this - but I'm still very new to the db 
calls in Rev.


Thanks,
Ivan




More information about the use-livecode mailing list