Link to home
Start Free TrialLog in
Avatar of anumoses
anumosesFlag for United States of America

asked on

Orale one time sql script

ORACLE ONE TIME SQL SCRIPT

I have a script where I call for a package.procedure as below

FUNCTION get_disp (in_bltitm_id         IN     NUMBER,
                      in_cust_id           IN     NUMBER,
                      in_proj_id           IN     NUMBER  ,
                      in_return_to_wc      IN     VARCHAR2    ,
                      in_tab_result_spec   IN     t_result_spec  ,
                      in_dehdr_id          IN     NUMBER,
                      out_message             OUT VARCHAR2   ,
                      out_tab_disp         IN OUT t_disp)
      RETURN NUMBER

Open in new window


My question is about the out_message. In the package I have the code as

IF out_success = 0
      THEN
         out_message :=
            'An error occurred processing dispositions.  Information sent to the IT department.';
      ELSIF out_success = 1
      THEN
         out_message := 'No disposition found for the item.';
      ELSIF out_success = 2
      THEN
         out_message := 'Disposition found and processed successfully.';

Open in new window


In my script I want to put a dbms output to get something like this. How can I do that?
load_inventory.sql
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anumoses

ASKER

thanks

I kid of added this
Instead of  v_success :=  calling the package, I used v_get_disp. and the below.

IF v_get_disp = 2 THEN
                            v_success := TRUE;  
                            v_cnt := v_cnt + 1;
                            dbms_output.put_line('Disposition found and processed successfully...: ' ||  v_get_disp  );          
                        ELSIF v_get_disp = 1 THEN      
                                v_success := false;
                                 v_cnt1 := v_cnt1 + 1;
                                dbms_output.put_line('There are no Disposition Actions..: ' ||  v_get_disp  );            
                        ELSE
                            v_success:=false;
                            v_cnt1 := v_cnt1 + 1;
                            dbms_output.put_line('Error creating Disposition Actions..: ' ||  v_get_disp  );
                           
                        END IF;