Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 8th, 2006, 08:21 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Hyderabad, , India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to display the result in sqlpus editor

Hi,
I have written a stored procedure in Oracle but dont know how to run the stored procedure.I want to see whether I am getting correct records or not. My stored procedure is:

CREATE OR REPLACE PROCEDURE test(tcode in varchar)
AS
    typeCode varchar(2);
    status varchar(1);
BEGIN
   SELECT TYPE_CODE,ASSET_STATUS INTO typeCode,status FROM cas_assets WHERE TYPE_CODE = tcode;
END;


Please reply me how to see the result from the stored procedure.

Thanks and regards
Lily

  #2 (permalink)  
Old August 10th, 2006, 05:43 AM
Authorized User
 
Join Date: Sep 2003
Location: Delhi, Delhi, India.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to prabodh_mishra
Default

CREATE OR REPLACE PROCEDURE test(tcode in varchar)
AS
    typeCode varchar(2);
    status varchar(1);
BEGIN
   SELECT TYPE_CODE,ASSET_STATUS INTO typeCode,status FROM cas_assets WHERE TYPE_CODE = tcode;

/*
For debugging purposes only
Run "Set ServerOutput On" statement, to get the result on to the iSql window, before calling the procedure.
*/

DBMS_OUTPUT.PUT_LINE (typeCode);
DBMS_OUTPUT.PUT_LINE (status);

END;


  #3 (permalink)  
Old November 14th, 2006, 02:44 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

run procedure as follows

exec test('your argument');

  #4 (permalink)  
Old November 22nd, 2006, 03:26 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forgive me if I state the obvious, but before executing your stored procedure you'll first have to "store" it. Let's say you've got the TEST code in your PC's C:\TEMP directory, as TEST.SQL Via SQL*Plus: @C:\TEMP\TEST.SQL Then, again via SQL*Plus: / You'll get a PROCEDURE CREATED response. Then you'll be able to execute the procedure just as vijaykpit has mentioned.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decode function to display result in same row yogeshyl SQL Language 0 July 2nd, 2008 12:40 AM
Display Search Engine result in table using JSP sbc789 JSP Basics 3 December 3rd, 2007 11:35 PM
GridView and SQL More than one result = one result DarkForce ASP.NET 2.0 Basics 0 July 20th, 2007 04:29 AM
how to display the result elania PHP Databases 3 February 21st, 2005 03:07 PM
display the result of query in textbox. Abhinav_jain_mca ADO.NET 4 August 3rd, 2004 03:34 AM



All times are GMT -4. The time now is 02:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.