Re: need help in PL/SQL trigger
Date: Thu, 5 Dec 2002 10:05:12 -0000
Message-ID: <asn8cp$e1q$1_at_news.icl.se>
"damorgan" <damorgan_at_exesolutions.com> wrote in message
news:3DEE7B26.4711B7C7_at_exesolutions.com...
> Sybrand Bakker wrote:
>
> > On Wed, 04 Dec 2002 16:28:46 +0000, shtng <member_at_dbforums.com> wrote:
> >
> > >I am a newbie in SQl. I need lots of help. =)
> >
> > That's why Oracle provides manuals.
> > >
> > >I am trying to create a trigger, when INSERT is done to add a new
> > >customer in CUSTOMER table, the trigger is suppose to fire and display
> > >messages to the user to enter more information.
> > >How do I display a message to the user such as "Enter Insurance info"
> > >and accept the input that will be entered in a table?
> >
> > You simply can't do that. Triggers fire in the database and have no
> > interaction with the client. You need to develop a client program to
> > allow for user input.
> >
> > Sybrand Bakker, Senior Oracle DBA
> >
> > To reply remove -verwijderdit from my e-mail address
>
> You are assuming he is in SQL*Plus. Given that this was posted in
> c.d.o.tools I was willing to grant that he might be in some version of
> Forms. But at this point I don't think the answer is clear.
>
> If you are correct ... so is your answer.
>
Even in any version of Forms he's not going to win easily. To prompt users for more input will involve use of restricted builtins in Forms to navigate to the 'pop-up' window for the extra information at the very least. You won;t get those to work in either the PRE or POST INSERT triggers. Have to code the thing in KEY-COMMIT or something. Much more difficult as you might have more than one record to worry about.
Much better to define a business rule that says a customer must already exists before transactions can be applied to them or force enough info to be entered int he first place before hte first INSERT happens. Received on Thu Dec 05 2002 - 11:05:12 CET