voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
declare
	TYPE TYP_CLOSING_PRICES IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
	closing_prices_list TYP_CLOSING_PRICES;
	l_partition VARCHAR2(25):='P_SMF_SMFCP_20070302_D';
	l_statement VARCHAR2(400);
	TYPE c_partition_type_in IS REF CURSOR;
	c_partition_in c_partition_type_in;
BEGIN
	 l_statement := 'SELECT ROWNUM '||
		   'FROM smf_closing_prices '||
		   'PARTITION('||l_partition||') '||
		   'WHERE tstp_typ_stat_price not in (''01'',''06'',''07'')';
	 OPEN c_partition_in FOR l_statement;
	 LOOP
	 	 FETCH c_partition_in BULK COLLECT INTO closing_prices_list LIMIT 5000;
	 	 EXIT WHEN NOT c_partition_in%FOUND;
	 END LOOP;
 
	 CLOSE c_partition_in;
 
END;
je ne comprends vraiment pas l'erreur! et je veux garder le dynamisme pour le cursor car je compte intégrer ensuite ce code dans une procédure qui recevra en param le l_partition qui changera en fonction!

par contre si je fais
Code : Sélectionner tout - Visualiser dans une fenêtre à part
OPEN c_partition_in FOR SELECT rownum from smf_closing_prices partition(P_SMF_SMFCP_20070302_D) WHERE tstp_typ_stat_price not in ('01','06','07');
comme ceci en dur ca fonctionne! mais comme déjà dit plus haut, c'est le dynamisme qui m'intéresse!
qqun saurait-il m'aider?