Home » Developer & Programmer » Forms » select not fecthing data within a cursor
select not fecthing data within a cursor [message #493445] Tue, 08 February 2011 00:18 Go to next message
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
Littlefoot
Messages: 21818
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.
Previous Topic: Regarding Java Importer Tool
Next Topic: need for og.pll for chart input in forms 6i
Goto Forum:
  


Current Time: Tue Sep 17 16:18:56 CDT 2024