function call problem ???????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    function call problem ???????

    i have function ......

    function GetRoyaltyCessR ate(p_location_ id in number, p_product_id in number, p_calculation_d ate in date,p_basic_va lue in number,
    p_royaltycess_i d out typ_snm_number_ array, p_desc out typ_snm_char_ar ray, p_effective_dat e out typ_snm_date_ar ray,
    p_rate out typ_snm_number_ array) return number;


    the problem arises when we pass the current date ... like ...

    stmt.setDate(4, my_code) ...... what will be the my_code .....

    plz help me out ....

    lot of thanx in advance .........
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by dmjpro
    i have function ......

    function GetRoyaltyCessR ate(p_location_ id in number, p_product_id in number, p_calculation_d ate in date,p_basic_va lue in number,
    p_royaltycess_i d out typ_snm_number_ array, p_desc out typ_snm_char_ar ray, p_effective_dat e out typ_snm_date_ar ray,
    p_rate out typ_snm_number_ array) return number;


    the problem arises when we pass the current date ... like ...

    stmt.setDate(4, my_code) ...... what will be the my_code .....

    plz help me out ....

    lot of thanx in advance .........

    Ok, what is your error message? You are not calling that function in the line of code you gave. For help with statements, and their syntax - (and here I am assuming you are using descriptive names and referring to a statement), look at the javadocs.

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      sorry here is my code .......


      CallableStateme nt func = l_con.prepareCa ll("{?=call Pkg_Name.GetRoy altyCessRate(?, ?,?,?)}")
      func.setInt(2,n umber);
      func.setInt(3,n umber);
      func.setDate(4, what will be the code);
      func.setInt(5,n umber);
      func.registerOu tParameter(1,Ty pes.INTEGER);

      now my problem is .... when i call the funciton using func.executeQue ry() then SQlException occures ..... telling ..... ORA-06512 wrong number of arguments ..... at line x column y ... something linke this .....

      actually i want to pass sysdate ... or another date ....

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        unfortuantely i misguided .. and got the solution ....

        i missing the parameter and parameter types .......

        a good solution ever i have had ....

        Comment

        Working...