How to call a package with ADO?

I have designed a package which include a procedure. And I have a program coded in ASP.
How to call this package with ADO. Please give a sample.

Hi,
I persume that you are facing this problem when u try to code in VB. If that is the case here comes the code.........
OraDatabase.Parameters.Add "A_NBR_NEWSID", A_NBR_NEWSID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "A_NBR_TOPICID", A_NBR_TOPICID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "A_NBR_USERID", A_NBR_USERID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "result", 0, ORAPARM_OUTPUT
OraDatabase.Parameters("result").serverType = 2
OraDatabase.ExecuteSQL ("declare result Number; Begin :result := PKG_CONTENT_MANAGEMENT.FUN_GET_NEWS_PERM_BY_USERID(:A_NBR_NEWSID, :A_NBR_TOPICID, :A_NBR_USERID); end;")
OraDatabase.Parameters.Remove "A_NBR_NEWSID"
OraDatabase.Parameters.Remove "A_NBR_TOPICID"
OraDatabase.Parameters.Remove "A_NBR_USERID"
FUN_GET_NEWS_PERM_BY_USERID = OraDatabase.Parameters("result").Value
OraDatabase.Parameters.Remove "result"
Hope this clear your doubt..
Raj

Similar Messages

  • How to call a package with OO4O?

    I have designed a package which execute a procedure.
    How can I call it with OO4O?
    Please give me a sample code.

    Hi,
    I persume that you are facing this problem when u try to code in VB. If that is the case here comes the code.........
    OraDatabase.Parameters.Add "A_NBR_NEWSID", A_NBR_NEWSID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "A_NBR_TOPICID", A_NBR_TOPICID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "A_NBR_USERID", A_NBR_USERID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "result", 0, ORAPARM_OUTPUT
    OraDatabase.Parameters("result").serverType = 2
    OraDatabase.ExecuteSQL ("declare result Number; Begin :result := PKG_CONTENT_MANAGEMENT.FUN_GET_NEWS_PERM_BY_USERID(:A_NBR_NEWSID, :A_NBR_TOPICID, :A_NBR_USERID); end;")
    OraDatabase.Parameters.Remove "A_NBR_NEWSID"
    OraDatabase.Parameters.Remove "A_NBR_TOPICID"
    OraDatabase.Parameters.Remove "A_NBR_USERID"
    FUN_GET_NEWS_PERM_BY_USERID = OraDatabase.Parameters("result").Value
    OraDatabase.Parameters.Remove "result"
    Hope this clear your doubt..
    Raj

  • How Create procedure or function with ADO ?

    Hello,
    How Create procedure or function with ADO?It's my question.
    Thanks.
    Henri

    This message if post by Taiwan-ChangHaw-Oracle-Stored-Procedure-For-Business-Rule-Club
    public bool ConnectDatabase()
    try
    { string strConnectionString =
    "Provider=OraOLEDB.Oracle" +";"+
         "Data Source=" + ConnectionParams.Datasource +";"+
    "User Id =" + ConnectionParams.Username +";"+
    "Password =" + ConnectionParams.Password;
         m_conn=new ADODB.Connection();
         m_conn.ConnectionString=strConnectionString;
         m_conn.Open("","","",0); //i_"YYAOl Open the connection
    catch(Exception e)
    {     System.Windows.Forms.MessageBox.Show(e.Message);
         return false;
    return true; //YYAOl_B>3I9&connected successfully
    public void InsertDescription(string p_product,string p_language,string p_tname,string p_tdescription)
    { string sql="{Call inserttranslateddescription(?,?,?,?,?)}";
    try
    { ADODB._Command cmd=new ADODB.Command();//Create a command object
    cmd.ActiveConnection=m_conn; //Set its active connection to open connection
    ADODB.Properties properties=cmd.Properties;//Get the command properties into ADODB Properties object
    IEnumerator ienum=properties.GetEnumerator();//Get an enumerator on above properties
    ADODB.Property singleprop;
    while(ienum.MoveNext()) //iterate through the enumerator
         {singleprop=(ADODB.Property)ienum.Current;//Get the current property from enumerator
         string propname= singleprop.Name; //Get the name of current property
         if(propname.Equals("NDatatype")) //if the property is 'NDatatype' set its value to true
         singleprop.Value=true;
    cmd.CommandType=ADODB.CommandTypeEnum.adCmdText;
    int pid=Int32.Parse(p_product);
    ADODB._Parameter langid     =cmd.CreateParameter("langid",          ADODB.DataTypeEnum.adChar,ADODB.ParameterDirectionEnum.adParamInput, 100,p_language);
    ADODB._Parameter productid =cmd.CreateParameter("productid",     ADODB.DataTypeEnum.adNumeric,ADODB.ParameterDirectionEnum.adParamInput, 100,pid);
    ADODB._Parameter tname =cmd.CreateParameter("tname",          ADODB.DataTypeEnum.adBSTR,ADODB.ParameterDirectionEnum.adParamInput, 50,p_tname);
    ADODB._Parameter tdescription=cmd.CreateParameter("tdescription",ADODB.DataTypeEnum.adBSTR,ADODB.ParameterDirectionEnum.adParamInput, 50,p_tdescription);
    ADODB._Parameter check          =cmd.CreateParameter("check",          ADODB.DataTypeEnum.adNumeric,ADODB.ParameterDirectionEnum.adParamOutput,100,0);
    cmd.Parameters.Append(langid);
    cmd.Parameters.Append(productid);
    cmd.Parameters.Append(tname);
    cmd.Parameters.Append(tdescription);
    cmd.Parameters.Append(check);
    cmd.CommandText=sql;
    //Execute the command to insert product details in database
    object recs;
    object param=p_language;
    cmd.Execute(out recs,ref param,1);
    ienum.Reset();
    while(ienum.MoveNext()) //iterate through enumerator
    { singleprop=(ADODB.Property)ienum.Current;//Get the current property in to Property object
    string propname= singleprop.Name; //Get the name of current property
    if(propname.Equals("NDatatype")) //if it is 'NDatatype' set its value to true
    singleprop.Value=false;
    IEnumerator iprop=cmd.Parameters.GetEnumerator();//Get the enumerator for command parameters
    while(iprop.MoveNext()) //loop through enumerator
    { //Get the current parameter in enumerator
    ADODB._Parameter checkval=(ADODB._Parameter)iprop.Current;
    if(checkval.Name.Equals("check")) //if the parameter is 'check'
    if(checkval.Value.ToString().Equals("0")) //If check's value is zero data was inserted
    System.Windows.Forms.MessageBox.Show("Product details Inserted successfully");
    else
    System.Windows.Forms.MessageBox.Show("Product Details Updated");//else data was updated
    catch(Exception e)
    System.Windows.Forms.MessageBox.Show(e.Message);//Display any error message
    }

  • How to call PDF Report with parameters in jdeveloper 10.1.3

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to call standard report with in zprogram?

    Hi Sap experts,
    How to call standard report with in zprogram.
    For example if country is 'US' then call Zprogram(zprog_US).Inside zprogram call standard report(rhecm_change_proc_status).If country is 'CA' then call zprogram.Inside zprogram call standard report.For same othercountres like 'PR','GB','ES'.Actually HR_ECM_READ_FEATURE_CARGP will having the input as employee id and will return the CAREA(County like 'US','PR'......).Kindly help me what is the procedure?
    Regards,
    Sujan

    >
    sujan T wrote:
    > Thanks for your reply.
    >
    >    What is the logic to call the standard report from zprogram?Inside the zpogram how to call standard report?
    >
    > Regards,
    > Sujan
    no special logic is required
    If u want to use
    RPUAUDOO IN THE ZREPORT.
    Put the submit button where ever required
    ex: In zreport after certain process reacedu want to call then use
    submit rpuaudoo and return.
    Regards
    Sas

  • How to call a form with dabble clicking on a record with one time where

    Hi All,
    How to call a form with dabble clicking on a record with one time where clause. I mean when i dabble click on the current record i want to call another form with details of the
    record with onetime where clause. Can anyone help me in this regard.
    Now i am calling a form with parameter with onetime where but this should avoid.
    Thanks in advance
    Arif

    Hello,
    I mistakenly mark it as solved. There is a problem remain. when i placed the code below it do not execute with the where condition. I mean the condition to execute is not work.
    All records executes. Please correct my code--
    Here the WHEN-BUTTON-PRESSED-trigger on the Edit-Button:
    :GLOBAL.MODE:='EDIT';
    :GLOBAL.REQ_ID:=:PROBLEM_REQUEST.REQ_ID;
    CALL_FORM('REQUEST_ID_PARAM',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY);And also, WHEN-NEW-FORM-INSTANCE-trigger of REQUEST_ID_PARAM:
    DEFAULT_VALUE(NULL, 'GLOBAL.MODE');
    DEFAULT_VALUE(NULL, 'GLOBAL.REQ_ID');
    IF :GLOBAL.MODE='EDIT' THEN
    GO_BLOCK('PROBLEM_REQUEST');
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('PROBLEM_REQUEST', INSERT_ALLOWED, PROPERTY_FALSE);
    END IF;Arif

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • How to call a transaction with a variant

    Hi all
    I created a bdc program after updating it should call another transaction with predefined variant that that transaction program is of type module pool.
    can anyone tell me the syntax how to call a transaction with a variant.

    Hi
    goto Tcode SHD0
    enter the Tcode for which Tran Variant has to be created(dialog Tcode)
    enter Trans variant to be created
    press create button
    it will go through all the screens of that Tcode and save
    and modify the fields as per requirement
    we can create Transaction Variants Using SHD0 Transaction.
    Transaction Variants and Screen Variants
    Transaction variants can simplify transaction runs as they allow you to:
    Preassign values to fields
    Hide and change the 'ready for input' status of fields
    Hide and change table control column attributes
    Hide menu functions
    Hide entire screens
    In particular, hiding fields in connection with screen compression, and hiding screens, can result in greater clarity and simplicity.
    Transaction variants are made up of a sequence of screen variants. The field values and field attributes for the individual screens found in transaction variants are stored in screen variants. Each of these variants is assigned to a specific transaction, can, however, also contain values for screens in other transactions if this is required by transaction flow. The transaction that the variant is assigned to serves as initial transaction when the variant is called.
    There are both client-specific and cross-client transaction variants. All screen variants are cross-client, but may be assigned to a client-specific transaction variant.
    A namespace exists for cross-client transaction variants and screen variants and both are automatically attached to the Transport Organizer. Client-specific transaction variants must be transported manually.
    In principle, transaction and screen variants can be created for all dialog and reporting transactions. There are, however, certain Restrictions that apply to certain transactions, depending on their internal structure.
    No transaction variants are possible with transactions already containing preset parameters (parameter transactions and variant transactions).
    Regards
    Anji

  • How to call a package from a different instance?

    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    Regards
    Terry

    Terry Chen wrote:
    Dear all:
    how to call a package from a different instance?
    for example:
    package A belongs to instance A1
    package B belongs to instance B1
    Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
    First you have to create create dblink in A1 database as below
    CREATE DATABASE LINK INSA1
       CONNECT TO USER_NAME IDENTIFIED BY <pass>
       USING 'B!' Then you can execute exec pack_b@INSA1;

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • How could I transport package with all content within

    How could I transport package with all content ( I do not get it with se80->"write transport entry") or by entering in se10 in transport request object R3TR DEVC.

    go to SE03
    choose the third item "include objects in a request" by double-clicking
    there you set the first parameter "Package" to your package and execute
    note: you can also deselect the radiobutton "All objects" and set "Selected objects" then you will be able to fine-tune the list of objects

  • How to call a package in Oracle

    I'm trying to call a package in oracle
    (this is the oracle way of calling it :
    begin pck$xl.get_year_low_high_to_date(:compid, 20010801 , 20020108 ",:year_low,:year_high,:year_average,:low_date,:high_date); end;)
    but i can't get it right.
    I'm new to package calling in Oracle from Java, till now i only worked with SQL statements without parameters of that kind, can someone help me with this?
    ps the ":compid" is a parameter i have to fill in and provide...
    thank you very much

    ok here is a test i do...
    but still doesn't work something about the bindvariables (check errorlog). I know a bit jdbc and i understant what you mean, but the problem is i don't know how this should go :(
    please advise
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    import java.io.*;
    * @author  U97488
    public class test {
        public static void main(String[] args) {
            try{
                ConnectionSherpa cs = ConnectionSherpa.getInstance("ConnectionSherpa");
                Connection conn = cs.getConnObj();
                String sSQL = "begin?; pck$xl.get_year_low_high_to_date(?, 20010801, 20020801 ,:year_low,:year_high,:year_average,:low_date,:high_date); end;";
                CallableStatement stmt = conn.prepareCall(sSQL);
                stmt.setString(1, "BRU10");
                System.out.println(stmt.toString());
                if(stmt.execute(sSQL)){
                    System.out.println(stmt.getString(2));
            }catch (Exception e){
                e.printStackTrace();
    }StackTrace:
    java.sql.SQLException: ORA-06550: Regel 1, kolom 6:
    PLS-00110: Bindvariabele '1' is niet toegestaan in deze context..
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
            at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
            at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
            at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
            at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
            at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1839)
            at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1764)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2354)
            at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:909)
            at com.kbcsecurities.taminoupdate.servlets.test.main(test.java:28)

  • How to call a function with pl/sql

    How does one call a function with pl/sql that uses a function?

    Hi,
    How does one call a function with pl/sql that uses a
    function?I'm not sure what you mean.
    In PL/SQL function can be used just about anywhere where an expression (with the same data type that the function returns). Arpit gave a very common example.
    Here's another example, where all the functions take a single NUMBER argument and return a NUMBER, so they can all be used in places where NUMBERs are used:
    IF  fun_a (fun_b (0)) < fun_c (1)
    THEN
        UPDATE  table_x
        SET     column_y = fun_d (2)
        WHERE   column_z = fun_e (ROUND ((fun_f (3), fun_g (4)));You call a function simply by using its name, followed by its argument list, if any.
    If the function is in a package, you must call it with the package name, like "pk_foo.bar (1, 2, 3)", unless the call comes from within the same package.
    If the function is owned by someone else, you must give the owner name, like "scott.bar (SYSDATE)" or "scott.pk_foo.bar (1, 2, 3)". You can create synonyms to avoid having to name the owner.

  • How to call a function with parameters in ScriptStart function

    i am trying to call ScriptStart function from SUD dialog. This is how iam calling Call ScriptStart(path & "test.vbs","abc") abc is function which is written test.vbs. It is working. But when i want to pass some parameters to the abc function of test.vbs. It is not working why. can anybody suggest where i went wrong. I am calling the same function as Call ScriptStart(path & "test.vbs","abc(" & text1.Text & ")"). It is not working why ? Is the ScriptStart function only point to functions. it does not take any parameters or waht ?

    Hi abc421,
    Another option in addition to UserCommands would be to use ScriptInclude(path). If you execute a ScriptInclude(path) command at the beginning of your VBScript, then all the functions and Subs in the VBscript located at "path" are now available to you-- including passing parameters and receiving return values from functions. If you are calling a VBscript that uses only VBScript variables, then this is the preferred method.
    If instead you are calling a VBScript that uses global DIAdem variables declared in a VAS file (their variable names all end with the "_" character), then those parameters are already available at the subroutine called with ScriptStart(path, routine).
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for

  • Upload Open Purchase orders

    Hi All, Our client is implementing SRM and the conversion is  from non-sap legacy system. Is there a way to upload all the Open PO's without manually keying it in. Thanks, Reena

  • HT5622 Why my Apple ID can not use in Mac App store?

    I have two Apple ID, and i tried both Apple ID. They are both doesn't work. I don't know why.

  • Change font size of contact form.

    Hi, I have been searching through google and various forums to make a contact form, and I finally have it working. (YAY!) HOWEVER... There's one problem: I don't know how to change the font size. Help?! Here's my action script code: submit_btn.addEve

  • Here Drive + Beta (Navigation region issue)

    Hi all. Well, long story short , i had a Lumia 800 until march and recently bought a Lumia 920, so i gave the 800 to my sister, till now all is good except for the shocking news i discovered yesterday when tried to navigate to a destination and here

  • Adding custom fields to SRM UI Add-on

    Dear SAP Experts, We enabled SRM UI and followed the SAP provided configuration guide to complete all the required setup's. we are able to create shopping cart using the new UI without any issues. Now we are trying to enable custom fields on new SRM