Thread: Is there any eqvivalent or alternative to UPDATE(column) or COLUMNS_UPDATED() of SQLServer2000
Is there any eqvivalent or alternative to UPDATE(column) or COLUMNS_UPDATED() of SQLServer2000
From
"shreedhar"
Date:
Is there any eqvivalent or alternative to the following IF UPDATE(column) or IF(COLUMNS_UPDATED()) of SQLServer2000. IF UPDATE (column) Tests for an INSERT or UPDATE action to a specified column and is not used with DELETE operations. More than one column can be specified. Because the table name is specified in the ON clause, do not include the table name before the column name in an IF UPDATE clause. To test for an INSERT or UPDATE action for more than one column, specify a separate UPDATE(column) clause following the first one. IF UPDATE will return the TRUE value in INSERT actions because the columns have either explicit values or implicit (NULL) values inserted. IF (COLUMNS_UPDATED()) Tests, in an INSERT or UPDATE trigger only, whether the mentioned column or columns were inserted or updated. COLUMNS_UPDATED returns a varbinary bit pattern that indicates which columns in the table were inserted or updated. Thanks And Regards, Sreedhar "Faith, faith, faith in ourselves, faith, faith in God, this is the secret of greatness. If you have faith in all the three hundred and thirty millions of your mythological gods, and in all the gods which foreigners have now and again introduced into your midst, and still have no faith in yourselves, there is no salvation for you. " (III. 190)
http://www.postgresql.org/idocs/index.php?trigger-manager.html http://www.postgresql.org/idocs/index.php?plpgsql-trigger.html TG_OP ? C. shreedhar wrote, On 12/26/2002 12:57 PM: > Is there any eqvivalent or alternative to the following IF UPDATE(column) or > IF(COLUMNS_UPDATED()) of SQLServer2000. > > IF UPDATE (column) > > Tests for an INSERT or UPDATE action to a specified column and is not used > with DELETE operations. More than one column can be specified. Because the > table name is specified in the ON clause, do not include the table name > before the column name in an IF UPDATE clause. To test for an INSERT or > UPDATE action for more than one column, specify a separate UPDATE(column) > clause following the first one. IF UPDATE will return the TRUE value in > INSERT actions because the columns have either explicit values or implicit > (NULL) values inserted. > > IF (COLUMNS_UPDATED()) > > Tests, in an INSERT or UPDATE trigger only, whether the mentioned column or > columns were inserted or updated. COLUMNS_UPDATED returns a varbinary bit > pattern that indicates which columns in the table were inserted or updated. > > Thanks And Regards, > > Sreedhar
Re: Is there any eqvivalent or alternative to UPDATE(column) or COLUMNS_UPDATED()
From
Klaus Sonnenleiter
Date:
I think the question was how to find out which columns were affected by the update statement. TG_OP will only tell you whether an update fired the trigger. Klaus On Thursday 26 December 2002 03:29, CoL wrote: > http://www.postgresql.org/idocs/index.php?trigger-manager.html > http://www.postgresql.org/idocs/index.php?plpgsql-trigger.html > TG_OP ? > > C. > > shreedhar wrote, On 12/26/2002 12:57 PM: > > Is there any eqvivalent or alternative to the following IF UPDATE(column) > > or IF(COLUMNS_UPDATED()) of SQLServer2000. > > > > IF UPDATE (column) > > > > Tests for an INSERT or UPDATE action to a specified column and is not > > used with DELETE operations. More than one column can be specified. > > Because the table name is specified in the ON clause, do not include the > > table name before the column name in an IF UPDATE clause. To test for an > > INSERT or UPDATE action for more than one column, specify a separate > > UPDATE(column) clause following the first one. IF UPDATE will return the > > TRUE value in INSERT actions because the columns have either explicit > > values or implicit (NULL) values inserted. > > > > IF (COLUMNS_UPDATED()) > > > > Tests, in an INSERT or UPDATE trigger only, whether the mentioned column > > or columns were inserted or updated. COLUMNS_UPDATED returns a varbinary > > bit pattern that indicates which columns in the table were inserted or > > updated. > > > > Thanks And Regards, > > > > Sreedhar > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly
Yes, i know, I just write, that these are the possibilities. Or are there any else? C. Klaus Sonnenleiter wrote, On 12/31/2002 3:25 PM: > I think the question was how to find out which columns were affected by the > update statement. TG_OP will only tell you whether an update fired the > trigger. > > Klaus > > On Thursday 26 December 2002 03:29, CoL wrote: >> http://www.postgresql.org/idocs/index.php?trigger-manager.html >> http://www.postgresql.org/idocs/index.php?plpgsql-trigger.html >> TG_OP ? >> >> C. >> >> shreedhar wrote, On 12/26/2002 12:57 PM: >> > Is there any eqvivalent or alternative to the following IF UPDATE(column) >> > or IF(COLUMNS_UPDATED()) of SQLServer2000. >> > >> > IF UPDATE (column) >> > >> > Tests for an INSERT or UPDATE action to a specified column and is not >> > used with DELETE operations. More than one column can be specified. >> > Because the table name is specified in the ON clause, do not include the >> > table name before the column name in an IF UPDATE clause. To test for an >> > INSERT or UPDATE action for more than one column, specify a separate >> > UPDATE(column) clause following the first one. IF UPDATE will return the >> > TRUE value in INSERT actions because the columns have either explicit >> > values or implicit (NULL) values inserted. >> > >> > IF (COLUMNS_UPDATED()) >> > >> > Tests, in an INSERT or UPDATE trigger only, whether the mentioned column >> > or columns were inserted or updated. COLUMNS_UPDATED returns a varbinary >> > bit pattern that indicates which columns in the table were inserted or >> > updated. >> > >> > Thanks And Regards, >> > >> > Sreedhar >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 3: if posting/reading through Usenet, please send an appropriate >> subscribe-nomail command to majordomo@postgresql.org so that your >> message can get through to the mailing list cleanly > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster