How to use array as parameter in procedure

Hello,
I am using Oracle SQL Developer 1.5.5
I wanted to write a procedure which does insert into table.
It should take 2 parameters.How to take array as parameter?
One is a array of strings ('abc','def','erg') and another is a varchar ('abc').
How to do this?
Can somebody pls give a small example?
Thanks
Edited by: user13305573 on Aug 5, 2010 11:27 PM

Hello,
I am sorry if u didnt get my point.
My req is i am using Orcale SQL Developer.
Db is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
I want to write a procedure which will be called from a java file.
The parameter to that procedure will be a arr(array of strings) and username(varchar).
I want to insert that data into a tableA.
like if parameters are
(abc01,edfg02,efg03) as arr and honey as username
then it should insert 3 rows to the tableA
abc01 honey
edfg02 honey
efg03 honey
Thanks
Edited by: user13305573 on Aug 5, 2010 11:54 PM

Similar Messages

  • In SQLScript, how to use EXEC to call another procedure with parameters in procedure?

    Hi experts,
    In SQLScript, How to use EXEC to call another procedure with input and output parameters in procedure?thanks very much

    Hi Sagar,
    thank you! I generate another procedure with an input parameter and an output parameter in a procedure. Then i need to call the generated procedure using EXEC. Here is my code:
    create procedure ftest1(out sum_num bigint)
    as
    begin
    declare fa_output bigint;
    declare v_sql_drop varchar(200);
    declare v_sql varchar(500);
    declare cursor c_cursor1 for select num from TABLE1;
    --v_sql_drop := 'drop procedure fe';
    --exec v_sql_drop;
    v_sql := 'create procedure fe(in i_num bigint,out o_num bigint) as begin';
    v_sql := :v_sql || ' o_num := :i_num * 2 + :i_num * :i_num;';
    v_sql := :v_sql || ' end';
    exec v_sql;
    open c_cursor1;
    for c_item as c_cursor1 do
    exec 'call fe(c_item.num,o_num=>fa_output)';
    if sum_num is null then
    sum_num := fa_output;
    else
    sum_num := :sum_num + fa_output;
    end if;
    end for;
    close c_cursor1;
    end;
    The underline code is using exec to call the generated procedure. But this method cannot work. Any suggestion? thanks again!

  • How to use the "out" parameter in idl

    hello.idl:
    module HelloApp
    interface Hello
    string sayHello();
    void getPass(in string name,out string pass);
    HelloServer:
    public class HelloServer
    class HelloServant extends _HelloImplBase
    public void getPass(String name,org.omg.CORBA.StringHolder pass)
    System.out.println("Server pass = " + pass);
    if (name.equals("lxh"))
    pass = new org.omg.CORBA.StringHolder("1234");
    if (name.equals("cbj"))
    pass = new org.omg.CORBA.StringHolder("5678");
    HelloClient:
    public class HelloClient
    public static void main(String args[])
    try{
    org.omg.CORBA.StringHolder Pass = null;
    if (args.length == 1)
    System.out.println("Client pass = " + args[0]);
    helloRef.getPass(args[0],Pass);
    System.out.println(Pass);
    } catch(Exception e) {
    When I run client main method with parameter "lxh",I will get a error says the getPass() parameter which has given is wrong.
    How to use the out parameter in client?

    Does this error only occurs if you pass "lxh" or always?
    Did you try passing a StringHolder Object rather than a NULL Object?
    Perhaps you can post the error message!?

  • How to use bind variables in this procedure

    Hi Experts,
    How to use bind variables in this procedure for static queries.
    PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
    IS
    BEGIN
    V_date DATE;
    SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
        DELETE FROM MER_CLEAR
        WHERE MER_DT < v_date
        AND ID = M_ID;
    COMMIT;
    END;   
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    Please help me.
    Thanks.

    976208 wrote:
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
    Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
    Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
    Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
    One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool.

  • How to use the out parameter of a transformation

    Hi All,
    I have a requirement where I need to move all the transformations from process flows to map.SO for each transformation I need to have 1 map which calls this transformation.I have 1 transformation which has both input and output parameter.If I use this transformation in mapping then how to use the out parameter of thsi transformation.This out parameter needs to beused in other mappings.Can soemone please help me.
    Thansk in advance

    Hi,
    I'm not quite sure what you are trying to do.
    What works: Connect the outgroup of a pre- or post-mapping process operator to the mapping output parameter operator..
    What does not work: Connect the outgroup of an operator that can return more than one row (e.g. table operator, filter, joiner ,...) to the mapping output parameter operator. The mapping output parameter just returns "one row", like a pl/sql function call.
    You cannot pass a "data stream" from one mapping to another. Maybe the pluggable mappings is what you are looking for.
    Regards,
    Carsten.

  • How to use order by in stored procedure base block?

    How to use order by in stored procedure base block? I need to change order by dynamically

    Use SET_BLOCK_PROPERTY('BLOCK_NAME',ORDER_BY,'COLUMN_NAME1, COLUMN_NAME2');

  • How to use ET_ATTACH importing parameter Function module BBP_PD_SC_CREATE

    hi,
    how to use ET_ATTACH importing parameter of Function module BBP_PD_SC_CREATE, my requirement is to create SC with attachment.
    an example would really help.
    Kind Regards,
    Kailash.

    Hi,
    Generally we create the SC from ITS or Portal, and there in the Create SC screen , once you add the item into the shopping cart , in the Item details, there is the section called , Documents and Attachements, where in you can upload the attachments which ever you want. Sometimes the extn .DOC, .pdf and .xls are allowed. but that also you can check which are the Authorized files extns avaialbe in Backend R/3.
    Using the FM RFC_READ_TABLE, in table pass TDWP and in the i_field pass 'APPSFX' and then you can get the authorized file formats. in Backend Transaction DC30 you can verify which are the allowed file formats.
    Moreover for restricting the User from uploading the attachment BADI BBP_ITEM_CHECK_BADI can be implemented for raising the error message if required.
    Regarding the ET_ATTACH, it is the structure of type BBPT_PDS_ATT_T,  so you have to provide the complete details for this structure. Like : GUID, P_GUID ,LOGICAL_SYSTEM, DESCRIPTION, URL, TYPE,DISP_URL, PHIO_EXT ,etc.
    Once all the entries are fine.
    You can create the SC, but the recommeded way for creating the SC is thru ITS or Portal.
    I hope this will help. Feel Free while asking questions.
    Thanks and Regards,
    Ankur Goyal

  • How to use pool connection run oracle procedure?

    Hi, All:
              I am facing a difficulty I can not find the solution. Maybe you can help
              me.
              I want to call an oracle stored procedure whenever I talk to datebase to
              make the application more efficient. I was able to run the procedure using
              oracle thin driver but not the connection pool using Weblogic jDriver for
              JDBC2.0.
              Please check the following code and see what I did wrong:
              The code in JSP file in Weblogic:
              <%-- JSP page directive --%>
              <%@ page
              import="java.io.*,java.util.*,java.sql.*,weblogic.common.*,weblogic.jdbc20.c
              ommon.*" %>
              <%-- JSP Declaration --%>
              <%!
              protected Connection con = null;
              ResultSet rset = null;
              %>
              <%-- JSP Scriptlet --%>
              <% try {
              Properties props = new Properties();
              props.setProperty("user", "james");
              props.setProperty("password", "aimjames");
              Driver myDriver =
              (Driver) Class.forName
              ("weblogic.jdbc.pool.Driver").newInstance();
              con = myDriver.connect("jdbc:weblogic:pool:hdj2Pool", props);
              String userid = (String)session.getAttribute("user.id");
              int subid =
              Integer.parseInt((String)session.getAttribute("sub.id"));
              String query = "begin pkg_select.sel_req_in_001(" + userid +
              ", " + subid + ", ?); end;";
              weblogic.jdbc.common.OracleCallableStatement cstmt =
              (weblogic.jdbc.common.OracleCallableStatement)con.prepareCall(query);
              cstmt.registerOutParameter(1,java.sql.Types.OTHER);
              cstmt.execute();
              rset = cstmt.getResultSet(1);
              When I run this JSP file, the compilation is fine but the result shows
              nothing. That's means I can not get the ResultSet for some reason.
              The working file when I use oracle thin driver (NOT use a connection pool):
              String userid = (String)session.getAttribute("user.id");
              int subid = Integer.parseInt((String)session.getAttribute("sub.id"));
              String query = "begin pkg_select.sel_req_in_001(" + userid +", " +subid
              +", ?); end ";
              CallableStatement cstmt = con.prepareCall(query);
              cstmt.registerOutParameter(1,OracleTypes.CURSOR);
              cstmt.execute();
              ResultSet rset = (ResultSet)cstmt.getObject(1);
              You may notice that I am trying to bind a parameter to an Oracle cursor. Is
              there anything I did wrong in using weblogic API? I just want to let you
              that in the weblogic JSP file, I also tried to use
              weblogic.jdbc.oci.CallableStatement and
              weblogic.jdbc20.oci.CallableStatement instead of
              weblogic.jdbc.common.OracleCallableStatement, but none of them seems work.
              I did check the bea site at
              http://www.weblogic.com/docs51/classdocs/API_joci.html#1080420 for the
              example to use:
              cstmt.registerOutParameter(1,java.sql.Types.OTHER);
              and I think I followed the exact procedure the example did.
              Please help!
              James Lee
              Artificial Intelligence in Medicine, Inc.
              2 Berkeley Street, Suite 403
              Toronto, Ontario M5A 2W3
              Tel: 416-594-9393 ext. 223
              Fax: 416-594-2420
              Email: [email protected]
              

    Joseph
    Thanks for the suggestion about latest version of Weblogic Server.
    "coding best-practices" is not mentioned in the post.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    It is reasonable to expect servlet to run significantly faster with connection pooling.
    Is it true that geting and close a connection whenever
    one time database access finished?
    Already answered. Applications use a connection from the pool then return it when finished using the connection.
    Will the solution affect the servlet performance?
    Yes. Already answered. Connection pooling enhances performance by eliminating the costly task of creating database connections for the application.
    Is there any official document to introduce connection pool program?
    For the latest version
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13726/toc.htm
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13737/jdbc_datasources.htm#insertedID0

  • How to use array or type in "IN" criteria

    Hi all,
    anybody knows how to use group of same datatype data ( array or type ) in SQL statement
    For example
    ls_dept[1] = 'abc';
    ls_dept[2] = 'xyz';
    ls_dept[10] = 'ppr';
    i want to use this group of data in "IN" criteria like
    Select * from department where dept in ('abc','xyz'.....''ppr');
    if anybody know how to use please reply me as soon as possible.
    Thanks,

    I hope you are not suggesting concatenating literals from a web front-end application ;) Is it not what he was saying.. he is getting user input info from an application.. if the user sends multiple values.. he has to build a string with concatenating literals..
    correct me if I am wrong.

  • How to use the region parameter of main report for subreport chart titles?

    I am using Crystal Reports 11.
    I create 1 main report with 10 sub-reports that contain cross-tabs & charts. The main report has a parameter regarding 3 different areas: region1, region2, and region3.
    I use the method of adding the u2018regionu2019 parameter of main report to the selection formula of the sub-reports. So, I can select 'region' from main report to controll outputs in sub-reports by region.
    I use formulas for chart titles, e.g.:
    Select {Product Code}
    Case 'a111':
      u2018Region1 u2013 a111 Counts'
    Case u2018b222u2019:
      u2018Region1 u2013 b222 Counts'
    u2026
    u2026
    Default:
    u2026
    Since I pass the u2018regionu2019 parameter of main report to sub-reports, I have to change chart titles dynamically based on the region I select.
    How can I use the region parameter from main report in the formulas to get chart titles dynamically?
    Thank you in advance.

    Thank you.
    I am not using Chart Title with "Chart Expert".
    I am using a formula for chart titles, e.g.:
    Select {Product Code}
    Case 'a111':
      u2018Region1 u2013 a111 Counts'
    Case u2018b222u2019:
      u2018Region1 u2013 b222 Counts'
    u2026
    u2026
    Default:
    u2026
    I drag this formula above the charts and it looks like a dynamic title. So, for product a111, the chart title would be "Region1 u2013 a111 Counts"; for product b222, the chart title would be "Region1 u2013 b222" Counts; and so on ...
    Because I pass the region parameter from master report to subreport, I want to change the region part of the chart titles dynamically.
    For example,
    when select Region1, the chart titles should be: "Region1 u2013 a111 Counts"; "Region1 u2013 b222"; ...
    when select Region2, the chart titles should be: "Region2 u2013 a111 Counts"; "Region2 u2013 b222"; ...
    I want to add the region parameter into the tiltle formula.
    How should I do?

  • How to use @jws:sql call Stored Procedure from Workshop

    Is there anyone know how to use @jws tag call Sybase stored procedure within
    Workshop,
    Thanks,

    Anurag,
    Do you know is there any plan to add this feature in future release? and
    when?
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    In the current release, we do not support calling stored procedures from a
    database control. You will have to write JDBC code in the JWS file to call
    stored procedures.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Anurag,
    I know how to use DB connection pool and create a db control with it. In
    fact, we have created a Web Service with the db control using plain SQL
    in
    @jws:sql. However, my question here is how to use @jws tag in Weblogic
    Workshop to create a Web Services based on Sybase stored procedure orany
    Stored Proc not plain SQL.
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    You can use a database control to obtain a connection from any JDBC
    Connection Pool configured in the config.xml file. The JDBC Connectionpool
    could be connecting to any database, the database control is
    independent
    of
    that.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Is there anyone know how to use @jws tag call Sybase stored
    procedure
    within
    Workshop,
    Thanks,

  • LinkToAction how to use it with parameter?

    Hello,
    searching for tutorials about the use of the LinkToAction I have seen that here is a possiblity in WD4J to use a context-node.
    How can you pass a parameter in WD4A? (I am using a rowrepeater for a list of books and would like to pass the bookID to the event)
    How can I do this?
    Thanks a lot,
      Vanessa

    Thanks for your answer Lekha,
    unfortunaltely I don't get the point.
    >
    Lekha wrote:
    > From this action if you want to export the bookid then it should be a exporting parameter..
    >
    > you can specify this way...
    Somehow I don't get the point. How can I pass the bookid to the method?
    I have a rowrepeater. One of the elements is the link to the action. I will add the bookid as parameter. That is clear.
    My problem is how to connect the bookid of the row that is displayed to the method? Is it just because of the name? I don't see any context I can associate?
    Could you please go a little bit more in detail,
      Vanessa

  • Parameter Form-How to use a user parameter to retrieve list of values for another par

    I am developing a report in Reports 6i. There are 2 parameters on parameter form namely year and month.
    LOV for Year is retrieved from database. After user selects a value from LOV for year, I want to retrieve another LOV for month parameter based on selected year. That is how can we use a user parameter's value to dynamically retrieve an LOV for another parameter on the same parameter form.
    Pl. guide.
    Thanks in anticipation.

    You can't restrict the "List of Values" of one parameter based on the value of another parameter within the Reports Builder/Runtime parameter form.
    The SQL select statements within LOV's are only executed once. They aren't re-calculated when you enter, leave or change other field values in the parameter form. This is mainly because there is no event model in the Reports parameter form and it only supports basic form functionality.
    To do what you're after in a client-server environment you need to create an Oracle Forms "parameter form" and use that to execute the Report using the run_product() call. Actually, you should probably use Oracle Forms for any more generic "form" functionality such as radio buttons or check boxes.
    If you're in a Web rather than Client-Server environment, it may be easier to create a JSP based parameter form. You can then use Reports 9i since it has JSP support to assist here.

  • How to use Array in Formcalc?

    Please share syntax for using Array in Formcalc.

    Hi,
    FormCalc is a simple scripting language and does not support objects like arrays.
    The only function that come close to an array in JavaScript is Choose(),
    This first parameter selects the nth value of the following comma separated strings.
    Choose(3, "String1", "String2", "String3", "String4")
    returns String3

  • How to use Dynamic cascading parameter in crystal Report XI ?

    Hi,
    I want to use Dynamic cascading parameter in crystal Report XI which is to be viewed through the infoview without using the Business View.Is it possible?
    I could implemented Dynamic cascading parameter using the CR XI developer without using Business View, but cannot view the report when uploaded it to BOXI, through infoview.
    Please suggest..
    Thanks in advance..
    Rajneesh

    In the crystal reports field explorer>right click on parameter field>create new-->name the parameter field and select the type as dynamic. Now in the value field click the row and add the database field also add another field below that by clicking on the next row so..on. The order should be like this parent field first and then child field next...... Also click on the last column to add parmater for each level.
    Regards,
    Raghavendra

Maybe you are looking for