473,799 Members | 2,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does ECHO work in SQLPLUS? If not what works?

4 New Member
This is a SQLPLUS question. How do I display what is being executed. In other words, in the listing below what command do I need to use to see if commit will be executed. As an example, can I say:

ECHO "commit begins";

is this the right syntax for SQLPLUS?

Expand|Select|Wrap|Line Numbers
  1. declare
  2. recs number     := 0;
  3. looper number := 0;
  4. i number;
  5. begin
  6. select count(*) into recs from TTRACK where call_dt <  '1940/01/01';
  7. if recs > 0 and recs > 4 then looper := recs/5;
  8. elsif recs between 0 and 4 then looper := 1;
  9. elsif recs = 0 then
  10. return;
  11. end if;
  12.  
  13. for i in 1..looper loop
  14. DELETE FROM TTRACK WHERE rownum < 5 AND CALL_DT < '1940/01/01';
  15.  
  16. commit;
  17.  
  18. end loop;
  19.  
  20. end;
/
Sep 20 '07 #1
1 18442
amitpatel66
2,367 Recognized Expert Top Contributor
This is a SQLPLUS question. How do I display what is being executed. In other words, in the listing below what command do I need to use to see if commit will be executed. As an example, can I say:

ECHO "commit begins";

is this the right syntax for SQLPLUS?

*************** *************** *************
declare
recs number := 0;
looper number := 0;
i number;
begin
select count(*) into recs from TTRACK where call_dt < '1940/01/01';
if recs > 0 and recs > 4 then looper := recs/5;
elsif recs between 0 and 4 then looper := 1;
elsif recs = 0 then
return;
end if;

for i in 1..looper loop
DELETE FROM TTRACK WHERE rownum < 5 AND CALL_DT < '1940/01/01';

commit;

end loop;

end;
/
*************** *************** *********end*** *************** ******
Make use of DBMS_OUTPUT.PUT _LINE in order to display any user defined message on the screen.

Before useing DBMS_OUTPUT package, you need to execute the below command:
Expand|Select|Wrap|Line Numbers
  1. SQL> SET SERVEROUTPUT ON
  2.  
Then you include the line DBMS_OUTPUT.PUT _LINE('Commit Begins') in your anonymous block
Sep 21 '07 #2

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

Similar topics

8
2208
by: tooheys | last post by:
This may be to simple for the level of material I've already seen here, but nothing ventured. I have two web page linked from http://www.rhodeisland-aa.org/ricsmeetings/index.htm They are supposed to do the same thing. These pages are Test10 and Test20 namely print out "Hello World" Test10 works (after a fashion)
2
2352
by: Harry Haller | last post by:
Why does the following work: // (1) Set new cookies setcookie ("font_type", $type_sel, time()+3600); setcookie ("font_size", $size_sel, time()+3600); // (1) Get most recent cookie $font_type = $_COOKIE; $font_size = $_COOKIE; if (isset($font_type) && isset($font_size)) echo "Found Cookies<br>\n";
3
4288
by: Alexander Gräf | last post by:
Hello, I'm stuck with a simple problem, for which I don't have a solution. I basically have an XML file containing fragments of plain text and html, in several languages: <?xml version="1.0" encoding="UTF-8" ?> <ms:Locales xmlns:ms="urn:myspace" xmlns="http://www.w3.org/1999/xhtml"> <ms:Locale id="EN" locale="en-US" xml:lang="EN"> <ms:Text name="LegalInformation">Legal Information</ms:Text>
11
3436
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and no buttons react to clicking. The website's helpdesk says it should work with Firefox, and could not offer any more advices. The JavaScript Console shows that there are numerous errors occuring. It looks like the web browser does not recognise...
3
3982
by: wwwmike | last post by:
For some reasons my HTTP Redirect for 404 errors does not work for certain files like .gif .jpg on IIS Version: 5.1, but it works perfectly with the VisualStudio2005 internal webserver ****Web.Config**** ....... <customErrors mode="On" defaultRedirect="http://www.cnn.com"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.aspx" />
5
77642
by: antonyliu2002 | last post by:
Hi, It looks like so many people are having problems with the javascript submit in firefox. I searched around, but haven't found a solution yet. Mostly, people were saying, try this or try that or maybe blah blah or why do you wanna do that blah blah. I haven't seen a solution to this problem. OK, I am trying to share session objects between classic asp applications and asp.net applications. If you insist in asking why I
14
2083
by: seralasu | last post by:
Hi, I have refresh problem.When user does refresh or clicks F5 then form variables again posting. It crates same a lot of inserts. I don't know How to solve it.
2
2892
by: DC | last post by:
Hi, why does this not work: <asp:ImageButton id="myButt" runat="server" OnCommand="myButt_kick" ImageUrl="<% =GetMyButtUrl() %>" </asp:ImageButton>
5
3371
by: Pat | last post by:
Hi ASP Gurus, Please help me. Autocomplete works fine when the control does not have the focus when the page load. But when I put the focus on page load, then autocomplete does not work. I even tried javascript pageload code, but with no success. <script language ="javascript" type ="text/javascript" > function focusIt() { //alert('test'); var mytext =
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.