Re: [U2] Trigger questions

2011-03-31 Thread Charlie Noah
Come on, Doug, you know documentation is usually treated as an 
afterthought -  way behind the software and usually incomplete. I'm glad 
you got your trigger working.


Now, since I have no interest in learning Java, am I 1 or 10 of those 
people? ;^)


Charlie

On 03-31-2011 10:55 AM, Doug Chanco wrote:

Thank you very much this was extremely helpful info

I have it working but does anyone besides me think the trigger info in the 
sysdesc manual is not very helpful?

I did not see any reference to setdiagnostics and why is there no pick syntax 
for working with triggers?

The SQL syntax works fine once you get used to it

Anyway thanks to everyone for their help and yes outside my world there are 
those that do not like or want to
Learn java 

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those 
that do not.  Along the same lines there are those who know java and those who 
want to learn java ..

On Mar 30, 2011, at 20:29, Boydell, Stuartstuart.boyd...@spotless.com.au  
wrote:


If you want to force the trigger to issue a rollback I think you need to 
execute the SetDiagnostics function.

Something like...
subroutine TRIGGER.HANDLER(triggerName,schema,tableName,
   event,eventTime,
   newRecordID,newRecord,oldRecordID,oldRecord,
   association,associationEvent,
   triggerCount,chainCascade,cascade)

if someCheckCondition then
call updateThirdPartyApp(xxx, returnStatus)
if returnStatus  0 then
*// rollback and gracefully end processing.
z = setDiagnostics('[999] Third Party App update failed with: ': returnStatus)
end
end
return
end




-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Chanco
Sent: Thursday, 31 March 2011 03:05
To: U2 Users List
Subject: [U2] Trigger questions

I am sure I can do this but I am trying to figure out the best way 

I need to write a WRITE trigger that does the following

Call a java web service to update an SQL table (no problem)

But if the update fails do NOT update the pick record and if possible notify 
the user

My question is what would be the best method/way to do this?

Do triggers use transaction logging that I could roll back the record or should 
I do something more manual? Copy the record (for example)

Any thoughts/suggestions/ideas welcomed and appreciated

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those 
that do not.  Along the same lines there are those who know java and those who 
want to learn java ..
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users



___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-31 Thread Doug Chanco
While it's working I am getting back:

[error] SQL update failed

 good

But I am also seeing

Error performing trigger for customer 

 but It works the record is not updated

Write failure 
 good

Any idea on why I am getting the error performing trigger when it's obvious 
it's working?

Thanks

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those 
that do not.  Along the same lines there are those who know java and those who 
want to learn java ..

On Mar 31, 2011, at 11:55, Doug Chanco d...@chancofamily.com wrote:

 Thank you very much this was extremely helpful info
 
 I have it working but does anyone besides me think the trigger info in the 
 sysdesc manual is not very helpful?
 
 I did not see any reference to setdiagnostics and why is there no pick 
 syntax for working with triggers?
 
 The SQL syntax works fine once you get used to it
 
 Anyway thanks to everyone for their help and yes outside my world there are 
 those that do not like or want to
 Learn java 
 
 Dougc
 
 email signature
 
 There are 10 kinds of people in the world, those that know binary and those 
 that do not.  Along the same lines there are those who know java and those 
 who want to learn java ..
 
 On Mar 30, 2011, at 20:29, Boydell, Stuart stuart.boyd...@spotless.com.au 
 wrote:
 
 If you want to force the trigger to issue a rollback I think you need to 
 execute the SetDiagnostics function.
 
 Something like...
 subroutine TRIGGER.HANDLER(triggerName,schema,tableName,
  event,eventTime,
  newRecordID,newRecord,oldRecordID,oldRecord,
  association,associationEvent,
  triggerCount,chainCascade,cascade)
 
 if someCheckCondition then
 call updateThirdPartyApp(xxx, returnStatus)
 if returnStatus  0 then
 *// rollback and gracefully end processing.
 z = setDiagnostics('[999] Third Party App update failed with: ': 
 returnStatus)
 end
 end
 return
 end
 
 
 
 
 -Original Message-
 From: u2-users-boun...@listserver.u2ug.org 
 [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Chanco
 Sent: Thursday, 31 March 2011 03:05
 To: U2 Users List
 Subject: [U2] Trigger questions
 
 I am sure I can do this but I am trying to figure out the best way 
 
 I need to write a WRITE trigger that does the following
 
 Call a java web service to update an SQL table (no problem)
 
 But if the update fails do NOT update the pick record and if possible notify 
 the user
 
 My question is what would be the best method/way to do this?
 
 Do triggers use transaction logging that I could roll back the record or 
 should I do something more manual? Copy the record (for example)
 
 Any thoughts/suggestions/ideas welcomed and appreciated
 
 Dougc
 
 email signature
 
 There are 10 kinds of people in the world, those that know binary and those 
 that do not.  Along the same lines there are those who know java and those 
 who want to learn java ..
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
 
 
 
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-31 Thread Hona, David

When/if you upgrade to UV 11.1 - perhaps you should use Index-based triggers - 
now supported by Rocket. Simpler than SQL-style triggers... see the new 
features.pdf in UV 11.1. Excerpt:

In some circumstances, an application may not require all of the capabilities 
available to conventional triggers. In these cases, index-based subroutines may 
serve the purpose better because they have reduced overhead, which may 
translate to better performance.


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Chanco
Sent: Friday, 1 April 2011 3:19 AM
To: U2 Users List
Subject: Re: [U2] Trigger questions

While it's working I am getting back:

[error] SQL update failed

 good

But I am also seeing

Error performing trigger for customer 

 but It works the record is not updated

Write failure 
 good

Any idea on why I am getting the error performing trigger when it's obvious 
it's working?

Thanks

Dougc


** IMPORTANT MESSAGE *   
This e-mail message is intended only for the addressee(s) and contains 
information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, 
do not use or
disclose the contents, and delete the message and any attachments from your 
system. Unless
specifically indicated, this email does not constitute formal advice or 
commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please 
reply to this
e-mail by typing Unsubscribe in the subject line. 
**



___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Kevin King
Unidata or Universe?
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Steve Romanow
This is what EDA is for isnt it?

On Wed, Mar 30, 2011 at 12:10 PM, Kevin King precisonl...@gmail.com wrote:
 Unidata or Universe?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Charlie Noah

Eating Disorders Anonymous??? ;-)

Sorry, couldn't resist.

Charlie Noah

On 03-30-2011 11:20 AM, Steve Romanow wrote:

This is what EDA is for isnt it?

On Wed, Mar 30, 2011 at 12:10 PM, Kevin Kingprecisonl...@gmail.com  wrote:

Unidata or Universe?
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Colin Alfke
By definition - if you're creating a write trigger the first parameter is
the status.

From Developing UniBasic Applications
SUBROUTINE trigname(execstat, dictflag, filename, record.ID.expr, recordval)
execstat
The execution status returned by the trigger subroutine:
0 - No updates are allowed.
1 - Updates are allowed.
2 - Updates are allowed, using the return recordval.

So if your before update trigger passes back a 0 as the execstat the write
won't be performed. You'll just need to make sure the process calling the
write can then deal with it.

Hth
Colin Alfke
Calgary, Canada

-Original Message-
From: Doug Chanco

I am sure I can do this but I am trying to figure out the best way 

I need to write a WRITE trigger that does the following

Call a java web service to update an SQL table (no problem)

But if the update fails do NOT update the pick record and if possible notify
the user

My question is what would be the best method/way to do this?

Do triggers use transaction logging that I could roll back the record or
should I do something more manual? Copy the record (for example)

Any thoughts/suggestions/ideas welcomed and appreciated

Dougc


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Marc Harbeson
deal with it means ON ERROR clause



-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Colin Alfke
Sent: Wednesday, March 30, 2011 12:42 PM
To: 'U2 Users List'
Subject: Re: [U2] Trigger questions

By definition - if you're creating a write trigger the first parameter is
the status.

From Developing UniBasic Applications
SUBROUTINE trigname(execstat, dictflag, filename, record.ID.expr, recordval)
execstat
The execution status returned by the trigger subroutine:
0 - No updates are allowed.
1 - Updates are allowed.
2 - Updates are allowed, using the return recordval.

So if your before update trigger passes back a 0 as the execstat the write
won't be performed. You'll just need to make sure the process calling the
write can then deal with it.

Hth
Colin Alfke
Calgary, Canada

-Original Message-
From: Doug Chanco

I am sure I can do this but I am trying to figure out the best way 

I need to write a WRITE trigger that does the following

Call a java web service to update an SQL table (no problem)

But if the update fails do NOT update the pick record and if possible notify
the user

My question is what would be the best method/way to do this?

Do triggers use transaction logging that I could roll back the record or
should I do something more manual? Copy the record (for example)

Any thoughts/suggestions/ideas welcomed and appreciated

Dougc


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Lettau, Jeff
Does anyone have EDA working to SQL yet? 

Jeffrey Lettau
ERP Systems Manager
polkaudio 


-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Steve Romanow
Sent: Wednesday, March 30, 2011 12:21 PM
To: U2 Users List
Subject: Re: [U2] Trigger questions

This is what EDA is for isnt it?

On Wed, Mar 30, 2011 at 12:10 PM, Kevin King precisonl...@gmail.com wrote:
 Unidata or Universe?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users




Disclaimer: This email may contain confidential and/or privileged information. 
It is intended only for the person or persons to whom it is addressed. Any 
unauthorized review, use, or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email or telephone and 
destroy all copies of the original message.

Please consider the environment before printing this email.
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Doug Chanco
Sorry it's universe on aix but can also be tested/run on windows and Linux 

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those 
that do not.  Along the same lines there are those who know java and those who 
want to learn java ..

On Mar 30, 2011, at 12:10, Kevin King precisonl...@gmail.com wrote:

 Unidata or Universe?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread David A. Green
Doug,

In UniData you can test for STATUS() after the ON ERROR of a WRITE command.
If the STATUS() is 2 then the WRITE failed in the Trigger.  You can also set
@USER.RETURN.CODE or use a COMMON variable to pass the error code/message.

David A. Green
(480) 813-1725
DAG Consulting


-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Chanco
Sent: Wednesday, March 30, 2011 11:03 AM
To: U2 Users List
Cc: U2 Users List
Subject: Re: [U2] Trigger questions

Sorry it's universe on aix but can also be tested/run on windows and Linux 

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those
that do not.  Along the same lines there are those who know java and those
who want to learn java ..

On Mar 30, 2011, at 12:10, Kevin King precisonl...@gmail.com wrote:

 Unidata or Universe?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread FFT2001
In a message dated 3/30/2011 11:03:07 AM Pacific Daylight Time, 
d...@chancofamily.com writes:


 There are 10 kinds of people in the world, those that know binary and 
 those that do not.  Along the same lines there are those who know java and 
 those who want to learn java ..
 

You mean there are no people who don't want to learn java?
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Steve Romanow
me, me, there is at least one!   :)

On Wed, Mar 30, 2011 at 2:32 PM,  fft2...@aol.com wrote:
 In a message dated 3/30/2011 11:03:07 AM Pacific Daylight Time,
 d...@chancofamily.com writes:


 There are 10 kinds of people in the world, those that know binary and
 those that do not.  Along the same lines there are those who know java and
 those who want to learn java ..


 You mean there are no people who don't want to learn java?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Charlie Noah

Make that 2!!!

Charlie Noah


On 03-30-2011 1:59 PM, Steve Romanow wrote:

me, me, there is at least one!   :)

On Wed, Mar 30, 2011 at 2:32 PM,fft2...@aol.com  wrote:

In a message dated 3/30/2011 11:03:07 AM Pacific Daylight Time,
d...@chancofamily.com writes:



There are 10 kinds of people in the world, those that know binary and
those that do not.  Along the same lines there are those who know java and
those who want to learn java ..


You mean there are no people who don't want to learn java?
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread BNeylon
Yeah, 10


Bruce M Neylon
Health Care Management Group 



From:   Charlie Noah cwn...@comcast.net
To: U2 Users List u2-users@listserver.u2ug.org
Date:   03/30/2011 03:13 PM
Subject:Re: [U2] Trigger questions
Sent by:u2-users-boun...@listserver.u2ug.org



Make that 2!!!

Charlie Noah


On 03-30-2011 1:59 PM, Steve Romanow wrote:
 me, me, there is at least one!   :)

 On Wed, Mar 30, 2011 at 2:32 PM,fft2...@aol.com  wrote:
 In a message dated 3/30/2011 11:03:07 AM Pacific Daylight Time,
 d...@chancofamily.com writes:


 There are 10 kinds of people in the world, those that know binary and
 those that do not.  Along the same lines there are those who know java 
and
 those who want to learn java ..

 You mean there are no people who don't want to learn java?
 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users

 ___
 U2-Users mailing list
 U2-Users@listserver.u2ug.org
 http://listserver.u2ug.org/mailman/listinfo/u2-users

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Trigger questions

2011-03-30 Thread Boydell, Stuart
If you want to force the trigger to issue a rollback I think you need to 
execute the SetDiagnostics function.

Something like...
subroutine TRIGGER.HANDLER(triggerName,schema,tableName,
   event,eventTime,
   newRecordID,newRecord,oldRecordID,oldRecord,
   association,associationEvent,
   triggerCount,chainCascade,cascade)

if someCheckCondition then
call updateThirdPartyApp(xxx, returnStatus)
if returnStatus  0 then
*// rollback and gracefully end processing.
z = setDiagnostics('[999] Third Party App update failed with: ': returnStatus)
end
end
return
end




-Original Message-
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Chanco
Sent: Thursday, 31 March 2011 03:05
To: U2 Users List
Subject: [U2] Trigger questions

I am sure I can do this but I am trying to figure out the best way 

I need to write a WRITE trigger that does the following

Call a java web service to update an SQL table (no problem)

But if the update fails do NOT update the pick record and if possible notify 
the user

My question is what would be the best method/way to do this?

Do triggers use transaction logging that I could roll back the record or should 
I do something more manual? Copy the record (for example)

Any thoughts/suggestions/ideas welcomed and appreciated

Dougc

email signature

There are 10 kinds of people in the world, those that know binary and those 
that do not.  Along the same lines there are those who know java and those who 
want to learn java ..
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users



___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users