473,382 Members | 1,407 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,382 software developers and data experts.

PL-SQL LOOP equivilant in TRANSACT-SQL

Hi,

I need to convert this anonymous pl-sql block into transact-sql to run
in Microsoft SQL Server Query Analyser.

Does anyone know what the conversion syntax would be?

I know that to declare variables to use the @.
PRINT for printing the output.

No idea for the LOOP.

Any suggestions greatly appreciated.

Many thanks.

Thiko!
____________________________________________

SET SERVEROUTPUT ON

DECLARE
recordcount NUMBER;

BEGIN
DBMS_OUTPUT.ENABLE(5000000); -- Sets buffer size.
recordcount := 0;

LOOP
INSERT INTO RecoverTest VALUES (SYSDATE - (recordcount / 4));
COMMIT; -- frees up rollback segment;
recordcount := recordcount + 1;
DBMS_OUTPUT.PUT_LINE('INSERT: ' || recordcount || ' - 45000 ');
EXIT WHEN recordcount > 45000;
END LOOP;
END;
/
Jul 20 '05 #1
1 5749
Not certain about the Oracle date arithmetic but take a look at this post
which was a very similar requirement:
http://tinyurl.com/tlpi

--
David Portas
------------
Please reply only to the newsgroup
--
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hmmm... | last post by:
I am setting up a web site for a friend. Her hosting service does not support Sendmail. It is an NT server. They recommend I use Smtp. I have been using something like formmail.pl when I have...
0
by: mucha3456 | last post by:
Please send all sorts of spam to: jacek@karczmarczyk.pl jacek@karczmarczyk.pl jacek@karczmarczyk.pl jacek@karczmarczyk.pl jacek@karczmarczyk.pl
4
by: Jules Alberts | last post by:
Hello everyone, I'm working on a tiny trigger function that needs to ensure that all values entered in a field are lowercase'd. I can't use pl/pgsql because I have a dozen different columns...
3
by: D. Stimits | last post by:
I've found a number of basic references for PL/PGSQL, but am looking for something more complete. First question, is there available a *complete* reference for PL/PGSQL? I'm using PostgreSQL...
3
by: Klaus P. Pieper | last post by:
Hi, does anybody out there have experience with the several PL's which are available for PostgreSQL? I am currently evaluating several databases (commercial as well as free & open source) for a...
22
by: Christopher Murtagh | last post by:
Greetings, I'm trying to write a pl/perl function that will return multiple rows. I've looked all over the web and only found vague references as to how to do this (some said it was possible,...
1
by: Eric D. Nielsen | last post by:
I'm in the process of implementing a "monitor this" type feature on a web-application. When something changes on the monitored item an email to the subscriber is generated. I'd like to do this...
3
by: kdsutaia | last post by:
In my program I have different .pl files.I come to a last stage of merging all files. my most of the program generate text file and that i need to give input to next process.Output of one...
21
by: TonyV | last post by:
Hi all, I'm trying to use some javascript code in Internet Explorer 6.0 that's being generated by a Perl file. I have a line in my header that looks something like this: <script...
5
by: eranshuman | last post by:
Hi, I m very new to perl I m running an API which have the Buil.pl When Im compiling using perl Build.pl I was getting error : Can't locate Module/Build.pm in @INC (@INC contains:...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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?

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.