Home » Performance » MySQL » Dynamic Create table using cursor ??
Dynamic Create table using cursor ?? [message #3234] Tue, 01 July 2008 05:01
focusora  is currently offline focusora
Messages: 5
Registered: June 2008
Junior Member
Hi all,
Is it possible to create Dynamic temporary table in pl/sql .
using cursor to stores values.
my code works for static table ., very well
but my need is in Dynamic table to store the values and fetch
that values in cursor and insert into another tables.
is it possible ??

=========
DELIMITER $$

CREATE PROCEDURE "testproc"()
BEGIN

declare abc varchar(50);

declare SSS cursor for
select id from
[ DYNAMIC_TEMP_TABLE ] where number = 11;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET l_last_row_fetched=1;
SET l_last_row_fetched=0;
open SSS;
SSS_loop: LOOP

fetch SSS into abc;

IF l_last_row_fetched=1 THEN
LEAVE f_loop;
END IF;

insert into newtable (id) values ([values stored in abc]);
===============
any ideas or assist to create dynamic table in pl/sql
OS : windows 2000
DB : MySQL 5.0
Previous Topic:single database vs multiple databases
Next Topic:Performance Issue
Goto Forum:
  


Current Time: Fri Jul 10 02:00:47 EDT 2009

Total time taken to generate the page: 0.01364 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.