Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:24:58+00:00 2026-06-03T10:24:58+00:00

I have SP with custom type: Create Or Replace Type tyTestArrayType As Object (siF1

  • 0

I have SP with custom type:

Create Or Replace Type tyTestArrayType As Object
    (siF1 SmallInt,
    siF2 SmallInt,
    siF3 SmallInt);


Create Or Replace Type tyTestArray Is Table Of tyTestArrayType;

Create Or Replace Procedure prTestArray(pArr tyTestArray,
                                        pResult In Out SmallInt)

Is
Begin

    pResult := 0;

    For I In 1..pArr.Count
    Loop
        pResult := pResult + pArr(I).siF1 + pArr(I).siF2 + pArr(I).siF3;
    End Loop;

End;

How can I use this procedure (pass multidimensional array) from PHP (oci8)?

Thanks,

Update:

This is a code performing this in Ruby:

plsql.connection = OCI8.new("user","pass","host/XE")
testArray =  [{:sif1 => 1, :sif2 => 12, :sif3=>4},{:sif1 => 5, :sif2 => 2, :sif3=>3}]
puts plsql.prTestArray(p_testArray,0) #=> {:presult=>27}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:25:00+00:00Added an answer on June 3, 2026 at 10:25 am

    I have developped an identical stored procedure (using Table of …) as input and it was difficult to be called from Java code. So I switched to a CLOB input and passed an XML from code.
    In XML you can have an array as multi-dimensional as you wish and it is very easy to build a XML string in PHP.

    XML parsing is made easy with ORACLE:

    CLOB:

    <?xml version="1.0"?>
    <DATA>
         <LINE>
            <COD_NOMCPDT>040001</COD_NOMCPDT>
         </LINE>
    
         <LINE>
            <COD_NOMCPDT>040002</COD_NOMCPDT>        
         </LINE>    
    </DATA>
    

    Query:

    SELECT
    extractvalue(column_value, '/LINE/COD_NOMCPDT')
      FROM TABLE(XMLSequence(XMLTYPE(
                   CLOB_VARIABLE).extract('/DATA/LINE'))) );  
    

    Output:

    040001
    040002
    

    Another option would be to store the array in a temporary table and read it from there (no IN parameters).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The task: I am trying to create a custom data type and have it
I have created a custom data type enum like so: create type bnfunctionstype as
So in my postgres DB I have the following custom type: create type my_pg_type
I have a custom content type with custom fields. I'm trying to create a
I have an Oracle stored procedure which takes two parameters: a custom data type
i have created a custom post type named Books & i have a widget
I have some custom type: [RdfSerializable] public class Item { [RdfProperty(true)] public string Name
I use NHibernate and have a custom type for encrypting passwords in the database
Using NH 2.0, I have a custom type. It is composed of four properties,
I have defined a custom file type with these lines: syn region SubSubtitle start=+=+

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.