-
Hi, Ive got the simplest question on earth, hell i should be able to answer it but for some reason it wont work.
I have this line in my plsql program
insert into migrate.apc_call_details
select * from migrate.apc_call_details_07
where rownum between from_row_num and to_row_num;
where from_row_num and to_row_num are variables.
Theses variables are being populated right.
When I get to this insert my plsql program just hangs.
-
I do not know there is a bug while using rownum.
Try to use < operator with rownum.
First of all it is not a good idea to use rownum in insert statement.
-
You cannot use ">" or "BETWEEN" with rownum. However, I would have hoped it would do something a little more graceful than hanging!
If you're sure you really want to use rownum as your search criteria, you could try
insert into migrate.apc_call_details
select * from migrate.apc_call_details_07
where rownum < to_row_num
MINUS
select * from migrate.apc_call_details_07
where rownum < from_row_num;
However, be advised that since this is actually doing two queries plus a sort (due to the MINUS operation), (a) it may take a while to run, depending on the size of your table and (b) the order that rows are returned may differ between queries (hence the questioning of this technique) and you may get anomalous results.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|