Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links


Printing the values of variables in oracle procedure

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 06-02-2010
Member
 
Join Date: Jan 2010
Posts: 52
Printing the values of variables in oracle procedure

Sponsored Links
Hello !
I am writing a dynamic query using stored procedure and getting difficulties to print the values of particular variable in procedure. I am running with oracle 9i using Windows XP. I need some guidance regarding this topic. So please help me to achieve my task..

Thanks & regard.

Gerri

Reply With Quote
  #2  
Old 06-02-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,382
Procedure in oracle database

Procedure in oracle :

The oracle database is featured by a object named 'Procedure'.The procedure is a group of some SQL statement which is called by a name.After creation of the procedure,we can call it anywhere,whenever we want to use it in the PL/SQL program.

Stored procedures has some availability in the areas of development, integrity, security, performance, and memory allocation in database.
Reply With Quote
  #3  
Old 06-02-2010
opaper's Avatar
Member
 
Join Date: May 2008
Posts: 2,371
Creating procedure in database

Creating procedure :

As you now already about the procedure. I will discuss the creation of procedure here and the statement would be used to create the procedure :

This is the syntax here to create procedure :
Code:
CREATE PROCEDURE Emp_sal (employee_id NUMBER) AS
   tot_emps NUMBER;

   BEGIN
      Select salary FROM employees
      WHERE dept_id='Account_dept';
   END;
/
This is the simple syntax here to define to create a procedure which will show the salary of 'ACCOUNT' department.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #4  
Old 06-02-2010
MindSpace's Avatar
Member
 
Join Date: Feb 2008
Posts: 1,839
Printing the values of variables in oracle procedure

Printing the value of a variable :

Here, I am going to built a program which will show you the value of an existing variable and it takes the following form :

Code:
SQL> set serveroutput on format wrap

SQL> declare
  2      Msg varchar2(30) := 'Have a good a day..';
  3  begin
  4      dbms_output.enable(1000000);
  5      dbms_output.put_line ('The value of variable "Meg" is: ['||Msg||']');
  6  end;
SQL> /

The value of variable "Msg" is: [Have a good a day..]

PL/SQL procedure successfully completed.
Reply With Quote
  #5  
Old 06-02-2010
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,507
The SET SERVEROUTPUT clause

SET SERVEROUTPUT clause :

The SQL*PLUS is unable to read the output written by the PL/SQL program which is default behavior of SQL*PLUS. For this purpose,we use the SERVEROUTPUT clause with SET command .When we alter it into ON,the behavior changed automatically.
It has some options :

Quote:
SQL> set serveroutput on
SQL> set serveroutput off
SQL> set serveroutput on size unlimited
The ON option shows behavior has been changed and OFF perform vice versa where as SIZE UNLIMITED is introduced in 10g.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Printing the values of variables in oracle procedure"
Thread Thread Starter Forum Replies Last Post
Unable to open printing preferences while printing from Dell Inkjet Photo Printer 720 LaurenBc Portable Devices 2 11-11-2011 05:54 PM
Printing MPP files to Adobe and then printing on paper mbbackus Microsoft Project 2 28-09-2011 06:10 PM
W32 registry values are not getting matched by the default values Angrzej Networking & Security 5 19-05-2011 12:23 PM
Oracle Announces New Release of "Oracle Coherence" prakashseth Web News & Trends 1 21-07-2009 04:50 PM
Passing parameter of Oracle procedure in PHP Halina Software Development 3 22-04-2009 08:46 PM


All times are GMT +5.5. The time now is 04:59 PM.