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.

Pass parms into procedure?

6 posts in Trigger Last posting was on 2004-05-05 12:18:59.0Z
Andrew Simmons Posted on 2004-04-28 20:28:08.0Z
From: "Andrew Simmons" <asimmons@rivertree1.com>
Newsgroups: Advantage.Trigger
Subject: Pass parms into procedure?
Date: Wed, 28 Apr 2004 16:28:08 -0400
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 24.164.73.146
Message-ID: <4090155d@solutions.advantagedatabase.com>
X-Trace: 28 Apr 2004 14:34:37 -0700, 24.164.73.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!24.164.73.146
Xref: solutions.advantagedatabase.com Advantage.Trigger:50
Article PK: 1136117

I want to run a stored procedure in my before insert trigger. The stored
proc takes 2 parameters, an integer and date/time, which I need to get from
the __new table. Does anyone know the correct way to do this? The
following gives me an error:

EXECUTE PROCEDURE sp_GetNextValue(
SELECT MyID FROM __new,
SELECT MyDATE FROM __new)


Thanks,


Drew


Alex Wong (ADS) Posted on 2004-05-03 20:05:25.0Z
From: "Alex Wong \(ADS\)" <alexw@extendsys.com>
Newsgroups: Advantage.Trigger
References: <4090155d@solutions.advantagedatabase.com>
Subject: Re: Pass parms into procedure?
Date: Mon, 3 May 2004 14:05:25 -0600
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 198.102.102.20
Message-ID: <4096a6d3@solutions.advantagedatabase.com>
X-Trace: 3 May 2004 14:08:51 -0700, 198.102.102.20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.20
Xref: solutions.advantagedatabase.com Advantage.Trigger:51
Article PK: 1136118

That won't work. Have you considered simply open the __new table in the
stored procedure to get those value?

Alex

"Andrew Simmons" <asimmons@rivertree1.com> wrote in message
news:4090155d@solutions.advantagedatabase.com...
> I want to run a stored procedure in my before insert trigger. The stored
> proc takes 2 parameters, an integer and date/time, which I need to get
from
> the __new table. Does anyone know the correct way to do this? The
> following gives me an error:
>
> EXECUTE PROCEDURE sp_GetNextValue(
> SELECT MyID FROM __new,
> SELECT MyDATE FROM __new)
>
>
> Thanks,
>
>
> Drew
>
>
>


Andrew Simmons Posted on 2004-05-03 23:38:55.0Z
From: "Andrew Simmons" <asimmons@rivertree1.com>
Newsgroups: Advantage.Trigger
References: <4090155d@solutions.advantagedatabase.com> <4096a6d3@solutions.advantagedatabase.com>
Subject: Re: Pass parms into procedure?
Date: Mon, 3 May 2004 19:38:55 -0400
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 24.164.73.146
Message-ID: <4096d9b3@solutions.advantagedatabase.com>
X-Trace: 3 May 2004 17:45:55 -0700, 24.164.73.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!24.164.73.146
Xref: solutions.advantagedatabase.com Advantage.Trigger:53
Article PK: 1136119

OK, I see what you mean. That worked. For future reference, is there any
way to get those values out of the __new/__old tables and use them, entirely
within the trigger?

"Alex Wong (ADS)" <alexw@extendsys.com> wrote in message
news:4096a6d3@solutions.advantagedatabase.com...
> That won't work. Have you considered simply open the __new table in the
> stored procedure to get those value?
>
> Alex
>
> "Andrew Simmons" <asimmons@rivertree1.com> wrote in message
> news:4090155d@solutions.advantagedatabase.com...
> > I want to run a stored procedure in my before insert trigger. The
stored
> > proc takes 2 parameters, an integer and date/time, which I need to get
> from
> > the __new table. Does anyone know the correct way to do this? The
> > following gives me an error:
> >
> > EXECUTE PROCEDURE sp_GetNextValue(
> > SELECT MyID FROM __new,
> > SELECT MyDATE FROM __new)
> >
> >
> > Thanks,
> >
> >
> > Drew
> >
> >
> >
>
>


Alex Wong (ADS) Posted on 2004-05-04 21:34:32.0Z
From: "Alex Wong \(ADS\)" <alexw@extendsys.com>
Newsgroups: Advantage.Trigger
References: <4090155d@solutions.advantagedatabase.com> <4096a6d3@solutions.advantagedatabase.com> <4096d9b3@solutions.advantagedatabase.com>
Subject: Re: Pass parms into procedure?
Date: Tue, 4 May 2004 15:34:32 -0600
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 198.102.102.20
Message-ID: <40980d21@solutions.advantagedatabase.com>
X-Trace: 4 May 2004 15:37:37 -0700, 198.102.102.20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.20
Xref: solutions.advantagedatabase.com Advantage.Trigger:54
Article PK: 1136121

Basically, you want the __new and __old tables to be implicitly opened in
the trigger script. Without giving too much thought, that seems like a good
idea to me. I will enter this into the customer suggestion list for possible
future implementation.

Alex

"Andrew Simmons" <asimmons@rivertree1.com> wrote in message
news:4096d9b3@solutions.advantagedatabase.com...
> OK, I see what you mean. That worked. For future reference, is there any
> way to get those values out of the __new/__old tables and use them,
entirely
> within the trigger?
>
>
>
>
> "Alex Wong (ADS)" <alexw@extendsys.com> wrote in message
> news:4096a6d3@solutions.advantagedatabase.com...
> > That won't work. Have you considered simply open the __new table in the
> > stored procedure to get those value?
> >
> > Alex
> >
> > "Andrew Simmons" <asimmons@rivertree1.com> wrote in message
> > news:4090155d@solutions.advantagedatabase.com...
> > > I want to run a stored procedure in my before insert trigger. The
> stored
> > > proc takes 2 parameters, an integer and date/time, which I need to get
> > from
> > > the __new table. Does anyone know the correct way to do this? The
> > > following gives me an error:
> > >
> > > EXECUTE PROCEDURE sp_GetNextValue(
> > > SELECT MyID FROM __new,
> > > SELECT MyDATE FROM __new)
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Drew
> > >
> > >
> > >
> >
> >
>
>


Andrew Simmons Posted on 2004-05-05 12:18:59.0Z
From: "Andrew Simmons" <asimmons@rivertree1.com>
Newsgroups: Advantage.Trigger
References: <4090155d@solutions.advantagedatabase.com> <4096a6d3@solutions.advantagedatabase.com> <4096d9b3@solutions.advantagedatabase.com> <40980d21@solutions.advantagedatabase.com>
Subject: Re: Pass parms into procedure?
Date: Wed, 5 May 2004 08:18:59 -0400
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 24.164.73.146
Message-ID: <4098dd61@solutions.advantagedatabase.com>
X-Trace: 5 May 2004 06:26:09 -0700, 24.164.73.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!24.164.73.146
Xref: solutions.advantagedatabase.com Advantage.Trigger:55
Article PK: 1136123

Implicitly or not, it doesn't matter. Just some way to get to those values
and use them later in the script.

"Alex Wong (ADS)" <alexw@extendsys.com> wrote in message
news:40980d21@solutions.advantagedatabase.com...
> Basically, you want the __new and __old tables to be implicitly opened in
> the trigger script. Without giving too much thought, that seems like a
good
> idea to me. I will enter this into the customer suggestion list for
possible
> future implementation.
>
> Alex
>
>
> "Andrew Simmons" <asimmons@rivertree1.com> wrote in message
> news:4096d9b3@solutions.advantagedatabase.com...
> > OK, I see what you mean. That worked. For future reference, is there
any
> > way to get those values out of the __new/__old tables and use them,
> entirely
> > within the trigger?
> >
> >
> >
> >
> > "Alex Wong (ADS)" <alexw@extendsys.com> wrote in message
> > news:4096a6d3@solutions.advantagedatabase.com...
> > > That won't work. Have you considered simply open the __new table in
the
> > > stored procedure to get those value?
> > >
> > > Alex
> > >
> > > "Andrew Simmons" <asimmons@rivertree1.com> wrote in message
> > > news:4090155d@solutions.advantagedatabase.com...
> > > > I want to run a stored procedure in my before insert trigger. The
> > stored
> > > > proc takes 2 parameters, an integer and date/time, which I need to
get
> > > from
> > > > the __new table. Does anyone know the correct way to do this? The
> > > > following gives me an error:
> > > >
> > > > EXECUTE PROCEDURE sp_GetNextValue(
> > > > SELECT MyID FROM __new,
> > > > SELECT MyDATE FROM __new)
> > > >
> > > >
> > > > Thanks,
> > > >
> > > >
> > > > Drew
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Andrew Simmons Posted on 2004-05-03 22:34:32.0Z
From: "Andrew Simmons" <asimmons@rivertree1.com>
Newsgroups: Advantage.Trigger
References: <4090155d@solutions.advantagedatabase.com> <4096a6d3@solutions.advantagedatabase.com>
Subject: Re: Pass parms into procedure?
Date: Mon, 3 May 2004 18:34:32 -0400
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 24.164.73.146
Message-ID: <4096ca9e@solutions.advantagedatabase.com>
X-Trace: 3 May 2004 16:41:34 -0700, 24.164.73.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!24.164.73.146
Xref: solutions.advantagedatabase.com Advantage.Trigger:52
Article PK: 1136120

So how is that done within a trigger? I tried the following and it didn't
work either:

EXECUTE PROCEDURE sp_GetNextValue(__new.MyID, __new.MyDATE);

"Alex Wong (ADS)" <alexw@extendsys.com> wrote in message
news:4096a6d3@solutions.advantagedatabase.com...
> That won't work. Have you considered simply open the __new table in the
> stored procedure to get those value?
>
> Alex
>
> "Andrew Simmons" <asimmons@rivertree1.com> wrote in message
> news:4090155d@solutions.advantagedatabase.com...
> > I want to run a stored procedure in my before insert trigger. The
stored
> > proc takes 2 parameters, an integer and date/time, which I need to get
> from
> > the __new table. Does anyone know the correct way to do this? The
> > following gives me an error:
> >
> > EXECUTE PROCEDURE sp_GetNextValue(
> > SELECT MyID FROM __new,
> > SELECT MyDATE FROM __new)
> >
> >
> > Thanks,
> >
> >
> > Drew
> >
> >
> >
>
>