Home » Developer & Programmer » Forms » show multiple value in a text box
icon14.gif  show multiple value in a text box [message #335128] Mon, 21 July 2008 02:25 Go to next message
ziauldba
Messages: 55
Registered: January 2007
Location: Bangladesh
Member

Dear friends,
if needs to show multiple value in a text box how can i do..

example:--------

select count(emp_code)||','
into :EMP_LIST
from hm_employee_mst a,HM_EMPLOYEE_LEAVE_APPL b
where a.emp_id=b.employee_id
b.attndance_date=:HM_EMPLOYEE_LEAVE_APPL.leave_date;

--it return more then one record, if i needs to show these value in :EMP_LIST

then what can i do..


pls hesp me... Sad

Re: show multiple value in a text box [message #335139 is a reply to message #335128] Mon, 21 July 2008 03:34 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Use EXECUTE IMMEDICATE statement.
Re: show multiple value in a text box [message #335155 is a reply to message #335139] Mon, 21 July 2008 04:38 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
azamkhan wrote on Mon, 21 July 2008 10:34
Use EXECUTE IMMEDICATE statement.

Would you be so kind as to show how dynamic sql would overcome the retrieval of multiple rows?!
Re: show multiple value in a text box [message #335198 is a reply to message #335155] Mon, 21 July 2008 07:08 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Frank wrote on Mon, 21 July 2008 11:38
azamkhan wrote on Mon, 21 July 2008 10:34
Use EXECUTE IMMEDICATE statement.

Would you be so kind as to show how dynamic sql would overcome the retrieval of multiple rows?!

And especially with the "IMMEDICATE" bit Smile
Re: show multiple value in a text box [message #335304 is a reply to message #335198] Mon, 21 July 2008 15:19 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Oh well ... the example in the first message is wrong (in my opinion); how would
SELECT COUNT(*)
FROM some_table
WHERE condition
-- without the GROUP BY clause
return more than a single value? Besides, it is syntactically wrong (the last line lacks in the AND keyword).

Therefore, perhaps you'd want to try again, present a working example, properly formatted, perhaps even attach CREATE TABLE and INSERT INTO sample data so that we could reproduce the case.

Just a thought: if your query really returns more than a single record, perhaps you could use it as a CURSOR. Then, using a cursor loop, you'd concatenate each result with previous one(s) and, finally, display the result in the text box (probably with Multi line property set to "Yes" (read more about multi line text items in Forms Online Help System)).

As of EXECUTE IMMEDIATE, well, it just doesn't work in Oracle Forms so - that's out of question:
Forms
Error 591 at line 1, column 1
this feature is not supported in client-side programs

You could, though, move such a code into a database stored procedure and invoke it from a form trigger, but ... I didn't quite understand get how would EXECUTE IMMEDIATE help in this case? ./fa/1600/0/
Previous Topic: Retrive PDF in Acrobat Reader
Next Topic: Timer Problem
Goto Forum:
  


Current Time: Thu Dec 08 22:28:26 CST 2016

Total time taken to generate the page: 0.10619 seconds