I have been working on a large project constantly for two weeks now and have not made much progress..
ISSUE # 1
i have a database table called 'person' with 3 columns 'user' (varchar2) 'password' (varchar2) & 'ssn' (number)
i want to create a function that use's a cursor to retrieve the value of ssn..
(i have also been trying this with a procedure)
...my function is as follows....
<the goal is to get the ssn number from person table and return it into an ADO active command parameter but thats not my big problem at the moment>
CREATE OR REPLACE FUNCTION login(user varchar2, pass varchar2) RETURN NUMBER
IS
social NUMBER;
CURSOR findit
IS
SELECT ssn
FROM person
WHERE userid=user
AND password=pass;
BEGIN
OPEN findit;
FETCH findit INTO social;
IF findit%notfound THEN
social:=0;
END IF;
CLOSE findit;
RETURN social;
END;
/
ISSUE # 2
Also need to check if 2 values match values found in a row, how would i use a bool to do this?
******in issue # 1 the column is actually 'userid' not 'user'****
ISSUE # 1
i have a database table called 'person' with 3 columns 'user' (varchar2) 'password' (varchar2) & 'ssn' (number)
i want to create a function that use's a cursor to retrieve the value of ssn..
(i have also been trying this with a procedure)
...my function is as follows....
<the goal is to get the ssn number from person table and return it into an ADO active command parameter but thats not my big problem at the moment>
CREATE OR REPLACE FUNCTION login(user varchar2, pass varchar2) RETURN NUMBER
IS
social NUMBER;
CURSOR findit
IS
SELECT ssn
FROM person
WHERE userid=user
AND password=pass;
BEGIN
OPEN findit;
FETCH findit INTO social;
IF findit%notfound THEN
social:=0;
END IF;
CLOSE findit;
RETURN social;
END;
/
ISSUE # 2
Also need to check if 2 values match values found in a row, how would i use a bool to do this?
******in issue # 1 the column is actually 'userid' not 'user'****