Hi all,

I'm moving my program from my prototype that used the sqlite3 command  
line tool, to now using the C library function calls (through an  
Objective-C wrapper). Everything is going fine, with obviously greater  
flexibility.

The one hurdle I've struck is how to send a multi-statement SQL  
command. Say for instance I want to process a bunch of text such as:

begin immediate
;
drop trigger if exists "My Trigger"
;
create trigger "My Trigger"
instead of insert
on "My View"
begin
   insert into "My Table" (ID, Name, Age)
   values (new.ID, new.Name, new.Age)
   ;
end
;
insert into "My View" (Name, Age)
values ('Mickey', 55)
;
select * from "My Table"
;
commit
;

How do I submit it via C functions?

It seems that I need to use sqlite3_get_table() to get the result in  
one hit, rather than sqlite3_prepare_v2 and stepping through each row.  
Is that right?

I have been using an Objective-C wrapper but it doesn't seem to  
facilitate multi-statement SQL commands. Does anyone know of one that  
does? Or will I need to roll my own?

Thanks,
Tom
BareFeet

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to