Home » SQL & PL/SQL » SQL & PL/SQL » HR Api Problem. (Wrong Parameters) (Oracle 10g (SQL Plus))
icon4.gif  HR Api Problem. (Wrong Parameters) [message #384965] Thu, 05 February 2009 23:15 Go to next message
taimurash
Messages: 7
Registered: February 2009
Location: Lahore
Junior Member

-- I want to create a phone no entry via my API,
-- The Code looks fine,
-- But the Error is:
-- PLS-00306: wrong number or types of arguments in call to 'CREATE_PHONE'
[/COLOR]

Declare
-- For Out Parameters.
v_object_version number;
v_phone_id number;
Begin
HR_Phone_Api.Create_Phone(
p_Validate => FALSE ,
p_date_from => To_Date('04-FEB-2008','DD-MON-YYYY'),
p_date_to => To_Date('04-MAR-2008','DD-MON-YYYY'),
p_phone_type => 'H1' , -- Mandatory In Parametr,Type of phone, validated against
-- HR_LOOKUPS.lookup_code table
-- where LOOKUP_TYPE = 'PHONE_TYPE'.
p_phone_number => '042-7075478' ,
p_parent_id => 128, -- Optional In Par
-- Id of the parent row that this
-- phone number relates to. Currently
-- the parent_id must relate to a
-- valid person_id on the PER_PEOPLE_F
-- table.
p_parent_table => 'PER_ALL_PEOPLE_F' ,
-- ** For Out Parameters.** --
p_object_version_number => v_object_version ,
p_phone_id => v_phone_id
) ;
DBMS_OUTPUT.PUT_Line(' The Phone Id created : '||v_phone_id) ;
DBMS_OUTPUT.PUT_Line(' The Object version Record: '||v_object_version) ;
End ;
Re: HR Api Problem. (Wrong Parameters) [message #384966 is a reply to message #384965] Thu, 05 February 2009 23:17 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
So we can help you & please be consistent & correct in your postings.
Re: HR Api Problem. (Wrong Parameters) [message #384967 is a reply to message #384966] Thu, 05 February 2009 23:23 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Can you provide the number of parameters for

Quote:
HR_PHONE_API.CREATE_PHONE


Procedure

Thanks
Trivendra
Re: HR Api Problem. (Wrong Parameters) [message #384968 is a reply to message #384967] Thu, 05 February 2009 23:29 Go to previous messageGo to next message
taimurash
Messages: 7
Registered: February 2009
Location: Lahore
Junior Member

There are about 41 parameters to this procedure.

I have passed valid values to the Mandatory Parameters,
even then the problem is unresolved.

Re: HR Api Problem. (Wrong Parameters) [message #384969 is a reply to message #384968] Thu, 05 February 2009 23:35 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
you need to initialize the parameter values by NULL or by some valid values, or you need to change code by making to accept default values.

I mean you have to initialize all parameters to use your Procedure.

[Updated on: Thu, 05 February 2009 23:37]

Report message to a moderator

Re: HR Api Problem. (Wrong Parameters) [message #384971 is a reply to message #384969] Thu, 05 February 2009 23:37 Go to previous messageGo to next message
taimurash
Messages: 7
Registered: February 2009
Location: Lahore
Junior Member

I have already worked on APIs .

I used to pass values only to Mandatory Parameters, even then the APIs worked out.

But wat's the problem this time ?? Embarassed
Re: HR Api Problem. (Wrong Parameters) [message #384973 is a reply to message #384971] Thu, 05 February 2009 23:46 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
What are Mandatory and Non Mandatory Parameters?
Re: HR Api Problem. (Wrong Parameters) [message #384974 is a reply to message #384973] Thu, 05 February 2009 23:48 Go to previous messageGo to next message
taimurash
Messages: 7
Registered: February 2009
Location: Lahore
Junior Member

Mandatory; Value is MUST Required for the parameter.

Non-Manadatory: When value is not passed, API takes a default value, or null value.
Re: HR Api Problem. (Wrong Parameters) [message #384975 is a reply to message #384974] Thu, 05 February 2009 23:52 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
As long as you don't show us the interface for the called procedure, we are unable to judge your code. You may have left out a mandatory parameter (maybe you are calling a newer version, with an extra one), maybe you use the wrong datatype, we simply can't tell just by seeing your caller-procedure.
Re: HR Api Problem. (Wrong Parameters) [message #384976 is a reply to message #384975] Thu, 05 February 2009 23:57 Go to previous messageGo to next message
trivendra
Messages: 208
Registered: October 2007
Location: Noida, India
Senior Member
Look at this, rest is expained by Frank.

SET SERVEROUTPUT ON

CREATE OR REPLACE PROCEDURE test_for_parameter (
   a         NUMBER,
   b         NUMBER DEFAULT 1,
   c   OUT   NUMBER
)
IS
BEGIN
   c := a + b;
END;

Procedure created.

DECLARE
   out_val   NUMBER;
BEGIN
   test_for_parameter (2, out_val);
   DBMS_OUTPUT.put_line ('output = ' || out_val);
END;

PLS-00306: wrong number or types of arguments in call to 'TEST_FOR_PARAMETER'
ORA-06550: line 4, column 4:
PL/SQL: Statement ignored

DECLARE
   out_val   NUMBER;
BEGIN
   test_for_parameter (2, 1, out_val);
   DBMS_OUTPUT.put_line ('Output = ' || out_val);
END;

Output = 3
PL/SQL procedure successfully completed.


Thanks
Trivendra
Re: HR Api Problem. (Wrong Parameters) [message #384977 is a reply to message #384975] Fri, 06 February 2009 00:00 Go to previous messageGo to next message
taimurash
Messages: 7
Registered: February 2009
Location: Lahore
Junior Member


I am calling this API Procedure from the SQL*Plus environment.
And the version is: Oracle9i Enterprise Edition Release 9.2.0.5.0 .

I call this API from a PL/SQL block, u can see my first message in message-board.
Re: HR Api Problem. (Wrong Parameters) [message #384983 is a reply to message #384977] Fri, 06 February 2009 00:07 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Reread my post. We KNOW your code, we don't know the code you are calling!
Previous Topic: Update Script - Increment Value
Next Topic: Insert PDF into database
Goto Forum:
  


Current Time: Thu Dec 08 03:56:08 CST 2016

Total time taken to generate the page: 0.16856 seconds