Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help Please PL/SQL script

Re: Help Please PL/SQL script

From: C.Lussier <clussier_at_istar.ca>
Date: Mon, 19 Apr 1999 19:21:54 -0400
Message-ID: <371BBA92.18D291AE@istar.ca>


Actually, yes I noticed that after I had sent my script to the group asking for help. Also I changed the update to INSERT INTO as the changes had to go into the table. In any case, I did finally get the script to work will all the tips from the newsgroup. Thank you to all who responded and helped.

amyleone_at_my-dejanews.com wrote:
>
> > DECLARE
> > e_invalid_sc_number EXCEPTION;
> > v_sc_number sc_details.sc_number%TYPE := &p_sc_number;
> > e_invalid_line_id EXCEPTION;
> > v_line_id sc_details.line_id%TYPE := &p_line_id;
> > e_invalid_part_id EXCEPTION;
> > v_part_id sc_details.part_id%TYPE := &p_part_id;
> > e_invalid_service EXCEPTION;
> > v_service sc_details.service%TYPE := &p_service;
> > e_invalid_technician EXCEPTION;
> > v_technician sc_details.technician%TYPE := &p_technician;
> > e_invalid_hours EXCEPTION;
> > v_hours sc_details.hours%TYPE := &p_hours;
>
> I think you will have to enclose these variables in quotes like so
> '&p_hours'. Also you may have to convert some of them to numbers,
> look at the TO_NUMBER function.
>
> > BEGIN
> > UPDATE sc_details
> > WHERE sc_number = v_sc_number
> > AND line_id = v_line_id
> > AND part_id = v_line_id
> > AND service = v_service
> > AND technician = v_technician
> > AND hours = v_hours;
> > EXCEPTION
> > WHEN e_invalid_sc_number THEN
> > :g_message1 := 'Invalid sc_number';
> > WHEN e_invalid_line_id THEN
> > :g_message2 := 'Invalid line_id';
> > WHEN e_invalid_part_id THEN
> > :g_message3 := 'Invalid part_id';
> > WHEN e_invalid_service THEN
> > :g_message4 := 'Invalid service';
> > WHEN e_invalid_technician THEN
> > :g_message5 := 'Invalid technician';
> > WHEN e_invalid_hours THEN
> > :g_message6 := 'Invalid hours';
> > END;
> > /
> I'm not sure what you are trying to do with g_message. Maybe you would
> prefer to display the message to the screen, in which case you should
> look at dbms_output package.
>
> >
> > Thank you for your help.
> >
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Mon Apr 19 1999 - 18:21:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US