[sqlite] Trigger (on delete)

2008-07-24 Thread Juzbrig

I want to make simple trigger.
I have table 'genre' and 'artist', 'artist' have foreign key 'genre_id'
which is the primary key in 'genre' table
I want the trigger to delete artist wchich have the same foreign key as the
deleted genre for example: 
"delete from artist where genre_id = '10'" is triggered when "delete from
genre where genre_id = '10'" is call.

here is the form to fill :

CREATE TRIGGER delete_artist
  BEFORE DELETE
  ON genre
BEGIN
  /* Insert trigger body here */
  
  
END;
-- 
View this message in context: 
http://www.nabble.com/Trigger-%28on-delete%29-tp18632270p18632270.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] SQLite under c++

2008-07-24 Thread Juzbrig

Ok it works but how do I get messages/errors  back from DB? Because now im
doing it blind.



Mike Marshall wrote:
> 
> Do something like this
> 
> sqlite3_stmt* pStatement;
> vector vResults;
> int nError = sqlite3_prepare_v2(pHandle,"SELECT col1 FROM
> table",-1,&pStatement,NULL);
> while (sqlite3_step(pStatement) == SQLITE_ROW)
> {
>   
>   vResults.push_back((char*)sqlite3_column_text(pStatement, 0));  
> }
> sqlite3_finalize(pStatement);
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Juzbrig
> Sent: 23 July 2008 13:31
> To: sqlite-users@sqlite.org
> Subject: [sqlite] SQLite under c++
> 
> 
> Hi.
> I am new in sqlite (before I have mysql + php experience). I have a
> question
> 
> If my DB is alredy open
> 
> sqlite3* handle;
> const char* baza = "cols.db3" ;
> char *zErrMsg = 0;
> sqlite3_open(test_baza,&handle);
> 
> How can I get the results of SQL "SELECT * FROM" into a string table or
> any
> c++ structure ?
> sqlite3_exec() doesn't seem to return any strings/chars.
> 
> If anyone could write me that in code I would be grateful.
> -- 
> View this message in context:
> http://www.nabble.com/SQLite-under-c%2B%2B-tp18609682p18609682.html
> Sent from the SQLite mailing list archive at Nabble.com.
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SQLite-under-c%2B%2B-tp18609682p18628239.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] SQLite under c++

2008-07-23 Thread Juzbrig

Hi.
I am new in sqlite (before I have mysql + php experience). I have a question 
If my DB is alredy open

sqlite3* handle;
const char* baza = "cols.db3" ;
char *zErrMsg = 0;
sqlite3_open(test_baza,&handle);

How can I get the results of SQL "SELECT * FROM" into a string table or any
c++ structure ?
sqlite3_exec() doesn't seem to return any strings/chars.

If anyone could write me that in code I would be grateful.
-- 
View this message in context: 
http://www.nabble.com/SQLite-under-c%2B%2B-tp18609682p18609682.html
Sent from the SQLite mailing list archive at Nabble.com.

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