[SQL] Start up question about triggers

2006-06-22 Thread Forums @ Existanze
Hello all,   I know that this question may be really simple, but I have decided to ask here due to fact that I don't know how to search for this on google or on the docs.   I created a trigger fuction which updates a specific row in some table A. Is it possible to retain the query that was

Re: [SQL] Start up question about triggers

2006-06-22 Thread Forums @ Existanze
Sorry This is the complete message   Hello all,   I know that this question may be really simple, but I have decided to ask here due to fact that I don't know how to search for this on google or on the docs.   I created a trigger fuction which updates a specific row in some table A. Is it p

Re: [SQL] Date ranges + DOW select question

2006-06-22 Thread Aaron Bono
I am a little confused.  Where are you casting dateStart and dateEnd?  I don't see either in your query.  I assume dayOfWeek is a number between 0 and 6, or maybe not?A little more detail would help.Thanks, Aaron BonoOn 6/15/06, joseppi c <[EMAIL PROTECTED]> wrote: Hi,I have a table which contains

Re: [SQL] join on next row

2006-06-22 Thread Aaron Bono
I would use a stored procedure or function for this.  You order your results first by employee and then event date and finally even time.  Then you create a new result set from the first and return that.That would probably be the most straight forward approach. You could also try doing some thing l

Re: [SQL] Start up question about triggers

2006-06-22 Thread Aaron Bono
Why not just create a history table and have the trigger copy the data out of the table into the history table with a time stamp of the change.  Then you don't need the query.For exampleTable Aa_id,a_value1, a_value2Table A_hista_id,a_dt,a_value1,a_value2Then A_hist has a PK of a_id, a_dtThis would

Re: [SQL] Start up question about triggers

2006-06-22 Thread Forums @ Existanze
Thank you for your answer,   We had though about your solution, the problem is that we have around 80 tables at the moment so your method would suggest adding another 80.   I was wondering if it was possible to retrieve the query in the trigger function, cause what we wanted to achieve was to

Fwd: [SQL] Start up question about triggers

2006-06-22 Thread Aaron Bono
I did some research and can't even find a way to get meta data in a trigger.In a trigger, is there a way to inspect OLD and NEW to see what columns are there and see what has changed?  If so, you may not be able to grab the actual query but you could create a generic trigger that reconstructs a pos

Re: Fwd: [SQL] Start up question about triggers

2006-06-22 Thread Richard Broersma Jr
> I did some research and can't even find a way to get meta data in a trigger. > > In a trigger, is there a way to inspect OLD and NEW to see what columns are > there and see what has changed? If so, you may not be able to grab the > actual query but you could create a generic trigger that recons