Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6983385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:24:44+00:00 2026-05-27T18:24:44+00:00

I have Oracle function declared as create or replace FUNCTION CheckScan( pMode IN number,

  • 0

I have Oracle function declared as

create or replace FUNCTION CheckScan(
  pMode IN number, 
  pAgrISN in number, 
  pAgrId in varchar2, 
  pDocISN in number, 
  pRefundId in varchar2) RETURN NUMBER IS  ...

And client Visual Basic 6 code that connects to Oracle as administrator like:

…

cmd.ActiveConnection = conn
cmd.CommandText = "CheckScan"
cmd.CommandType = 4 'adCmdStoredProc

Dim pMode As Integer
Dim pAgrISN As Integer
Dim pAgrId As String
Dim pDocISN As Integer
Dim pRefundId As String

pMode = 2
pAgrISN = 12345
pAgrId = "Some-Id"
pDocISN = 12345
pRefundId = "Some-id"

cmd.Parameters.Append cmd.CreateParameter("pMode", 131, 1, 10, pMode)
cmd.Parameters.Append cmd.CreateParameter("pAgrISN", 131, 1, 10, pAgrISN)
cmd.Parameters.Append cmd.CreateParameter("pAgrId", 200, 1, 255, pAgrId)
cmd.Parameters.Append cmd.CreateParameter("pDocISN", 131, 1, 255, pDocISN)
cmd.Parameters.Append cmd.CreateParameter("pRefundId", 200, 1, 255, pRefundId)

cmd.Execute

This code ends with:

PLS-00221: "CHECKSCAN" is not a procedure or is undefined

What is wrong here? Function was compiled successfully.

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:24:44+00:00Added an answer on May 27, 2026 at 6:24 pm

    Since you have a function (and not a procedure), you have to do something with the return value. Add the following parameter:

    With cmd
        .Parameters.Append .CreateParameter("pRetval", adNumeric, adParamReturnValue)
        .Parameters.Append .CreateParameter("pMode", adNumeric, adParamInput, 10, pMode)
        .Parameters.Append .CreateParameter("pAgrISN", adNumeric, adParamInput, 10, pAgrISN)
        .Parameters.Append .CreateParameter("pAgrId", adVarChar, adParamInput, 255, pAgrId)
        .Parameters.Append .CreateParameter("pDocISN", adNumeric, adParamInput, 255, pDocISN)
        .Parameters.Append .CreateParameter("pRefundId", adVarChar, adParamInput, 255, pRefundId)
    
        .Execute
    End With
    

    Update:

    The order of the parameters is relevant. It must start with the return type. Then all parameters of the function must follow in the order they were declared. The names of the parameters are irrelevant however because positional (and not named) parameters are used internally. This is obvious if you look at the CommandText property of cmd:

    "{ ? = call CheckScan(?, ?, ?, ?, ?) }"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Oracle function: function get_job_no return number is V_job_no number; begin
We have an Oracle type that's declared as such: CREATE OR REPLACE TYPE its_accountarray;
We have a function written in pl/sql(oracle) as below: CREATE OR REPLACE PROCEDURE folder_cycle_check
I have a function in Oracle that returns a sequence number. When I try
I have some code that uses the Oracle function add_months to increment a Date
I have a simple function written in Oracle 9i (version 9.2.0.4.0) to simulate an
I have a PL/SQL function (running on Oracle 10g) in which I update some
I have a VB.Net function which executes a Oracle Stored Proc and returns a
i have a type as follows: CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
I have an Oracle function that returns a record set. I introduced parameters to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.