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 8677939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:35:27+00:00 2026-06-12T20:35:27+00:00

I am calling an Oracle packaged function from SQL Server 2008 R2 and am

  • 0

I am calling an Oracle packaged function from SQL Server 2008 R2 and am getting the following error:

OLE DB provider “OraOLEDB.Oracle” for linked server “TEST” returned
message “ORA-06502: PL/SQL: numeric or value error: character string
buffer too small

Here is the call I am attempting to make:

  DECLARE @p_pidm VARCHAR(8)
  DECLARE @p_emal_code VARCHAR(4)
  DECLARE @p_email_address VARCHAR(90)
  DECLARE @p_rowid VARCHAR(18) = NULL
  DECLARE @p_exists VARCHAR(1)

  SET @p_pidm = '11111'
  SET @p_emal_code = 'POA'
  SET @p_email_address = 'mytest@email.com'

  EXECUTE ('BEGIN ? := gb_email.f_exists(?,?,?,?);END;',@p_exists, @p_pidm, @p_emal_code, @p_email_address, @p_rowid)
  AT [TEST]

If I execute this call in SQL Developer it works fine. here’s the query I’m executing there:

set serveroutput on ;
DECLARE rec_exists VARCHAR2(1) ;
begin
rec_exists := gb_email.f_exists(11111,'POA','mytest@email.com',NULL);
DBMS_OUTPUT.PUT_LINE(rec_exists);
end;

I’ve tried changing the size of @p_exists to VARCHAR(MAX) and that did nothing. I’ve verified that all of the variables I’ve declared match the definition for the package/function I’m calling.

This is not something I have to do often so any help in solving this problem would be greatly appreciated.

Here’s the function definition:

FUNCTION f_exists(p_pidm          goremal.goremal_pidm%TYPE,
                  p_emal_code     goremal.goremal_emal_code%TYPE,
                  p_email_address goremal.goremal_email_address%TYPE,
                  p_rowid         gb_common.internal_record_id_type DEFAULT NULL)
  RETURN VARCHAR2


Checks to see if a record exists.   


Parameters  
 p_pidm The PIDM of the entity who owns this e-mail information. NUMBER(8) Required Key     
 p_emal_code The type of the e-mail address. VARCHAR2(4) Required Key     
 p_email_address The e-mail address. VARCHAR2(90) Required Key     
 p_rowid Database ROWID of record to be selected. VARCHAR2(18)     

Returns  
 Y if found, otherwise N.
  • 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-06-12T20:35:28+00:00Added an answer on June 12, 2026 at 8:35 pm

    Okay, I found the solution. I had failed to specify the parameter as OUTPUT. Here’s the working query:

      DECLARE @p_pidm VARCHAR(8)
      DECLARE @p_emal_code VARCHAR(4)
      DECLARE @p_email_address VARCHAR(90)
      DECLARE @p_rowid_out VARCHAR(18) = NULL
      DECLARE @p_rec_exists VARCHAR(1)
    
      SET @p_pidm = '11111'
      SET @p_emal_code = 'POA'
      SET @p_email_address = 'mytest@email.com'
    
      EXECUTE ('BEGIN ? := gb_email.f_exists(?,?,?,?);END;',@p_rec_exists OUTPUT, @p_pidm, @p_emal_code, @p_email_address, @p_rowid_out)
      AT [TEST]
      SELECT @p_rec_exists
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having issues calling an Oracle FUNCTION (not a Stored Procedure) from Java
Actually I am calling oracle procedure from java file present at application server. I
I am calling oracle package, to get xml file from the package into oracleDataReader.
I have problem with calling for my procedure. Oracle scrams PLS-00306 Error: Wrong number
I am having the hardest time calling an Oracle stored procedure from a java
I'm calling some data from my Oracle table and I have a field which
Seeing some strange behavior, whereby connecting to Oracle database, and then calling external function,
I'm trying to understand different ways of getting table data from Oracle stored procedures
I'm working with SSIS 2008 and am having a problem calling an Oracle stored
I am told by someone that when calling Oracle from ADO.net, when calling multiple

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.