syntax for calling stored function


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: syntax for calling stored function

  1. #1
    Joar Vatnaland Guest

    syntax for calling stored function


    Is the syntax for calling a stored function exactly the same as for calling
    a stored procedure?

    I have a stored procedure, and I can call it, but the stored function I cannot
    call, the error message says that the procedure does not exist (true, because
    it is a function, not a procedure). I know the function is there, because
    it belongs to the same package body as the procedure, and I can list it in
    SQL Plus.

    The function returns a NUMBER, and I'm calling it like this.
    (After filling up the command object's parameter collection):

    objCommand.CommandText = "{call GetCount(?,?,?)}"
    hits = objCommand.Execute

  2. #2
    Levi Nkata Guest

    Re: syntax for calling stored function

    Have you tried to qualify your calling statement with the package name?

    e.g.

    objCommand.CommandText = "{call PACKAGENAME.GetCount(?,?,?)}"
    hits = objCommand.Execute

    Levi

    "Joar Vatnaland" <joar@synopsys.co.uk> wrote in message
    news:132_3a5dd800$1@news.devx.com...
    >
    > Is the syntax for calling a stored function exactly the same as for

    calling
    > a stored procedure?
    >
    > I have a stored procedure, and I can call it, but the stored function I

    cannot
    > call, the error message says that the procedure does not exist (true,

    because
    > it is a function, not a procedure). I know the function is there, because
    > it belongs to the same package body as the procedure, and I can list it in
    > SQL Plus.
    >
    > The function returns a NUMBER, and I'm calling it like this.
    > (After filling up the command object's parameter collection):
    >
    > objCommand.CommandText = "{call GetCount(?,?,?)}"
    > hits = objCommand.Execute




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center