SQL TRIGGER with 4GL STOP CONDITION HELP

Sean,

Thanks.... I see the problem... I was staring at the statement so long i missed the error (Select from selected....) It should say select from inserted)

Appreciate the help

--- In vantage@yahoogroups.com, "Sean McDaniel" <smcdaniel@...> wrote:
>
> I might be missing something, but I'm not sure why your trigger would be
> trying to return a value.
>
> Typically your trigger would update the inserted.<column>
>
>
>
> Typically I'd try an insert of my own within SQL to see what happens.
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
> Of Joshua
> Sent: Thursday, May 27, 2010 9:20 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] SQL TRIGGER with 4GL STOP CONDITION HELP
>
>
>
>
>
> So I'm attempting to run a trigger on the Jobmtl Table.
>
> The trigger purpose isn't important at this time because I'm getting
> this 4GL stop condition error in Epicor.
>
> Eventually the trigger will grab the Vendor Part from the Vendpart table
> and update a character field in the Jobmtl table so that engineers can
> have access to the the vendor part#.
>
> The trigger at the moment just grabs the part from the Inserted Record.
> Thats it. Every time i add a record in Epicor i get the 4GL STOP
> CONDITION ERROR. The trigger is run outside of EPICOR how and why would
> Epicor be giving an Error. Especially if the Trigger was After the
> Insert..
>
> here is the trigger code.... (on the JOBMTL Table)
>
> ALTER TRIGGER [VENDOR_PART]
> ON [dbo].[jobmtl]
> AFTER UPDATE, INSERT
> AS
>
> DECLARE @partnum varchar(50)
>
> BEGIN
>
> select @partnum=partnum from selected
>
>
> END
>
> Any help on this would be greatly appreciated....
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
So I'm attempting to run a trigger on the Jobmtl Table.

The trigger purpose isn't important at this time because I'm getting this 4GL stop condition error in Epicor.

Eventually the trigger will grab the Vendor Part from the Vendpart table and update a character field in the Jobmtl table so that engineers can have access to the the vendor part#.

The trigger at the moment just grabs the part from the Inserted Record.
Thats it. Every time i add a record in Epicor i get the 4GL STOP CONDITION ERROR. The trigger is run outside of EPICOR how and why would Epicor be giving an Error. Especially if the Trigger was After the Insert..

here is the trigger code.... (on the JOBMTL Table)


ALTER TRIGGER [VENDOR_PART]
ON [dbo].[jobmtl]
AFTER UPDATE, INSERT
AS

DECLARE @partnum varchar(50)


BEGIN

select @partnum=partnum from selected


END



Any help on this would be greatly appreciated....
I might be missing something, but I'm not sure why your trigger would be
trying to return a value.

Typically your trigger would update the inserted.<column>



Typically I'd try an insert of my own within SQL to see what happens.





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Joshua
Sent: Thursday, May 27, 2010 9:20 AM
To: vantage@yahoogroups.com
Subject: [Vantage] SQL TRIGGER with 4GL STOP CONDITION HELP





So I'm attempting to run a trigger on the Jobmtl Table.

The trigger purpose isn't important at this time because I'm getting
this 4GL stop condition error in Epicor.

Eventually the trigger will grab the Vendor Part from the Vendpart table
and update a character field in the Jobmtl table so that engineers can
have access to the the vendor part#.

The trigger at the moment just grabs the part from the Inserted Record.
Thats it. Every time i add a record in Epicor i get the 4GL STOP
CONDITION ERROR. The trigger is run outside of EPICOR how and why would
Epicor be giving an Error. Especially if the Trigger was After the
Insert..

here is the trigger code.... (on the JOBMTL Table)

ALTER TRIGGER [VENDOR_PART]
ON [dbo].[jobmtl]
AFTER UPDATE, INSERT
AS

DECLARE @partnum varchar(50)

BEGIN

select @partnum=partnum from selected


END

Any help on this would be greatly appreciated....





[Non-text portions of this message have been removed]
Hi
You can't use the statement
select @partnum=partnum from selected
try this
select @partnum=partnum from inserted


Stelios


--------------------------------------------
Stelios Zoumis
Senior ERP Consultant
ATC S.A. Financial Products & Solutions Department
Tel: +30 210 6874300 Fax: +30 210 6855564
10, Rizariou str, 152 33 Halandri, Athens, GREECE
E-mail <<<mailto:s.zoumis@...<blocked::blocked::mailto:s.zoumis@...>>>>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Joshua
Sent: Thursday, May 27, 2010 4:20 PM
To: vantage@yahoogroups.com
Subject: [Vantage] SQL TRIGGER with 4GL STOP CONDITION HELP



So I'm attempting to run a trigger on the Jobmtl Table.

The trigger purpose isn't important at this time because I'm getting this 4GL stop condition error in Epicor.

Eventually the trigger will grab the Vendor Part from the Vendpart table and update a character field in the Jobmtl table so that engineers can have access to the the vendor part#.

The trigger at the moment just grabs the part from the Inserted Record.
Thats it. Every time i add a record in Epicor i get the 4GL STOP CONDITION ERROR. The trigger is run outside of EPICOR how and why would Epicor be giving an Error. Especially if the Trigger was After the Insert..

here is the trigger code.... (on the JOBMTL Table)

ALTER TRIGGER [VENDOR_PART]
ON [dbo].[jobmtl]
AFTER UPDATE, INSERT
AS

DECLARE @partnum varchar(50)

BEGIN

select @partnum=partnum from selected


END

Any help on this would be greatly appreciated....



[Non-text portions of this message have been removed]
You can also check the Server Logs when you get those 4GL Stop Condition Errors. There will be a more detailed explanation of what the problem is that is very useful in troubleshooting.

--- In vantage@yahoogroups.com, Stelios Zoumis <s.zoumis@...> wrote:
>
> Hi
> You can't use the statement
> select @partnum=partnum from selected
> try this
> select @partnum=partnum from inserted
>
>
> Stelios
>
>
> --------------------------------------------
> Stelios Zoumis
> Senior ERP Consultant
> ATC S.A. Financial Products & Solutions Department
> Tel: +30 210 6874300 Fax: +30 210 6855564
> 10, Rizariou str, 152 33 Halandri, Athens, GREECE
> E-mail <<<mailto:s.zoumis@...<blocked::blocked::mailto:s.zoumis@...>>>>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Joshua
> Sent: Thursday, May 27, 2010 4:20 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] SQL TRIGGER with 4GL STOP CONDITION HELP
>
>
>
> So I'm attempting to run a trigger on the Jobmtl Table.
>
> The trigger purpose isn't important at this time because I'm getting this 4GL stop condition error in Epicor.
>
> Eventually the trigger will grab the Vendor Part from the Vendpart table and update a character field in the Jobmtl table so that engineers can have access to the the vendor part#.
>
> The trigger at the moment just grabs the part from the Inserted Record.
> Thats it. Every time i add a record in Epicor i get the 4GL STOP CONDITION ERROR. The trigger is run outside of EPICOR how and why would Epicor be giving an Error. Especially if the Trigger was After the Insert..
>
> here is the trigger code.... (on the JOBMTL Table)
>
> ALTER TRIGGER [VENDOR_PART]
> ON [dbo].[jobmtl]
> AFTER UPDATE, INSERT
> AS
>
> DECLARE @partnum varchar(50)
>
> BEGIN
>
> select @partnum=partnum from selected
>
>
> END
>
> Any help on this would be greatly appreciated....
>
>
>
> [Non-text portions of this message have been removed]
>