473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to execute this PL/SQL procedure?

20
Hi all,
I need your help here,

i have pl/sql procedure , this query returns 1 as out put, but to see that result?, when i execute this procedure,like this,

execute pro_name('emailid',password);
it shows only "anonymous block completed",
how to see its output that retrieves, Is there any possibility?
my PLSQL query is,
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE
  2.   PROCEDURE PRO_GET_SYSTEM_IsValidUser(
  3.                                        p_loginID in varchar2,
  4.                                        p_password in varchar2,
  5.                                        p_exists in out number
  6.                                       )
  7.     IS
  8.     BEGIN
  9.         SELECT  COUNT(*)
  10.           INTO  p_exists
  11.           FROM  employees
  12.           WHERE emailid = p_loginid
  13.             AND password = p_password
  14.             AND enabled = 'TRUE'
  15.             AND ROWNUM=1;
  16. END;
Thanks in advance.
Jun 30 '12 #1
17 6945
bharthi
20
Hi all,
I need your help here,

i have pl/sql procedure , this query returns 1 as out put, but how to see that result?. when i execute this procedure,like this,

execute pro_name('emailid',password);
it shows
ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in call to 'PRO_GET_SYSTEM_ISVALIDUSER'
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored.

how to see its output that retrieves, Is there any possibility?
my PLSQL query is,
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE
  2. PROCEDURE PRO_GET_SYSTEM_IsValidUser(
  3. p_loginID in varchar2,
  4. p_password in varchar2,
  5. p_exists in out number
  6. )
  7. IS
  8. BEGIN
  9. SELECT COUNT(*)
  10. INTO p_exists
  11. FROM employees
  12. WHERE emailid = p_loginid
  13. AND password = p_password
  14. AND enabled = 'TRUE'
  15. AND ROWNUM=1;
  16. END;
Thanks in advance.
Jul 2 '12 #2
EXEC PRO_GET_SYSTEM_IsValidUser('emailid','password')
because password also charcter type so u should declare that within single codes...
just try this bharthi..............
Jul 2 '12 #3
bharthi
20
Hi raghurocks, I did like that only, but i posted wrongly in my post, eventhough i executing with two parameters, how it will work, im sure that this query needs three parameter, thats y i don know how to pass third one, please provide solution if you know.
Thanks for your reply.
Jul 2 '12 #4
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

Your stored procedure requires 3 input parameters. The last of which is also an output parameter. I see no reason for it to be an input parameter as well.
Jul 2 '12 #5
bharthi
20
HI Rabbit,
I executed that procedure like this,
execute pro_name ('emailid','password'), it returns an error, so i need third one , how to declare third one when i executing this procedure? , i storing 1 in p_exist so it should be in out parameter. please help if you know this.
Thanks for reply.
Jul 3 '12 #6
Rabbit
12,516 Expert Mod 8TB
You may be storing 1 to output, but you are not inputting anything. There is no need to declare it as an input.
Jul 3 '12 #7
bharthi
20
oh I see! ...Then Ok , so i need to declare that "P_exist" as OUT . am i right sir?. if i executed after i declared as "OUT" for that third argument, i got error,
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PRO_GET_SYSTEM_ISVALIDUSER'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored.

please reply , what i have to do ,how to execute this procedure, or else , in which way i can rewrite this procedure that can return value 1.
Thanking You.
Jul 3 '12 #8
Try declaring the p_exists as out rather than "in out"..bcoz An OUT parameter is initially NULL. The program assigns the parameter a value and that value is returned to the calling program.
Jul 3 '12 #9
Try executing like this:

execute pro_name('emailid','password',null);
Jul 3 '12 #10
bharthi
20
Hi, no its not executing, i getting error only.
Jul 3 '12 #11
can u post that error
Jul 3 '12 #12
bharthi
20
Error starting at line 21 in command:
execute PRO_GET_SYSTEM_IsValidUser ('velu@gmail.com','demo',null)
Error report:
ORA-06550: line 1, column 60:
PLS-00363: expression ' NULL' cannot be used as an assignment target
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
Jul 3 '12 #13
have you declared the p_Exists as out number
Jul 3 '12 #14
bharthi
20
yes i declared as out number ,but its not working , what to do i don know, actually i have one login page ,for that they coded in .CS page inthat page they used four stored procedure in T-SQL, for that i have to convert into pl/SQL, but searched a lot but no founded a solution.
Jul 3 '12 #15
rski
700 Expert 512MB
use something like that (you have to enable output)
Expand|Select|Wrap|Line Numbers
  1. declare 
  2. v_p number
  3. begin
  4. pro_name('emailid',password,v_p);
  5. dbms_output.put_line(v_p);
  6. end;
  7.  
Jul 3 '12 #16
Rabbit
12,516 Expert Mod 8TB
Please post your new stored procedure code and the command you use to call it.
Jul 3 '12 #17
bharthi
20
Hi all , Thanks for your reply to my doubt.
but i got the answer for my procedure .Answer is ,
variable io_pro;
execute pro_name ('emailid','password',:io_pro);
print io_pro;

Thanks to every one again.
Jul 4 '12 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ye Liu | last post by:
Hi, Oracle Folks. May I know whether in ODBC programming, I can use bulk execution of a stored procedure just like bulk insert. Thanks, --ye
1
by: T.S.Negi | last post by:
Dear Techies, I making one stored procedure, which does some operation based on an interface hash (#) table ---- name #mydata. This stored has two section of code (seperated by parameter value...
5
by: Gustavo Randich | last post by:
Hello, I'm writing an automatic SQL parser and translator from Informix to DB2. Now I'm faced with one of the most difficult things to translate, the "foreach execute procedure" functionality...
3
by: marcmc | last post by:
I have code below that will only execute half of a procedure!!! I can execute it fine in SQLServer. The parametars are setup the same as are the returning params for other sProcs that run fine. I...
1
by: chloe.crowder | last post by:
Hi We're trying to use call a stored procedure to update information in a remote Ingres database. We've linked the server, and can read information using SELECT * FROM OPENQUERY (..........),...
4
by: benscribe | last post by:
I've looked high and low for this information and haven't found it anywhere. Is there a way to pass arguments to a stored procedure being used by a selectcommand. I've seen mention of...
5
by: Chris Cowles | last post by:
I use an application that uses Oracle 8.1.7. All functions of the application are completed with calls to stored procedures. A data entry error occurred that caused thousands of records to be...
1
by: NareshN | last post by:
Hi, This is my table.When u run the stored procedure we will get first row as AgentsScheduled as per schdule as first row and Forecasted HC as per hiring plan row in 2nd row but i want Forecasted...
4
by: shubham rastogi | last post by:
hi friends,, Is there any mechanism or technique available using which I could set the time to execute procedure..?? If yes then how..?? If the above task could be achieved then my question is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.