Discuss Executing a Function in Oracle in the Oracle Development forum on Dev Shed. Executing a Function in Oracle Oracle Development forum discussing administration, Oracle queries, and other Oracle-related topics. Oracle is known as one of the most robust multi-platform relational databases available.
Posts: 11
Time spent in forums: 6 h 30 m 36 sec
Reputation Power: 0
Executing a Function in Oracle
Hi,
I have created a Package Body and Package Spec for a function to select a username and a password from a table and return the username.
The code i have created is this:-
CREATE OR REPLACE PACKAGE BODY USER_LOGIN
AS
FUNCTION user_select (USERNAME_IN VARCHAR2,
PASSWORD_IN VARCHAR2)
RETURN VARCHAR2 IS
USERNAME_OUT VARCHAR2(12);
BEGIN
SELECT USERNAME
INTO USERNAME_OUT
FROM USERS
WHERE USERNAME = USERNAME_IN
AND PASSWORD = PASSWORD_IN;
RETURN USERNAME_OUT;
END user_select;
END USER_LOGIN;
/
The package body and spec compiles successfully but i am having trouble when i execute this function. I am trying to do this :-
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'USER_SELECT'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored