select not fecthing data within a cursor [message #493445] |
Tue, 08 February 2011 00:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/07e07db114fd3a8b21f47d96deb1cb76?s=64&d=mm&r=g) |
sumanh
Messages: 2 Registered: February 2011 Location: Mumbai
|
Junior Member |
|
|
SELECT
contgrp_num,
cpgrp_desc,
strategy_id,
perftyp_cd,
stiertyp_id_calcbase,
stiertyp_id,
cpgrp_flg_aggr,
pgrptyp_cd
INTO
cp_contgrp_num,
cp_cpgrp_desc,
cp_strategy_id,
cp_perftyp_cd,
cp_stiertyp_id_calcbase,
cp_stiertyp_id,
cp_cpgrp_flg_aggr,
cp_pgrptyp_cd
FROM CPGRP
WHERE util_rec.cpgrp_num = cpgrp.cpgrp_num [ util_rec is the cursor]
The above query is not returning any value. But, when I put this within a begin-end block, its fetching data.
Please advice as to why its not returning any data without the begin-end block.
The entire code has an outer begin-end block within which the cursor is also defined.
|
|
|
Re: select not fecthing data within a cursor [message #493448 is a reply to message #493445] |
Tue, 08 February 2011 00:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
SELECT ... INTO means PL/SQL. It means that it needs to be enclosed into BEGIN-END.
What does "it is not returning any value" mean? If you run it as SQL statement, it won't work at all (so no wonder it doesn't return anything). You also mentioned a "cursor". Perhaps it would be easier to understand the question if you posted the whole "picture" (i.e. some more information but a single statement). If it is confidential, create a simple test case which would illustrate what you are saying.
|
|
|