Which external api should I use in that case? I just want a parsed tree of the sql statement
Rohit On 7/31/07, Ken <[EMAIL PROTECTED]> wrote: > > You should be using the external API calls not the internal sqlite calls > and types. > > See: http://www.sqlite.org/capi3ref.html > > > Rohit Mordani <[EMAIL PROTECTED]> wrote: Hi, > This is my program... > > #include "sqliteInt.h" > > > int main(int argc, char **argv){ > Parse parse; > Select sel; > > > const char *selectStmt = "select * from tempTable;"; > parse.zSql= selectStmt; > sqlite3Select(&parse, &sel, SRT_Discard, 0, 0, 0, 0, 0); > sqlite3PrintSelect(&sel, 4); > > > return 1; > } > > When I run the program, it seg faults when sqlite3PrintSelect() calls > sqlite3PrintExprlist() since sel->pEList is null. I thought that pEList > would be populated by sqlite3Select(). What other function calls do I need > to make before this? > > Rohit > > On 7/31/07, Rohit Mordani wrote: > > > > So just to confirm - the Select structure (Select *p) is populated after > > the call to sqlite3Select() method right? In that case if I call > > sqlite3PrintSelect() after this then the statement will be printed > right? > > > > Thanks > > Rohit > > > > On 7/27/07, Joe Wilson wrote: > > > > > > --- Rohit Mordani < [EMAIL PROTECTED]> wrote: > > > > However, how do I pass the > > > > SQL statement, get it parsed and populate the structure? > > > sqlite3SelectNew() > > > > is a function that I saw, however that just takes in the different > > > sections > > > > of the SQL Statement. I want to start with a user specified SQL > query > > > and > > > > eventually get the Select structure. Is there a sequence of calls > that > > > I can > > > > make to achieve this? > > > > > > Yeah, I provided that information in the previous post. > > > > > > Run sqlite3 in a debugger and set a breakpoint in sqlite3Select(). > > > Issue a query and when the breakpoint hits, traverse the "Select* p" > > > argument. That's the Select structure. Happy hacking. > > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > Pinpoint customers who are looking for what you sell. > > > http://searchmarketing.yahoo.com/ > > > > > > > > > > ----------------------------------------------------------------------------- > > > To unsubscribe, send email to [EMAIL PROTECTED] > > > > ----------------------------------------------------------------------------- > > > > > > > > > > > > >