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:Why temporary tables?
Next Topic:Performance Issue
Goto Forum:
  



Current Time: Tue Oct 7 17:37:06 EDT 2008

Total time taken to generate the page: 0.01908 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge