Advertisement

07.31.2008 at 06:22PM PDT, ID: 23612991
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

Need assistance making a Query with array parameters in SQL-Plus to work...can any SQLplus guru render some help?

Asked by Enuda in SQL Query Syntax, Oracle 10.x

Tags: , , , , ,

Hi all,
I have a piece of SQL PLUS code that I am trying to make it work with little success. It is to be executed in a SQL PLUS environment and I need help with it...

The purpose of this code is to call a store procedure with parameter array and successfully return required data values. The part of the code that is giving me the blues is as follows:

DECLARE
  IN_FSFN_OBJECTS_ARRAY AMSCIC.FSFN_OBJECT_ARRAY := AMSCIC.FSFN_OBJECT_ARRAY();
 fsfn1  AMSCIC.fsfn_object_array_type := AMSCIC.fsfn_object_array_type(null,null);
cursor curDisposed is

select work_item_id,familY_safety_id
from amscic.work_item_t
where status_code = 'D'
and status_reason_code in ('APP','DEN'); recDisposed curDisposed%rowtype; i number(3) := 1; BEGIN for recDisposed in curDisposed loop

fsfn1:
=AMSCIC.fsfn_object_array_type(recDisposed.family_safety_id,recdisposed.work_item_id);
        IN_FSFN_OBJECTS_ARRAY.extend;
        IN_FSFN_OBJECTS_ARRAY(i) := fsfn1;
      i := i+1;
end loop;

--Modify the code to initialize this parameter

  FOR rec in (SELECT * FROM

TABLE(CAST(AMSCIC.FAMILY_SAFETY_WORK_PKG.GET_DISPOSED_APPLICATIONS_FNC(IN_FSFN_OBJECTS_ARRAY)
 AS AMSCIC.DISPOSED_APPLICATION_T)))
  LOOP
dbms_output.put_line('work item is ' ||  rec.work_item_id); dbms_output.put_line('case number is ' ||  rec.case_number);
    EXIT WHEN 1=1;
  END LOOP;
  COMMIT;
END;
/
How can I execute this code such that I can pass arrays. For example,
1. Exec SP_procname( 1,2)  works fine
But how would we execute a stored procedure where we have arrays.

2. Exec SP_procname( [1,5],[2,7]);  This seems to throw an error.

 Attached is ithe error message screen shot trhat I receive. Please take a moment to read to better understand what I am talking about. The attachment is a doc file and you may have to zoom out to read clearly.

Any help in this matter will be highly appreciated...

Thanks


Start Free Trial
Attachments:
 
Sql Plus error screen Shot
 
[+][-]07.31.2008 at 11:45PM PDT, ID: 22135983

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Oracle 10.x
Tags: Oracle, Oracle 10g, 2.0.4.0, SQL Plus, SQL PLUS, ORA-06550 Syntax error or invalid code
Sign Up Now!
Solution Provided By: shajukg
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628