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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
After the call to get_disp it should just be:
dbms_output.put_line('get_disp message: ' || v_message);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.