|
| ||||||||||
| Tags: dbms_output package, oracle procedure, set command, variable |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Printing the values of variables in oracle procedure
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 |
|
#2
| ||||
| ||||
| 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.
__________________ Grand Theft Auto 4 PC Video Game |
|
#3
| ||||
| ||||
| 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;
/
__________________ The FIFA Manager 2009 PC Game |
|
#4
| ||||
| ||||
| 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. |
|
#5
| ||||
| ||||
| 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:
|
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |