dbTalk Databases Forums  

Creating a trigger in Pervasive SQL 2000i

comp.databases.btrieve comp.databases.btrieve


Discuss Creating a trigger in Pervasive SQL 2000i in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
portCo
 
Posts: n/a

Default Creating a trigger in Pervasive SQL 2000i - 02-27-2006 , 05:51 PM






Hi there,

I am a very new to Pervasive SQL. However, whenever there is a update
or insert in Pervasive SQL I will have to update or insert it to MS SQL
2000.

I found some information about Trigger; however, since I am new to
Pervasive SQL, I don't even know where I have to start such as where I
have to write a code and so on. Could anyone of you guys help me out?

I really appreciate your response.

Thanks alot.


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: Creating a trigger in Pervasive SQL 2000i - 03-01-2006 , 07:00 PM






Start with the manual, in the section under "CREATE TRIGGER" for some
examples.

By the way, please note that if you have any BTRIEVE applications
running and enable a trigger, you will PREVENT that Btrieve app from
doing the same thing. In short, a DELETE trigger will prevent
Btrieve-level DELETEs from working. This would break most apps.
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/27/06 ***


portCo wrote:

Quote:
Hi there,

I am a very new to Pervasive SQL. However, whenever there is a update
or insert in Pervasive SQL I will have to update or insert it to MS
SQL 2000.

I found some information about Trigger; however, since I am new to
Pervasive SQL, I don't even know where I have to start such as where I
have to write a code and so on. Could anyone of you guys help me out?

I really appreciate your response.

Thanks alot.


Reply With Quote
  #3  
Old   
portCo
 
Posts: n/a

Default Re: Creating a trigger in Pervasive SQL 2000i - 03-03-2006 , 06:14 PM



I've looked at the manual and created a trigger. However, it is not
same as the MSSQL. In MSSQL, when I create a trigger I can see the file
I created and I can modify it as well. But in psql I can't find it. Is
there a way I can see and modify my trigger in PSQL? When I created the
trigger, the pop-up window said "Stored Procedure was succesfully
created.".

I want to make sure I am doing right.
- create a trigger in "Stored Procedure" (right click + new stored
procedure) using Pervasive SQL Control Center
- Where Can I test it? I don't know where I can test that trigger. (I
tried to add a new row in database to fire the trigger; however, it
didn't work - "Insert Value does not match column list")

Any help would be appreciated =)

Thanks guys


Reply With Quote
  #4  
Old   
Bill Bach
 
Posts: n/a

Default Re: Creating a trigger in Pervasive SQL 2000i - 03-03-2006 , 10:32 PM



You can test a triger two ways -- issue the command that fires the
trigger, or use the core code to build a stored procedure (i.e. the
CREATE PROCEDURE command) and CALL that procedure from either your
application, the PCC, or another procedure.

As for seeing the trigger, you'll have to query the X$Trigger table
directly -- there is no way to see the trigger from the PCC (at least
that I am aware of). To modify the trigger, issue a DROP TRIGGER and a
subsequent CREATE TRIGGER statement.

I believe that PSQLv9 has improved the handling of triggers
dramatically, and would recommend that you upgrade to that version, if
you need this functionality.
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/27/06 ***

portCo wrote:

Quote:
I've looked at the manual and created a trigger. However, it is not
same as the MSSQL. In MSSQL, when I create a trigger I can see the
file I created and I can modify it as well. But in psql I can't find
it. Is there a way I can see and modify my trigger in PSQL? When I
created the trigger, the pop-up window said "Stored Procedure was
succesfully created.".

I want to make sure I am doing right.
- create a trigger in "Stored Procedure" (right click + new stored
procedure) using Pervasive SQL Control Center
- Where Can I test it? I don't know where I can test that trigger. (I
tried to add a new row in database to fire the trigger; however, it
didn't work - "Insert Value does not match column list")

Any help would be appreciated =)

Thanks guys


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.