Array as argument.

Hi, i work with Oracle Database 10g Express Edition, i have the following questions:
I pass an array of string from Visual Basic 2005/2008 to a stored procedure?
what kind of define the parameter that receives the settlement in PL / SQL?
Roberto.

Hi Roberto,
You might want to read on [url http://download.oracle.com/docs/html/E10927_01/featOraCommand.htm#BABBDHBB]PL/SQL Associative Array Binding
Hope this helps,
[url http://nur-hidayat.net]Nur Hidayat

Similar Messages

  • Byte array in argument ? There's no ObjectFactory with an @XmlElementDecl

    Hello everyone,
    I'm trying to upload a file through my webservice but when i set up the call to the webservice from my client using
    webservices.ChansonTestService service = new webservices.ChansonTestService();
                webservices.ChansonTest port = service.getChansonTestPort();I get the following exception :
    Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    There's no ObjectFactory with an @XmlElementDecl for the element {http://webservices/}fichier.
            this problem is related to the following location:
                    at protected javax.xml.bind.JAXBElement webservices.PutFichier.fichier
                    at webservices.PutFichierThis is my webservice method :
    @WebMethod(operationName = "putFichier")
        @Oneway
        public void putFichier(@WebParam(name = "fichier")
        byte[] fichier) {
            try {
           File mp3 = new File("/home/schulman/Desktop/dl01.mp3");
           FileOutputStream fo = new FileOutputStream(mp3);
           fo.write(fichier);
           catch (IOException ioe) {
               ioe.printStackTrace();
        }Do i have to set up something else to be able to use byte array as argument ? i thought it was mapped using base64 by default...
    I'm using glassfish v2, and i'm open to any suggestion !!
    Regards
    Edited by: Schulman on Nov 15, 2007 2:38 AM

    hi,
    first generate the classes by using the jdk 1.6 wsimport command
    wsimport -keep <directory> -s <directory> wsdl url.

  • Passing array as arguments

    im very new to java, dont know much about it.can any one please tell me how ot pass array or array list as a argument to a class

    this is my main class where it calls a readfile class to read contents of file
    import java.awt.List;
    import java.io.IOException;
    public class Sample {
    public static List alist = new List();
    public static void main(final String[] args) throws IOException {
    new Readfile().readFromFile("c:/sam.txt");
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.StringTokenizer;
    this is readfile class which reads from file having comma as a delimiter and store it in an array list.
    class Readfile {
    * Declaration of arraylist.
    static List alist = new ArrayList();
    public void readFromFile(final String filename) throws IOException {
    BufferedReader bufferedReader = null;
    // Construct the BufferedReader object
    bufferedReader = new BufferedReader(new FileReader(filename));
    String line;
    while ((line = bufferedReader.readLine()) != null) {
    // storing in to arraylist
    StringTokenizer st1 = new StringTokenizer(line, ",");
    while (st1.hasMoreTokens()) {
    alist.add(st1.nextToken());
    //here just im printing the elements from arraylist.
    for (int j = 0; j < alist.size(); j++) {
    System.out.println(alist.get(j));
    if (bufferedReader != null) {
    bufferedReader.close();
    //converting arraylist to array;
    String[] strArray = new String[50];
    alist.toArray(strArray);
    //passing array as argument
    Area area1 = new Area(strArray);
    area1.calc();
    area1.print();
    Here is the class for area
    class Area {
    String[] alist1 = new String[50];
    private int[] array = new int[50];
    private int[] array1 = new int[50];
    public Area(final String[] alist) {
    alist1 = alist;
    void calc() {
    * for (int i = 0; i < 2 - (alist1.length); i = i + 2) { array1[i] =
         (Integer.valueOf(alist1).intValue() * Integer .valueOf(alist1[i ]).intValue());
    * To print the Area.
    void print() {
    System.out.println("Area of Rectangles ");
    for (int i = 0; i < array1.length; i++) {
    System.out.println(array1[i]);
    im not sure how standard my code is .please guide me

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

  • Arrays? arguments?

    what is the difference between arrays and arguments, and when should either be used.

    An array is a data structure that has a fixed size and allows you to modify and retrieve elements in a random order. In Java, arrays are objects. Use an array when that is the type of data structure you need.
    An argument is a value that is passed to a method or a constructor. In Java, arguments are primitives or references. Use it when you need to pass values to methods.
    Rather than try to understand what an array or an argument is, it's better to simply write some Java code that uses them, and the understanding will come later. How do you write the code before you understand? A book that has exercises that say "write a method that takes two ints and returns their sum" and "write a method that takes a double[] and returns the average value" will help you write the code before you fully understand what you're doing.

  • How can i pass array as argument in magento api method calling using sudzc API in iphone Native APP

    0down votefavorite
    I am implementing magento standard api method in native iphone app. I use webservice generated by sudzc. To call method I use:
    [service call:self action:@selector(callHandler:) sessionId:@" " resourcePath:@" " args:@""];
    When I used methods e.g. cart.info or product.info in which I have to pass one parameter; it gives valid response. But when I used method e.g. cart_product.add in which I have to pass an argument as value of array it gives error
    SQLSTATE[42000]: Syntax error or access violation:
        1064 You have an error in your SQL syntax;
        check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
    I have tested in SOAP UI also. There also it gives me same error. But same method works in PHP file. Even I tried by creating same soap request which I created using JavaScript but still it doesn't work.
    Can anyone help me to pass array as a parameter using sudzc api to call magento web services?

    There is an error in your SQL.

  • Multidimensional array as argument to a Java method

    Hello all,
    I have defined in C the following array :
    char my_array[100][3];I want to pass this mutidimensional array to a Java method. How should I write my C array as an argument of the Java method ?
    TIA

    You cannot do that in a straight-forward fassion. The C compiler reserves 300 consecutive bytes in memory, the base address of which is accessible through my_array. The base address of each of your 100 rows can be accessed as my_array[row]. The length of each row is fixed and only known to the programmer and the compiler which uses it to calculate the row offsets.
    Java has a slightly different approach to multi-dimensional arrays. Actually they are simply not implemented. What you see and use as multi-dimensional array is a composition of one array holding the references to other arrays - remember, arrays are also only Objects. This implies that the data of different rows does not at all represent a contingious memory region.
    So what you need to do is to allocate an array of size 100, which holds char[]s - references to char-arrays. Then you iterate through your C array and for each row you allocate an char-array of length 3 initialized to the appropriate row. The references to those char-arrays need to be stored in the char[]-array.
    Use env->NewCharArray(env, length) to create a new char[] and env->NewObjectArray(env, length, clazz, null) to create the char[][]. Accesing the elements of these arrays is described in:
    http://java.sun.com/docs/books/tutorial/native1.1/implementing/array.html

  • Pass an array of argument defined anonymous inner class

    Can someone plz tell me what is wrong with this code?How can I correct it?
    interface NotImplemented{
         public void disp();
    public class Anonymous{
         public void disp(NotImplemented[] ni){
              System.out.println(ni.length);
              ni[0].disp();
         public static void main(String args[]){
              Anonymous a=new Anonymous();
              a.disp(new NotImplemented[5]{
                   public void disp(){
                        System.out.println("Array of inner classes disp");
    }     

    This is what I wanted to do:
    interface NotImplemented{
         public void disp();
    public class Anonymous{
         public void disp(NotImplemented[] ni){
              System.out.println(ni.length);
              ni[0].disp();
              ni[1].disp();
         public static void main(String args[]){
              Anonymous a=new Anonymous();
              a.disp(new NotImplemented[]{
                        new NotImplemented(){
                             public void disp(){
                                  System.out.println("Inside first implementor of NotImplemented interface");
                        new NotImplemented(){
                             public void disp(){
                                  System.out.println("Inside second implementor of NotImplemented interface");
    Thanks for all your help...

  • Array as method argument

    Is there anyway to pass an Array as argument without declare an array variable before?
    Example:
    public class MyClass
    public MyClass
    myMethod( HOW CAN I PASS AN ARRAY HERE !);
    public void myMethod(String[] myArray)
    // The method body ;

    Is there anyway to pass an Array as argument without declare an array variable before?what's the point of passing the array then?
    when you passs the array..you want to send some information and get someinformation back
    by not decalring the variable before passing in the array..it's just makes no sense
    mind as well rewrite the method to taks no argument
    but here..you do it like this
    myMethod(new String[]) // not initialized array of String
    myMethod(null); // send in a null object

  • Arrays that work with Java Class

    Good Day all.
    Currently, I am working on a program that is giving me a bit of trouble starting...can anyone give me assistance and try to tell me what I am doing incorrectly?
    Here is the tasking:
    Main Method
    1. Output statement to screen saying this program will accept hours worked for 3 employees.
    2. Declare an Integer Array to hold 3 employees hours. Call this array "employees"
    3. Main Method then calls inputData Method (Passing array as argument) do not accept any return value.
    4. Main Method then calls outputData Method (Passing array as argument) do not accept any return value.
    import java.util.*;
    import java.text.DecimalFormat;
    public class Arrays
    { /*This starts the Arrays*/
         public static void main (String[] args)
         Scanner scannerObject = new Scanner(System.in);
         Scanner keyboard = new Scanner(System.in);
    inputData(employees);
         System.out.println("This program will accept hours worked for 3 employees.");
         String[]employees = new String [3];

    How am I coming along....I started with the MAIN Method...Now I have started and created a MONSTER with this other portion of my program
    Main Method
    1. Output statement to screen saying this program will accept hours worked for 3 employees.
    2. Declare an Integer Array to hold 3 employees hours. Call this array "employees"
    3. Main Method then calls inputData Method (Passing array as argument) do not accept any return value.
    4. Main Method then calls outputData Method (Passing array as argument) do not accept any return value.
    InputData Method (Receives Arrary)
    1. Gers input using a for loop for each employees hours into the array elements.
    2. Prompt the user with the following phrase. Enter hours worked for employee #: (Where # is the employee number 1-3)
    Can anyone tell me what is going god awfully wrong with this program? LAUGHING
    SUSAN
    import java.util.*;
    import java.text.DecimalFormat;
    public class CS219Arrays
    { /*This starts the Arrays*/
    public static void main (String[] args)
    Scanner scannerObject = new Scanner(System.in);
    Scanner keyboard = new Scanner(System.in);
    int numberOfHours = 0;
    System.out.println("This program will accept hours worked for 3 employees.");
    String[]employees = new String [3];
    for (int index = 0; index < employees.length; index ++)
    System.out.println(employee[index]);
    /*** Used to get input from the user and store the results in an array
    @param employees The array to store the data that the user enters in*/
    public static void inputData(String[] employees) {
    // Get user input and place it in the employees array
    /*** Used to output the data @param employees the array to output*/
    private static void outputData(String[] employees) {
    // Display each element of the employees array
    System.out.println("Enter hours worked for employee #: (where # is the employee number 1-3)");
    numberOfHours = keyboard.nextInt();
    }

  • "Boolean" arguments and mutability

    Hi All,
    I've come across an issue passing Boolean arguments into methods. Basically the problem is that the method needs to take Boolean values and then return those values, as well as other values. i.e:
    public SomeClass myMethod(Boolean bool1, Boolean bool2){ ... }
    The problem is that because Booleans are immutable, it's not possible to change their value inside the method. Also, since the method is already returning a value it's not really feasible to return an array of arguments. I could potentially put all of the arguments in an object array / collection or something ugly like that but that seems like a fairly poor solution. At the moment the best option seems like coding a mutable version of Boolean.
    My question is - is there a better way to accomplish this? If not, should the java language be modified to support mutable Booleans either by changing 'Boolean' or by adding a new class?

    Encephalopathic wrote:
    MJ_ wrote:
    The problem is that because Booleans are immutable, it's not possible to change their value inside the method. And you shouldn't try to do this anyway. That would mean that your method was producing a "side-effect", and this is not desired.
    Maybe, but you could then argue that for any object that's passed as an argument. I'm not sure that's a valid reason not for the functionality to exist.
    Also, since the method is already returning a value it's not really feasible to return an array of arguments. I could potentially put all of the arguments in an object array / collection or something ugly like that but that seems like a fairly poor solution. At the moment the best option seems like coding a mutable version of Boolean.This doesn't make any sense. If you need to return a bunch of things, you create a class to hold these things. If the booleans within your return object need to be different, then you create new boolean variables within your method and add those to the returning object. By the way, why are you using Booleans here and not booleans? Is there a definite need for the wrapper object and not the primative?Yes, creating a class with the return values is also an option. Still a bit kludgy though as I wouldn't use it for anything else.
    My question is - is there a better way to accomplish this? If not, should the java language be modified to support mutable Booleans either by changing 'Boolean' or by adding a new class?I think you may need to rethink your basic program design. You can start by telling us what you are trying to accomplish here in a general, non-programmatic sense.Well, the gist is that there's a method that's comparing objects in two collections. The return value is the result of that comparison. There are two boolean values which are passed to the method, and they are used to say whether to iterate forward to the next entry in each collection. I'm happy to rethink the design, so long as it doesn't require much rework (since the method already works and breaking it would be a bad thing)

  • Getting and printing command-line arguments

    (char *)curpsinfo->pr_psargs will give me the "first part of the command line",
    but that has two deficiencies:
    1. If the command line is long, it might get truncated.
    2. If the command line contains white space, I have no way to know whether the
    spaces in the string are part of an argument ot separation. That is, I can't tell
    "ls 'foo bar' baz" from "ls foo bar baz"
    I want to get the individual arguments, so that I can print them as run-length encoded strings:
    cmd=7:/bin/ls
    a1=7:foo bar
    a2=3:baz

    I've reworked your script:
    inline int TGT_PID = $1;
    BEGIN { /* 1 */
            printf("BEGIN\n");
            mypids[TGT_PID]++;
    syscall::exece:entry /* 2 */
    /mypids[curpsinfo->pr_ppid] != 0/ {
            self->follow = 1;
    syscall::exece:entry
    /(self->follow != 0) &&
    (this->argp = (uintptr_t)(curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
        *(uint32_t *)copyin(arg1 + 0 * 4, 4) :
        *(uint64_t *)copyin(arg1 + 0 * 4, 8))) != NULL/
            a1 = copyinstr(this->argp);
            a1_l = strlen(a1);
            printf("a1=%d:%s\n", a1_l, a1);
            this->last = 1;
    syscall::exece:entry
    /(self->follow != 0) && this->last == 1 &&
    (this->argp = (uintptr_t)(curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
        *(uint32_t *)copyin(arg1 + 1 * 4, 4) :
        *(uint64_t *)copyin(arg1 + 1 * 4, 8))) != NULL/
            a1 = copyinstr(this->argp);
            a1_l = strlen(a1);
            printf("a1=%d:%s\n", a1_l, a1);
            this->last = 2;
    syscall::exece:entry
    /(self->follow != 0) && this->last == 2 &&
    (this->argp = (uintptr_t)(curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
        *(uint32_t *)copyin(arg1 + 2 * 4, 4) :
        *(uint64_t *)copyin(arg1 + 2 * 4, 8))) != NULL/
            a1 = copyinstr(this->argp);
            a1_l = strlen(a1);
            printf("a1=%d:%s\n", a1_l, a1);
    }The way I debugged this was by figuring out the action that was causing the error by removing actions and then examining its arguments. In this case, you were using the curpsinfo which had the arguments before exece(). You actually wanted to use arg1 as you had before which a char ** NULL-terminated array of arguments.
    Since it's a NULL-terminated list, I added the this->list stuff so I didn't walk off the end of the list.

  • JNI Array problem

    Hello sir,
    here i got problem while calling java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    c++ call code snippet =>      invoke.invoke_class("PQR", "xyz","([I)V");{code}
    here when i call this xyz method i just get o/p as => hi
    means all jvm related calls are working even method xyz gets called but i am not able to acces to array .
    can anybody tell me how to get access to those array elements?
    Edited by: Amit_pune on Mar 1, 2008 2:19 AM

    The code looks rather strange. Casting a pointer to a pointer to a short (&bufferbody) to be a pointer to an int.
    Maybe you could post the code of modify.
    Also, and as an aside, if I'm reading the code right, you have a potential memory leak because you're using JNI_COMMIT rather than just 0.
    Sylvia

  • Returning new objects on uninitialized native code arguments

    I have a C library I am trying to interface to that returns arrays whose size
    I do not know in advance. I would like to be able to write a java wrapper
    library that accepts uninitialized java arrays as arguments, and creates
    arrays of the appropriate size, and gives them back to the Java code.
    In the code below, I try to pass an uninitialized String array to native
    function, and create the String array in the native function. The String
    array "str" is still null after the native function returns. I can make it
    work by creating the String array in the java code, or making the return value
    a String array created in the native code. Why doesn't it work when I pass an
    uninitialized array as a parameter?
    Java:
    public native int getStrings(int length, String [] strings);...
    String [] str= null;
    int result = test.getStrings(10,str);C:
    JNIEXPORT jint JNICALL Java_StringArrayTest_getStrings
    (JNIEnv *env, jobject obj, jint length, jobjectArray strings)
        //create the java string array
       jclass elementType = (*env)->FindClass(env,"java/lang/String");
        if(NULL==elementType) return -1;
        strings=(*env)->NewObjectArray(env,length,elementType,NULL);
        if(NULL==strings)      return -1;
       jsize i;
        for(i=0; i<length; i++)
         char buf[100];
         snprintf(buf,99,"String %i",(int) i);
         jstring tempString=NULL;
         tempString=(*env)->NewStringUTF(env,buf);
         if(NULL==tempString) return -1;
         (*env)->SetObjectArrayElement(env, strings, i, tempString);
        return 0;
    }

    That kind of return-by-reference is not supported in Java. Consider: could it work if getStrings were written in Java language instead of native code? The answer is no.
    -slj-

  • Using TestStand How I pass an array of data into a DLL (IPC3.dll) for serial communication

    I am ussing a DLL created by another party. I have the list of the C declaretions. I have been able to write a seq that can turn the comport ON/OFF or select a different port but I have not been able to send or recieved any data. I have created an array of bytes(unsigned 8-bit integers)to send and recieved data but nothing goes out or in.

    Hi Toro,
    There is an example in your \Examples\AccessingArrays\PassingArrayParametersToDLL directory that illustrates exactly how to pass TestStand arrays as arguments to dll functions. The source files for the .dll are located in the same directory.
    For more information on passing arrays as parameters to modules you should read the "DLL Flexible Prototype Adapter" section of Chatper 13 in the TestStand User Manual, and pay special attention to the subsection entitled "Array Parameters". You can access the User Manual from the TestStand Start Menu group, the TestStand Sequence Editor's Help menu, the \Doc directory, or online at the following link:
    http://digital.ni.com/manuals.nsf/websearch/50B69DA356B8D38C86256A0000660E6B?OpenDocumen
    t&node=132100_US
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

Maybe you are looking for

  • HP laserjet pro M1536dnf wireless setup to use Air print

    Since I trying to print from my new Ipad Air, excuse my newbie networking printing questions! This what I know so far: 1. I understand my HP laserjet pro M1536dnf is 'not' a WiFi  printer. 2. As per HP Support and the Apple Support web sites, my HP l

  • 8530 doesn't connect to MacBook Pro

    When I connect my BB8530 to my MacBook,  Blackberry desktop manager doesn't see it. It seems to be the same whether connecting via bluetooth or by USB Cable. Any suggestions? I've tried a hard reboot

  • Why the checkmark in the Canvas window

    This will be, by far,the dumbest question you have ever seen but how do I get rid of the Green checkmark in the canvass window. Also, what does it mean? I'm at the bottom of the learning curve here. Please bear with me here and humour me.

  • Load Balancing simple question

    Hi, i'm using CSS 11501 to load balance some web servers using src IP. if one src IP is directed to certain web server, How much time has to pass for this same src IP to be directed to other web server? Thank you in advance!

  • WAD 7.0 chart type stacked bars

    Hello, i have created a chart type "stacked bars", now i have one problem, i would like to create a sum over the bar ? How can i do this. i have the sum in my query. Thanks in advance Detlev