The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

invoke <SQL expert> by richllleeds2003-03-18 03:55:48
  I only know Oracle by Spisefisken 2003-03-18 04:38:19
For that I would do something like this
declare
cursor test is select * from test_table order by id;
test_no integer := 0;
v_id test_table.id%type;
v_calc1 test_table.calc1%type;
v_calc2 test_table.calc2%type;
begin
select count(*) into test_no from test_table;
test_no := test_no * 0.75; --percentage
open test;
for i in 1..test_no loop
fetch test into v_id,v_calc1,v_calc2;
exit when test%notfound;
insert into test_table2 values (v_id,v_calc1,v_calc2);
end loop;
close test;
end;

Of course you have to put in your column and table names instead of the test, id and calc things.

I don't know if it helped. Good luck :-)
/T
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)