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
LVL 6
anumosesAsked:
Who is Participating?
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
After the call to get_disp it should just be:
dbms_output.put_line('get_disp message: ' || v_message);
0
 
anumosesAuthor Commented:
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;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.