If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Triggers in windows application ^_^!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-04, 03:25
solostar*** solostar*** is offline
Registered User
 
Join Date: Feb 2004
Posts: 4
Triggers in windows application ^_^!!!

hello

I have created a windows application with visual c++ 6.0 which connects to a database.
The application executes SQL queries and I want to set some triggers or the insert, update and delete queries.
However, Where should i place my triggers?

sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=s",sDrive r,sFile);
TRY
{
CDatabase ComboDatabase;
// Open the database
ComboDatabase.Ope(NULL,false,false,sDsn);

// Build the SQL statement
SqlCommand = "INSERT INTO BandSetting "
"VALUES('" + str25 + "'" ",'" + str1 + "'" ",'" + str2 + "'"
",'" + str3 + "'" ",'" + str4 + "'" ",'"+ str5 + "'" ",'"+ str6 + "'" ",'" + str7 + "'" ",'" + str8 + "'" ",'"+ str9 + "'" ",'" + str10 + "'" ",'" + str11 + "'" ",'"+ str12 + "'" ",'" + str13 + "'" ",'" + str14 + "'" ",'" + str15 + "'" ",'" + str16 + "'" ",'" + str17 + "'" ",'"+ str18 + "'" ",'" + str19 + "'" ",'" + str20 + "'" ",'"+ str21 + "'" ",'" + str22 + "'" ",'" + str23 + "'" ", + str24 + "'" ")" ;

ComboDatabase.ExecuteSQL(SqlCommand);
// Close the database
ComboDatabase.Close();
}

where do i put the trigger???
hope you guys can help me out on this! thanks (^_^!!)
Reply With Quote
  #2 (permalink)  
Old 02-23-04, 07:29
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
Exclamation Trigger is a database object

Hello,

a trigger is a database object that is stored in the database.
If you use Oracle, connect against the Oracle database and use the CREATE OR REPLACE TRIGGER command to insert a trigger to a table or a view.
You can specify different types of triggers for example a trigger that only fires when inserts or update or deletes happens.
You can even set triggers on special DDL events like logon logout, create tabla and so on.
If you want to create trigger with a dialog based application, use AlligatorSQL and connect against your database. Click on your table in the schema and select the element trigger root. Press ALT-I to get into the dialog trigger and enter your options and your PL/SQL code to be executes when the rigger will be fired.

AlligatorSQL http://www.alligatorsql.com/download/alligator.zip

If you need further help, just send me an e-mail to m.peter@alligatorsql.com

Hope this helps ?

Best regards
Manfred Peter
Alligator Company Software GmbH
http://www.alligatorsql.com
Reply With Quote
  #3 (permalink)  
Old 02-24-04, 03:38
solostar*** solostar*** is offline
Registered User
 
Join Date: Feb 2004
Posts: 4
Talking

Wow..

thanks for your reply...

I'll try this out.
Thanks very much!!!!!!!!!! =)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On