Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2005, 02:33 PM
shaharpan shaharpan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 49 shaharpan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 55 m 24 sec
Reputation Power: 0
Red face Newbie Pl/SQL Function

Hey all,

I dont know about pl/sql function,

i wrote a small code

please let me know if it is correct

CREATE FUNCTION LOGIN11_PEOPLE (USERN IN VARCHAR2, PASSW IN VARCHAR2) RETURN BOOLEAN IS
M_COUNT:=0;
BEGIN
SELECT COUNT(*) INTO M_COUNT FROM LOGIN WHERE USER_NAME=USERN AND PASS_WORD=PASSW;
IF M_COUNT=1 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;


this function takes two parameter username and password
and outputs a boolean true or false

how do i execute this fucntion in oracle

how to make sure that this code is running,

Plz

thanz

shah

Reply With Quote
  #2  
Old March 30th, 2005, 07:30 PM
merl merl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 51 merl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 34 sec
Reputation Power: 7
I think you had a syntax error in your function.

CREATE FUNCTION LOGIN11_PEOPLE (USERN IN VARCHAR2, PASSW IN VARCHAR2) RETURN INTEGER IS
M_COUNT INTEGER;
BEGIN
SELECT COUNT(*) INTO M_COUNT FROM LOGIN WHERE USER_NAME=USERN AND PASS_WORD=PASSW;
RETURN M_COUNT;
END;
/
show errors;

select LOGIN11_PEOPLE('USERM', null) from dual;

drop FUNCTION LOGIN11_PEOPLE ;

Reply With Quote
  #3  
Old April 4th, 2005, 08:40 AM
paulh1983 paulh1983 is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2004
Posts: 1,255 paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 15 h 14 m
Reputation Power: 17
instead of writing

create login

do create or replace function login.....

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Newbie Pl/SQL Function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT