Home » Developer & Programmer » Forms » Cursor retrievment problem (forms 10g)
Cursor retrievment problem [message #572321] Mon, 10 December 2012 10:40 Go to next message
emadnabil
Messages: 177
Registered: August 2007
Senior Member
Dear all
I have a problem when openning a cursor and try to retrieve data from that cursor
it just retrieves the column of the cursor opened

declare 
     cursor  inst_details 
     	is 	SELECT T.NAME,P.POLICY_NO,P.gi_policy_id
	    FROM  GI_POLICY_TYPE T,gi_policies p 
	    where  T.POLICY_ID = P.POLICY_TYPE_ID
	    AND has_declaration ='N';
 begin 
   FOR  emp_record  IN inst_details 
     	LOOP 
      		MESSAGE (emp_record.NAME||'   '||emp_record.gi_policy_id||'  '||emp_record.POLICY_NO );
     	  	MESSAGE (emp_record.NAME||'   '||emp_record.gi_policy_id||'  '||emp_record.POLICY_NO );
  		
      	end loop;
end;



when running the form it just shows the value of the emp_record.NAME

when i change the column in cursor e.g SELECT P.POLICY_NO,P.gi_policy_id,.NAME
instead of SELECT T.NAME,P.POLICY_NO,P.gi_policy_id

it will show only P.POLICY_NO

i mean only the first column will be shown

so please help urgently
Re: Cursor retrievment problem [message #572326 is a reply to message #572321] Mon, 10 December 2012 11:59 Go to previous messageGo to next message
emadnabil
Messages: 177
Registered: August 2007
Senior Member
any help
i searched alot for it
Re: Cursor retrievment problem [message #572329 is a reply to message #572326] Mon, 10 December 2012 17:19 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
The order of the columns in the cursor can't affect what is displayed. The order of the columns in the call to message will affect what is displayed, but all three columns should be displayed regardless.
If you run that code in sqlplus, replacing message with dbms_output.put_line, what do you get?
Re: Cursor retrievment problem [message #572352 is a reply to message #572321] Tue, 11 December 2012 02:40 Go to previous messageGo to next message
emadnabil
Messages: 177
Registered: August 2007
Senior Member
when doing this in sqlplus that problem doesnot occur
it just happen when using this cursor on the forms developer
Re: Cursor retrievment problem [message #572364 is a reply to message #572321] Tue, 11 December 2012 03:37 Go to previous message
emadnabil
Messages: 177
Registered: August 2007
Senior Member
Dear all
i got the solution

the datatype of P.POLICY_NO is Nvarchar2
when changing it to varchar2 it works fine

so I am surprised
if there any problems when using the datatype Nvarchar2

[Updated on: Tue, 11 December 2012 03:37]

Report message to a moderator

Previous Topic: document save and retreival in forms
Next Topic: please i need scan image from oracle forms 10g by using scanner
Goto Forum:
  


Current Time: Thu Apr 25 06:01:43 CDT 2024