Home » Developer & Programmer » Forms » HOW TO SAVE DATA GENERATED SO I CAN KEEP RE-USING THE SAME DATA TO BE ABLE TO SAVE IT TO FILE
HOW TO SAVE DATA GENERATED SO I CAN KEEP RE-USING THE SAME DATA TO BE ABLE TO SAVE IT TO FILE [message #253722] |
Tue, 24 July 2007 13:15 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
jtc103
Messages: 19 Registered: May 2007
|
Junior Member |
|
|
Hi All,
I populate my details block and my totals block dynamically using the following code (in blue):
SET_BLOCK_PROPERTY('blk_details', QUERY_DATA_SOURCE_NAME,
'(SELECT ENTNUM, ESTNUM, ROUND(' || v_col(1) || ') AS det_col1, ROUND('
|| v_col(2) || ') AS det_col2, ROUND('
|| v_col(3) || ') AS det_col3, ROUND('
|| v_col(4) || ') AS det_col4, ROUND('
|| v_col(5) || ') AS det_col5, ROUND('
|| v_col(6) || ') AS det_col6, ROUND('
|| v_col(7) || ') AS det_col7, ROUND('
|| v_col( || ') AS det_col8, ROUND('
|| v_col(9) || ') AS det_col9, ROUND('
|| v_col(10) || ') AS det_col10, ROUND('
|| v_col(11) || ') AS det_col11, ROUND('
|| v_col(12) || ') AS det_col12, ROUND('
|| v_col(13) || ') AS det_col13, ROUND('
|| v_col(14) || ') AS det_col14, ROUND('
|| v_col(15) || ') AS det_col15, ROUND('
|| v_col(16) || ') AS det_col16, ROUND('
|| v_col(17) || ') AS det_col17, ROUND('
|| v_col(18) || ') AS det_col18, ROUND('
|| v_col(19) || ') AS det_col19, ROUND('
|| v_col(20) || ') AS det_col20, ROUND('
|| v_col(21) || ') AS det_col21, ROUND('
|| v_col(22) || ') AS det_col22, ROUND('
|| v_col(23) || ') AS det_col23, ROUND('
|| v_col(24) || ') AS det_col24, ROUND('
|| v_col(25) || ') AS det_col25, ROUND('
|| v_col(26) || ') AS det_col26, ROUND('
|| v_col(27) || ') AS det_col27, ROUND('
|| v_col(28) || ') AS det_col28, ROUND('
|| v_col(29) || ') AS det_col29
FROM ' || v_current_view || '
WHERE (source = '''||:blk_selection.lst_source||''')
AND (naicsest = '''||:blk_selection.lst_naics||''')
AND (geoest = '''||:blk_selection.lst_geoest||''')
AND (substrat = '''||:blk_selection.lst_substrata||''')
AND (empnemp = '''||:blk_selection.lst_empnemp||'''))
');
/*ORDER BY ' || v_str_orderby || ' */
SET_BLOCK_PROPERTY('blk_details', ORDER_BY, v_str_orderby);
GO_BLOCK('blk_details');
EXECUTE_QUERY;
SET_BLOCK_PROPERTY('blk_totals', QUERY_DATA_SOURCE_NAME,
'(SELECT COUNT(entnum) AS tot_entnum, COUNT(estnum) AS tot_estnum,
SUM(ROUND(' || v_col(1) || ')) AS tot_col1, SUM(ROUND('
|| v_col(2) || ')) AS tot_col2, SUM(ROUND('
|| v_col(3) || ')) AS tot_col3, SUM(ROUND('
|| v_col(4) || ')) AS tot_col4, SUM(ROUND('
|| v_col(5) || ')) AS tot_col5, SUM(ROUND('
|| v_col(6) || ')) AS tot_col6, SUM(ROUND('
|| v_col(7) || ')) AS tot_col7, SUM(ROUND('
|| v_col( || ')) AS tot_col8, SUM(ROUND('
|| v_col(9) || ')) AS tot_col9, SUM(ROUND('
|| v_col(10) || ')) AS tot_col10, SUM(ROUND('
|| v_col(11) || ')) AS tot_col11, SUM(ROUND('
|| v_col(12) || ')) AS tot_col12, SUM(ROUND('
|| v_col(13) || ')) AS tot_col13, SUM(ROUND('
|| v_col(14) || ')) AS tot_col14, SUM(ROUND('
|| v_col(15) || ')) AS tot_col15, SUM(ROUND('
|| v_col(16) || ')) AS tot_col16, SUM(ROUND('
|| v_col(17) || ')) AS tot_col17, SUM(ROUND('
|| v_col(18) || ')) AS tot_col18, SUM(ROUND('
|| v_col(19) || ')) AS tot_col19, SUM(ROUND('
|| v_col(20) || ')) AS tot_col20, SUM(ROUND('
|| v_col(21) || ')) AS tot_col21, SUM(ROUND('
|| v_col(22) || ')) AS tot_col22, SUM(ROUND('
|| v_col(23) || ')) AS tot_col23, SUM(ROUND('
|| v_col(24) || ')) AS tot_col24, SUM(ROUND('
|| v_col(25) || ')) AS tot_col25, SUM(ROUND('
|| v_col(26) || ')) AS tot_col26, SUM(ROUND('
|| v_col(27) || ')) AS tot_col27, SUM(ROUND('
|| v_col(28) || ')) AS tot_col28, SUM(ROUND('
|| v_col(29) || ')) AS tot_col29
FROM ' || v_current_view || '
WHERE (source = '''||:blk_selection.lst_source||''')
AND (naicsest = '''||:blk_selection.lst_naics||''')
AND (geoest = '''||:blk_selection.lst_geoest||''')
AND (substrat = '''||:blk_selection.lst_substrata||''')
AND (empnemp = '''||:blk_selection.lst_empnemp||'''))');
GO_BLOCK('blk_totals');
EXECUTE_QUERY;
Now my question is, what would be the best way for me to keep the generated data so that I can keep accessing them within the form without having to re-run the same code? What I want to do is be able to save the generated data into an external file, and I was reading about this and I believe I can use the DDE package, but I'm not sure how to keep the data and manipulate it once it has been displayed? Any insights on this would be greatly appreciated as I'm very new at using forms developer.
|
|
|
|
|
Re: HOW TO SAVE DATA GENERATED SO I CAN KEEP RE-USING THE SAME DATA TO BE ABLE TO SAVE IT TO FILE [message #254050 is a reply to message #254005] |
Wed, 25 July 2007 11:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Ummm ... I wouldn't say so. What I meant was to create a global temporary table (GTT) (once, not every time you use the form) and fill it using your "blue" code - not as a part of the SET_BLOCK_PROPERTY, but a trigger (or procedure). Block's source would then be a GTT and all the "ordinary" commands (enter query, execute query, updates, deleted, ...) would work normally.
I'm sorry if it doesn't do what you need, but - this concept came on my mind while reading your post. Perhaps it is not applicable to the problem at all. If so, sorry for wasting your time.
|
|
|
|
|
Re: HOW TO SAVE DATA GENERATED SO I CAN KEEP RE-USING THE SAME DATA TO BE ABLE TO SAVE IT TO FILE [message #256054 is a reply to message #255392] |
Thu, 02 August 2007 20:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
The data exists in the database. You can't access it DIRECTLY from the form but you can write 'get', 'put', and 'process' routines in the package which you then call from the form. I suggest that you read the "PL/SQL User's Guide and Reference" manual and get a better understanding of packages. Remember, any PL/SQL that you can put into a Forms package can be stored in the database. Some people, me included, believe that the database is the proper place for ALL PL/SQL code. The only commands that can ONLY be stored in Forms packages are the Forms commands themselves, for example, 'up', 'down', 'get_item_property', 'set_item_property', etc.
David
|
|
|
Goto Forum:
Current Time: Sun Feb 09 19:14:51 CST 2025
|