Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, How does one execute this SQ

Status
Not open for further replies.

shyamal

Programmer
Aug 14, 2000
79
US
Hi,

How does one execute this SQL stored procedure in Sybase 12.5?

declare
@i integer
set @i = 1
while @i <= 5000
begin
insert into T00 (RECID) values (@i)
insert into T50 (RECID) values (@i)
set @i = @i + 1
end

Thanks in advance.
 
Hi

Sorry but I am not sure I understand your question.

Are you getting an error or, do you just need to know how to execute commands in Sybase?

If you are getting an error, please post the error and I will be glad to help out.

Thanks.




-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR][/COLOR] and
Code:
[/ignore] tags.

Ex:
Code:
SELECT 1 from sysobjects

 
I think you have a mistake in your code

set @i = 1
should be

select @i = 1

Anyway this is the correct code as far as I can see

declare
@i integer
select @i = 1
while @i <= 5000
begin
insert into T00 (RECID) values (@i)
insert into T50 (RECID) values (@i)
select @i = @i + 1
end


Try it & good luck
 
Thanks SybaseGuru! This worked. The set is used in SQL vs. the select in Sybase.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top