Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Dynamic SQL in triggers

2 posts in Product Futures Discussion Last posting was on 2002-08-29 14:59:43.0Z
Anders_P Posted on 2002-08-29 09:25:59.0Z
From: Anders_P
Date: Thu, 29 Aug 2002 05:25:59 -0400
Newsgroups: sybase.public.ase.product_futures_discussion
Subject: Dynamic SQL in triggers
Message-ID: <6D33D75B82FBD6BE0033D0F985256C24.0033D17D85256C24@webforums>
Lines: 5
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:314
Article PK: 93483

In version 12.0 it is possible to concatenate a SQL string and use the exec
command to execute it.
In a trigger, this does not seem to work if the "virtual table"
inserted/deleted is included in the SQL string.
Is there a workaround for this problem?


Bret Halford Posted on 2002-08-29 14:59:43.0Z
Message-ID: <3D6E36DF.5706B9A2@sybase.com>
Date: Thu, 29 Aug 2002 08:59:43 -0600
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Dynamic SQL in triggers
References: <6D33D75B82FBD6BE0033D0F985256C24.0033D17D85256C24@webforums>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.ase.product_futures_discussion
Lines: 12
NNTP-Posting-Host: 157.133.80.136
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.ase.product_futures_discussion:313
Article PK: 93484


Anders_P wrote:
>
> In version 12.0 it is possible to concatenate a SQL string and use the exec
> command to execute it.
> In a trigger, this does not seem to work if the "virtual table"
> inserted/deleted is included in the SQL string.
> Is there a workaround for this problem?

Before using the dynamic sql, you could insert the contents of
inserted/deleted
into a real table and refer to the real table in the dynamic sql.

-bret