473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Problems with a simple Trigger :-(

Helo everybody
i am trying to make a trigger. But my trigger generates me an error i can not explain.

This is my trigger code:

Expand|Select|Wrap|Line Numbers
  1. -- This script has been created using ^ as the termination character.
  2. -- If you wish to execute this script through the CLP, you will need 
  3. -- to add the CLP option -td"^" to your command line,  for example:
  4. -- db2 -td"^" -f filename.ddl
  5.  
  6. CONNECT TO DACODB2^
  7. CREATE TRIGGER FASTMAIN.TR_TEST NO CASCADE BEFORE  INSERT  ON FASTMAIN.IMP_TAB_RECORDS  REFERENCING  NEW AS NEW_KEY  FOR EACH ROW  MODE DB2SQL 
  8. BEGIN ATOMIC
  9. --
  10. DECLARE proc_pointer_from INTEGER DEFAULT 0;
  11. DECLARE proc_pointer_to INTEGER DEFAULT 0;
  12. DECLARE proc_pointer_last INTEGER DEFAULT 0;
  13. DECLARE proc_pointer_incr INTEGER DEFAULT 0;
  14. --
  15.  
  16. --
  17. SET (proc_pointer_from,proc_pointer_to,proc_pointer_last,proc_pointer_incr)=(SELECT pointer_from,pointer_to,pointer_last,pointer_increment FROM pointer WHERE pointer_id='IMP001');
  18. --
  19.  
  20. --
  21. SET proc_pointer_last=proc_pointer_last+proc_pointer_incr;
  22. IF proc_pointer_last>proc_pointer_to THEN
  23. SET proc_pointer_last=proc_pointer_from;
  24. END IF;
  25. --
  26.  
  27. --
  28. UPDATE pointer SET pointer_last=proc_pointer_last WHERE pointer_id='IMP001';
  29. --
  30.  
  31. --
  32. SET NEW_KEY.IMPTR_KEY=proc_pointer_last;
  33. --
  34.  
  35. END^
  36. CONNECT RESET^

But DB2 has a problehm with the folowing statement of my code:
„UPDATE pointer SET pointer_last=proc_pointer_last WHERE pointer_id='IMP001';


When i try to create my trigger DB2 says :

"The trigger "FASTMAIN.TR_TEST" is defined with an unsupported triggered SQL "


Pleasy help me i have no idea why this normal SQL statement is not correct.
an exuse me for my bad english :-)

Greeetings
Nov 7 '08 #1
1 2013
kazam
9
Can you paste the error message here. So that it would become easy to identify the problem
Nov 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steve Bishop | last post by:
I have an Insert, Update and delete trigger on a table that works fine. It records the changes into another table called tblTracking. tblTracking records the changes so they can be uploaded to...
7
by: Justin | last post by:
I am extremely new at SQL Server2000 and t-sql and I'm looking to create a simple trigger. For explanation sake, let's say I have 3 columns in one table ... Col_1, Col_2 and Col_3. The data type...
0
by: Marko Damaschke | last post by:
Hello alltogether, i'm working on a database-plattform which should work with fail-over-technics. Therefor 2 identic machines with internal RAID are available, which work in...
3
by: Andreas | last post by:
Hello list, I suspect, this is a common issue for newbies. Is there a simple way to have an auto-updating timestamp like mysql has ? create table something ( id int4, sometext...
5
by: Chris | last post by:
I'm attempting to get Instead Of triggers working. My platform in Solaris, DB2 verison 8.1.x (not sure which). If I create two simple tables with 1 row each: create table test_cc_1 (col1...
2
by: Tomas Vera | last post by:
Hello All, I'm having problems creating a page with dynamic checkboxes in a WebApp. In my app, I need to query a database, then (based on results) add checkboxes to my form and set their...
2
by: TJ Talluto | last post by:
Instead of putting the same 12 columns on every table (these 12 columns contain info about who created the record and when, for example)... It may be more efficient to make a new table to hold that...
6
by: Marc | last post by:
How could I directly trigger a very simple on localhost and a known port listening server from my internet browser client? Local host means the little server would be running on the client machine,...
2
by: gimme_this_gimme_that | last post by:
I'm using DB2 8.1. Suppose table foo has columns name and lname: create table foo (name as varchar(200), lname as varchar(200)); Write a trigger that inserts the lower case value of name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.