Send array to oracle SP

Hello
I'm using .net 4.0 (C#) with oracle 11g.
I wrote a SP that insert data into some tables and I need to send to it two parameters which are arrays of decimals (I don't know in advance how many items will be in the array), I searched the net for a solution but couldn't find an answer...
I tried to use varrays (although they are not dynamic) but still no success, I recieved the following exception when running the C# code:
Unknown datatype System.Decimal[] for parameter value of type Object.
Here is the SP I wrote:
create type varrayFE as varray(1000) of varchar(decimal);
create type varrayBE as varray(1000) of varchar(decimal);
create or replace
PROCEDURE CI_INSERT_HISTORY_REPORT
Report_Name_Param IN VARCHAR2 , User_ID_Param IN NUMBER , Report_Type_Param IN NUMBER
, RootFE_Param IN NUMBER , Time_Period_Param IN NUMBER , Hours_Param IN NUMBER
, SW_Param IN NUMBER , FE_Param IN varrayFE , BE_Param IN varrayBE
) AS
BEGIN
INSERT INTO CI_History_Reports
VALUES (Report_Name_Param,User_ID_Param, Report_Type_Param,
RootFE_Param, Time_Period_Param, Hours_Param, SW_Param);
FOR i IN FE_Param.first .. FE_Param.last
LOOP
INSERT INTO CI_History_Reports_FE
VALUES (FE_Param(i));
END LOOP;
FOR i IN BE_Param.first .. BE_Param.last
LOOP
INSERT INTO CI_History_Reports_BE_TYPE
VALUES (BE_Param(i));
END LOOP;
END;
END CI_INSERT_HISTORY_REPORT;

Helios- Gunes EROL wrote:
Hi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick responseMoved.
Nicolas.

Similar Messages

  • How to pass ARRAY to Oracle Procedure

    Hi
    We are using BC4J with JSP in our project. We need to send an Array to the procedure.
    Could somebody provide some info as how this can be achieved.

    A while back, I used a SQLJ client to call a Java (also SQLJ) stored procedure and I needed to pass an array of strings to the procedure. I did something like this:
    Java Class that was loaded in DB:
    public class MyClass
    // method that the stored procedure uses
    public static void CALL_DOSTUFF(String a,
    oracle.sql.ARRAY b,
    oracle.sql.ARRAY c)
    String[] bb = (String[])b.getArray();
    String[] cc = (String[])c.getArray();
    doStuff(a,bb,cc);
    public static void doStuff(String a,
    String[] b,
    String[] c)
    // process the input
    In the database I added the type:
    create or replace type STR_ARRAY as table of varchar2(20);
    and the procedure:
    create or replace procedure CALL_DOSTUFF(a varchar2,
    b STR_ARRAY,
    c STR_ARRAY)
    as
    language java
    name 'MyClass.CALL_DOSTUFF(java.lang.String,
    oracle.sql.ARRAY,
    oracle.sql.ARRAY)';
    I then used jpub to publish a STR_ARRAY.java file. I compiled this and used it with my SQLJ client to call to the stored procedure. The STR_ARRAY constructor takes a String[], so you do something like this in the SQLJ client:
    String x = "X";
    String y = {"y1","y2"};
    String z = {"z1","z2"};
    STR_ARRAY y1 = new STR_ARRAY(y);
    STR_ARRAY z1 = new STR_ARRAY(z);
    #sql {CALL CALL_DOSTUFF(:x,:y1,:z1)};
    Hope this helps.

  • How to send Array data using Post Method?

    Var array = $_POST['myData'];
    array[0] => 'ABC'
    array[1] => 'DEF'
    how to improve this code to support send array data...?
    String url ="http://xxxxx/test.php";
    String[] arraystr={"ABC", "DEF", "EDFF"}
    String parameter = "myData=" +arraystr;    // no support this
    Strint str = postMrthod(url, parameter );
    public static String postMethod(String url, String parameter) {
            StringBuffer b = new StringBuffer("");
            HttpConnection hc = null;
            InputStream in = null;
            OutputStream out = null;
            try {
                hc = (HttpConnection) Connector.open(url);
                hc.setRequestMethod(HttpConnection.POST);
                hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                out = hc.openOutputStream();
                byte postmsg[] = parameter.getBytes();
                for (int i = 0; i < postmsg.length; i++) {
                    out.write(postmsg);
    out.flush();
    in = hc.openInputStream();
    int ch;
    while ((ch = in.read()) != -1) {
    b.append((char) ch);
    } catch (IOException e) {
    e.printStackTrace();
    try {
    if (in != null) {
    in.close();
    if (hc != null) {
    hc.close();
    } catch (IOException e) {
    e.printStackTrace();
    return b.toString().trim();

    yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
    <input type="hidden" id="HTTP_CVHTAMID"
    name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

  • JDBC send data to oracle, oracle only accept column name in Upper case

    Hi experts,
    I am doing a scenario File --> XI --> JDBC,  JDBC send data to a Oracle 10g database, I have configured JDBC receiver to use XML-SQL format. in oracle database ,  table "EMPLOYEE" has a column "NAME", but when I send data to oracle using JDBC receiver, the column is "name", then XI complains
    " 'EMPLOYEE' (structure 'insert'): java.sql.SQLException: FATAL ERROR: Column 'name' does not exist in table 'EMPLOYEE'.
    can anyone help me to let oracle accpet column "name". I can't change colum in JDBC receiver from "name" to "NAME".
    Thanks a lot.

    <i>can anyone help me to let oracle accpet column "name"</i>
    Making Oracle case insensitive is not possible (in my opinion). By default all object names are stored in UPPER case in the rdbms dictionary.
    When XI searches for column name in Oracle, this search is case sensitive. So u have to configure accordingly.
    Regards,
    Prateek

  • Sending Attachments using Oracle Alerts

    Hi All,
    I am working on Oracle Alerts. I have to send an output of the report to the client, is it possible to send using Oracle Alerts.
    Thanks in Advance,
    Venky.

    Hi,
    To send attachments using Oracle Alert, you can follow below mentioned steps:
    1) While defining Oracle alert Action, Select 'Action Level' as 'Summary'
    2) In Action Details, select 'Action Type' as 'Operating System Script'
    3) Select 'Text' radio button
    4) Write following code : uuencode <Name of the file along with the path> <Name of the attachment in the mail>|mailx -c &cc_mail_id,&to_mail_id -s "<Subject of the Mailer>" &to_mail_id.
    5) You can use mail or sendmail command also instead of mailx command.
    6) Save Alert details
    Thanks and regards,
    Indira

  • Conversion of java Array to oracle SQL Array while calling Stored Procedure

    How java Array can be converted to oracle SQL array while calling Stored procedure with callable statement.
    i.e java Array ---> Sql Array in Oracle while setting the datatypes to callable statement arguments.

    Look at:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=376735&tstart=0&trange=15
    Paul

  • How to send array of bytes to a servlet and store it in a file

    Hi,
    How to send array of bytes to a servlet and store it in a file.
    I am new to Servlets. if possible for any one, please provide the code.
    Thanks,
    cmbl

    Through HTTP this is only possible with a POST request of which the encoding type is set to multipart/form-data. You can use Apache Commons FileUpload to parse such a multipart form data request into useable elements. From the other side (the client) you can use a HTML <input type="file"> element or a Java class with Apache Commons PostMethod API.
    You may find this article useful: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • Sending mail in Oracle 8i

    Hi,
    I am trying to send an email in Oracle 8i Personnel edition, but have encountered problems with the UTL_SMTP package. I have a stored procedure to send mail, but when I run this procedure, I get the following error messages:
    ORA-20001: 421 Service not available
    ORA-06512: at "SYSTEM.UTL_SMTP", line 83
    ORA-06512: at "SYSTEM.UTL_SMTP", line 121
    ORA-06512: at "SYSTEM.DEMO_MAIL", line 257
    ORA-06512: at "SYSTEM.DEMO_MAIL", line 118
    ORA-06512: at "SYSTEM.DEMO_MAIL", line 104
    ORA-06512: at line 2.
    Can anyone help??

    If you can't access the utl_smtp package (you can also look from Oracle Developper by opening the Database node followed by the SYS node which will list the database packages), here is a quick example using OLE2:
    DECLARE
    objOutlook OLE2.OBJ_TYPE;
    objArg OLE2.LIST_TYPE;
    objMail OLE2.OBJ_TYPE;
    BEGIN
    objOutlook := OLE2.CREATE_OBJ('Outlook.Application');
    objarg := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(objarg,0);
    objMail := OLE2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
    OLE2.DESTROY_ARGLIST(objarg);
    OLE2.SET_PROPERTY(objmail,'To','<emailaddress>');
    OLE2.SET_PROPERTY(objmail,'Subject','Test email from Oracle Forms');
    OLE2.SET_PROPERTY(objmail,'Body','This is a test sending mail from Oracle forms');
    OLE2.INVOKE(objmail,'Display');  to display before sending
    OLE2.INVOKE(objmail,'Send');
    OLE2.RELEASE_OBJ(objmail);
    OLE2.RELEASE_OBJ(objOutlook);
    END;

  • Best Way To Send Arrays to ActiveX

    What's the best way to send array data to an ActiveX object? Do you
    have any examples that you can show me? Are there any alternatives to
    the "best way"?
    Thanks,
    Scott

    > What's the best way to send printer control codes in Netware 3.12? Should
    > I use a batch file that's run each time a particular queue is selected, or
    > is there something I should be doing with a pconsole option? I'm trying to
    > get rid of extra linefeeds and enable compressed printing. DOS
    > environment, by the way.
    Never mind, I'm in a habit of answering my own posts these days. Just create
    a job configuration in printcon that uses a device with the appropriate
    device modes.
    Is it just me, or is Netware queue-based printing a bit on the obtuse side?
    Seems like it could have been made a whole lot easier (more linear?) to set
    up.
    --Mike-- Chain Reaction Bicycles
    www.ChainReactionBicycles.com

  • Pros and cons of using email sending package in oracle 8.1.6

    hi ,
    i would like to know the advantages /disadvantages of using email sending package from oracle 8.1.6
    compared to sending the same using say perl or php.
    iam developing a site in php/oracle8.1.6 , in which iam supposed to create a payement module.whenever a user
    register(for free trial or subscribing the site) i'll have to send him a welcoming mail.In addition to this iam also supposed to find out wether subscribers are paying cash at right time and if not send them reminder mails and other for related scenarios . i can do the same in Perl or PHP.but if iam not gaining much(say based on server performance or load) then i think i can go ahead with oracle package. when i tested it i found that its slow . what about the load that it may cause for the server (ours is linux ).
    please do give inputs on this

    Hi Ravi,
    Thanks for your reply.
    But I am specifically looking at pros and cons for web services. So the thread which you passed to me won't help.
    Regards
    Nitin.

  • Live Demo of sending SMS from Oracle Forms.

    I've just a posted a live demo of how to develop code to call a web service to send and SMS from Oracle Forms.
    Regards
    Grant
    http://otn.oracle.com/formsdesignerj2ee
    http://groundside.com/blog/GrantRonald?title=live_demo_of_sending_an_sms_from_forms&more=1&c=1&tb=1&pb=1

    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>Announcement: Forums Etiquette / Reward Points
    </ul>
    Do anybody know about sending the sms from oracle forms.If anybody had means please send me the script...... This is a commonly asked question. Have you tried searching the forum for possible solutions? Take a look at this search result. I would also recommend you take a look at the Oracle Forms Services 11g web page and scroll down to the Oracle Forms 11g calling a web service link. This is a white paper published by Grant Ronald that specifically describes the process of sending SMS from Oracle Forms.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to use Arrays in Oracle

    Can any one help me to use an Array in oracle.Also i want to search whether an element is already existing in the array

    One possible approach
    SQL> create or replace type array as table of number;
      2  /
    Type created.
    SQL> select case when count(*) = 1 then 'found' else 'not found' end
      2  from dual
      3  where exists (
      4    select null from table(array(1,2,3,4,5))
      5    where column_value = 3);
    CASEWHENC
    found
    SQL> edi
    Wrote file afiedt.sql
      1  select case when count(*) = 1 then 'found' else 'not found' end
      2  from dual
      3  where exists (
      4    select null from table(array(1,2,3,4,5))
      5*   where column_value = 1)
    SQL> /
    CASEWHENC
    found
    SQL> edi
    Wrote file afiedt.sql
      1  select case when count(*) = 1 then 'found' else 'not found' end
      2  from dual
      3  where exists (
      4    select null from table(array(1,2,3,4,5))
      5*   where column_value = 6)
    SQL> /
    CASEWHENC
    not found

  • How to Send mail in oracle 10g

    I am new in oracle developer.....we are using oracle 10g developer...how to send mail through oracle 10g on a button click.pease help me.
    Thanks in advance

    This question have been asked many times on this forum, see if you get help from following:
    https://forums.oracle.com/message/5395438#5395438
    Search results: https://forums.oracle.com/thread/search.jspa?peopleEnabled=true&userID=&containerType=&container=&q=form+email
    Check this out as well:
    http://nzchaudhry.wordpress.com/2013/05/31/send-report-via-email-attachment-in-oracle-forms-10g/
    You can find init.ora or initSID.ora file under $ORACLE_HOME/dbs on linux and on Windows under $ORACLE_HOME/database. Otherwise you can create it using "create pfile from spfile" command
    Aneel

  • Not able to send mail thru Oracle

    Hi all,
    I am using Oracle 9.2.0.6 on RHEL platform.....
    I am using the below procedure to send mail from oracle
    CREATE or REPLACE PROCEDURE SimpleTextMessage IS
        mailHOST    VARCHAR2(64) := '10.0.1.2';
        mailFROM    VARCHAR2(64);
        mailTO      VARCHAR2(64);
        mailCONN    utl_smtp.connection;
        mailDATE    VARCHAR2(20);
        vreply      utl_smtp.reply;
        vreplies    utl_smtp.replies;
        i           number;
    BEGIN
        mailFROM := '[email protected]';
        mailTO   := '[email protected]';
        SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;
          dbms_output.put_line('open_connection');
          dbms_output.put_line('---------------');
          vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('help');
          dbms_output.put_line('----');
          vreplies := utl_smtp.help(mailCONN, 'HELP');
          for i in 1..vreplies.count loop
            dbms_output.put_line( 'code = ' || vreplies(i).code );
            dbms_output.put_line( 'text = ' || vreplies(i).text );
          end loop;
    vreply := utl_smtp.open_data(mailCONN);
          utl_smtp.write_data(mailCONN, 'Subject: '|| 'A subject' || chr(13));
          utl_smtp.write_data(mailCONN, 'From:    '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'Date:    '||mailDATE     || chr(13));
          utl_smtp.write_data(mailCONN, 'To:      '||mailTO       || chr(13));
          utl_smtp.write_data(mailCONN, 'CC:      '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'BCC:     '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN,                              chr(13));
          utl_smtp.write_data(mailCONN, 'Hello Friend.'           || chr(13));
          utl_smtp.write_data(mailCONN, 'Drop me an e-mail.'      || chr(13));
          dbms_output.put_line('close_data');
          dbms_output.put_line('----------');
          vreply := utl_smtp.close_data(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('quit');
          dbms_output.put_line('----');
          vreply := utl_smtp.quit(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
    END;
    /At the time of compilation i am not getting any error but when i call that proc i am getting the below error:
    SQL> exec cadata3.simpletextmessage();
    BEGIN cadata3.simpletextmessage(); END;
    ERROR at line 1:
    ORA-29277: invalid SMTP operation
    ORA-06512: at "SYS.UTL_SMTP", line 43
    ORA-06512: at "SYS.UTL_SMTP", line 279
    ORA-06512: at "CADATA3.SIMPLETEXTMESSAGE", line 29
    ORA-06512: at line 1can asomebody throw some light on the same....

    Still getting the same problem
    CREATE or REPLACE PROCEDURE SimpleTextMessage IS
        mailHOST    VARCHAR2(64) := '10.0.1.2:8443';
        mailFROM    VARCHAR2(64);
        mailTO      VARCHAR2(64);
        mailCONN    utl_smtp.connection;
        mailDATE    VARCHAR2(20);
        vreply      utl_smtp.reply;
        vreplies    utl_smtp.replies;
        i           number;
    BEGIN
        mailFROM := '[email protected]';
        mailTO   := '[email protected]';
        SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;
          dbms_output.put_line('open_connection');
          dbms_output.put_line('---------------');
          vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('help');
          dbms_output.put_line('----');
          vreplies := utl_smtp.help(mailCONN, 'HELP');
          for i in 1..vreplies.count loop
            dbms_output.put_line( 'code = ' || vreplies(i).code );
            dbms_output.put_line( 'text = ' || vreplies(i).text );
          end loop;
    vreply := utl_smtp.close_data(mailCONN);
          utl_smtp.write_data(mailCONN, 'Subject: '|| 'A subject' || chr(13));
          utl_smtp.write_data(mailCONN, 'From:    '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'Date:    '||mailDATE     || chr(13));
          utl_smtp.write_data(mailCONN, 'To:      '||mailTO       || chr(13));
          utl_smtp.write_data(mailCONN, 'CC:      '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN, 'BCC:     '||mailFROM     || chr(13));
          utl_smtp.write_data(mailCONN,                              chr(13));
          utl_smtp.write_data(mailCONN, 'Hello Friend.'           || chr(13));
          utl_smtp.write_data(mailCONN, 'Drop me an e-mail.'      || chr(13));
          dbms_output.put_line('close_data');
          dbms_output.put_line('----------');
          vreply := utl_smtp.close_data(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
          dbms_output.put_line('quit');
          dbms_output.put_line('----');
          vreply := utl_smtp.quit(mailCONN);
          dbms_output.put_line( 'code = ' || vreply.code );
          dbms_output.put_line( 'text = ' || vreply.text );
    END;
    /error
    SQL> exec cadata3.simpletextmessage();
    BEGIN cadata3.simpletextmessage(); END;
    ERROR at line 1:
    ORA-29277: invalid SMTP operation
    ORA-06512: at "SYS.UTL_SMTP", line 43
    ORA-06512: at "SYS.UTL_SMTP", line 303
    ORA-06512: at "CADATA3.SIMPLETEXTMESSAGE", line 28
    ORA-06512: at line 1Edited by: user00726 on Jul 31, 2009 4:14 AM

  • Can we send mails using Oracle

    Hi Everybody,
    Can we send mails using Oracle (like java mail)?? Can I a write a procedure/stored procedure to send a mail if there is any change in the database tables
    null

    There are three Exchange portlets available for use with Portal 3.0.8.9.8 (inbox, calendar, contacts). They will be downloadable from the new Oracle9iAS Portal Partner Catalog which will be up at the end of March. If you wish to use these portlets before then, send me an email request and I will give them to you.

Maybe you are looking for