Writing the results of JavaScript function to a table.
Hi - I used the javascript from the post below to calculate a field based on two other fields. It works fine, but is only displaying it - not assigning it to the page item.
How can I assign the result to a page item so that it is processed with the auto DML when the page is submitted?
Thanks,
Matt
Re: How to multiply two textbox values and write it to another textbox?
function addthis(){
var val1 = parseInt($v('PX_VALUE1'));
var val2 = parseInt($v('PX_VALUE2'));
if ($v('PX_VALUE1') != "" && $v('PX_VALUE2') != ""){
var answer = val1+val2
$s('PX_VALUE3',answer);
}
What kind of item is PX_VALUE3 - a text item or a display item or something else?
What happens if you manualy change the value of PX_VALUE3 to something? Does the DML Process save that value or not?
What is the source used and source type of your PX_VALUE3 item - is it only when... or always... / is it a database column or static assignment?
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------
Similar Messages
-
Using the result of a function, inside a subselect
Hi!
I´m wondering if it´s possible to use the result of a function inside a subselect. Let me give you an example of what I´m trying to do here:
select * from t_node where node_pk in (get_node_parents_pk(22345));
The function get_node_parents_pk stands in for the following SELECT-statment:
select node_pk from t_node_child where parent_node_pk = 12345
The statement above would return something like this: 12435,23423,23453,23452
These values represent the node_pk value for the parent nodes.
I want the get_node_parents_pk function to return a result set similar to this so that I might call it inside the IN ( ) statement.
Any clue? =)I created a collection type in the database:
CREATE OR REPLACE TYPE nodes_pk_arr IS TABLE OF INTEGER;
The function get_node_parents_pk () is made to return the collection type above. However, this does not work. I get the following error message:
SELECT *
FROM t_node
WHERE node_pk IN
(SELECT * FROM TABLE (get_node_parents_pk (22345)));
ORA-22905: cannot access rows from a non-nested table item
However, if I insert a nodes_pk_arr collection directly into the SQL-statement, like I do below, it works:
SELECT *
FROM t_node
WHERE node_pk IN
(SELECT * FROM TABLE (nodes_pk_arr(24564,23545,34523));
So, when returning the collection from the function I´m told that the collection is not a nested table, when in fact it is. What gives?
Also, is there no way to return a result set directly from the get_node_parents_pk() function, making it possible to write the statement like that shown below?
SELECT *
FROM t_node
WHERE node_pk IN (get_node_parents_pk (22345));
Your reply is much appreciated!
Kind regards
Robert -
Writing the result to seperate HTML page.
Hello,
I want a program in which I compare 3 different files and display the result. Now I want to write/save the result into a seperate HTML/pdf file. Can somebody help me in this respect.
Thanks in advance,
Nirmal Kumar BhogadiThank you so much for helping me with this. The accordion is still not sliding. The links work tho. I see that you have ?page=cascade_dining" right after your index.php, is this what is making the slider work? If so, what is ?page supposed to equal? For instanceI now have this:
<div class="AccordionPanel">
<a href="art_cards.html" onclick="window.location=this.href;return false;">
<div class="AccordionPanelTab">greeting cards</div>
</a>
But should I have this instead:
<a href="art_cards.html?page=something" onclick="window.location=this.href;return false;">
<div class="AccordionPanelTab">greeting cards</div>
I appreciate the help! -
Writing the Result set to a file!
Hello ...java gurus.. pls i want to write the contents of my result set to a file ...i have tried it but when i open the files it contains jargons any other way?
thanks.Just get the results as strings, ints or whatever you want and write them. If you want, store results in vectors, hashes... and write the file after closing connections.
-
Checking the contents of update function module log table
Dear experts,
I created several CALL FUNCTION ... IN UPDATE TASK lines and is curious about the contents of the update function module log table. How can I see its contents?
Thanks in advance.
Regards,
HarisHi Hari,
Use transaction SM13. This gives all the details
To view the details in SM13 switch on Update debugging before you call your update function module.
In debugger Settings --> Display / change Debugger settings --> Use the check box "Update Debugging" --> Press save button
So after COMMIT WORK statement, debugging will start with the update function module
During this time check the entries in SM13
Once the update is complete the entries will be removed from SM13 (Unless there is a failure)
I am not sure if there is option to view records in SM13 for which update is complete (No authorization to change settings in SM13). So i cannot check this
Regards
Rajvansh
Edited by: Rajvansh Ravi on Jul 24, 2011 3:52 PM -
Get the result of a function in Oracle
I'm using a JSP that call a stored function in Oracle, but I don't know how to get return of the function.
Thanks.You can call the function via a sql query like:
SELECT myFunc() FROM DUALThen execute that sql into a ResultSet and use the getString or getInt or whatever method fits your function return type.
John H. -
PDF/A results in non-functional links in Table of Contents -- Normal?
Hey,
Got a quick Q here - I recently converted a .docx into the PDF/A 1-b (2005) standard, but for whatever reason, save the computer that did the actual conversion, the links in my Table of Contents no longer function.
If I use Preflight to remove the PDF/A tag, the links work OK. Is there something about PDF/A that removes linking functionality that I'm not aware of? These links on my document simply move to different parts of the document, nothing too fancy.
Thanks.Hmmm. I hadn't heard of this limitation. Indeed, http://www.pdfa.org/2011/08/pdfa-–-a-look-at-the-technical-side/ says "With regard to hyperlinks, the special ‘Link’ annotation type is permitted with or without activated ‘Appearance’. " Maybe this document is being generated with a different kind of annotation.
-
Call function in background task... How to get the result?
I want to use Call function in background task parameter.
But I cannot find the result of this function. (No export parameter, no table result, no exception)
How to get the result of this function module? Correct or not?Hi Heinz,
You can check the result in SM58 transaction.
For more information pls. refer this thread :
No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
Best regards,
Prashant -
How to get value stored in javascript function and display in a JSP
i am doing a questionaire which is for user to input data in every question, After user input the data, a javascript function will be called to do some score calculation. Since each question will carry its final score after the calculation by the javascript function, so i use an array to store those scores and then display those scores in the same page.
However, i have to make a confirmation page to display both data and calculated score in another jsp, i only know how to display the data as it is a textfield that i can get the value by "request.getParameter("textfield1"); but i dun know how to get those scores as they are stored in an array in the javascript function, what way i can do??thank you for all your help!
I have chosen to set the score value to the hidden field when every time run the function
<script language="javascript">
function cal(index){
var thisForm = document.MC;
thisForm.score1.value=score[index];//set value to the hidden field
</script>
<input type="hidden" name="score1" value="">
<input type="hidden" name="score2" value="">
<input type="hidden" name="score3" value="">
The function will calculate only one score when every time being called. So that i can only assign one score to one hidden value at a time.
e.g, assign score[1] to thisForm.score1.value
assign score[2] to thisForm.score2.value
assign score[3] to thisForm.score3.value
how can i do this?? -
A swf in an iFrame calling javascript function on Parent page
I have a .swf that has to load in a iFrame and needs to call a browser cookie javascript function that lives on the parent page that loads the iFrame.
I'm using this:
ExternalInterface.call("javascriptFunction");
but of course this call is not making it to the Parent page javascript function. Is this possible to do?
Thanks!The parent page has the javascript function, and has a iFrame that loads the swf. The swf needs to call the javascript function that lives in the parent page.
Thanks! -
Passing results to another function in MDX
I'm pretty sure I know the answer to this, but it would be cool if it worked, so I figured I would put it out there and see if anyone successfully did this.<BR><BR>Is it possible to pass the result of a function NonEmptyCount() as an index for another function Item()?<BR><BR>Example<BR>CrossJoin({[Time].Levels(0).members},<BR>{[Measures].[Headcount]}).Item(NonEmptyCount(<BR>[Time].Levels(0).members, [Measures].[Headcount]<BR>))
I found the solution to my problem.
[1] Create a "After Submit" under Computations.
[2] Select 'Item Value' under Type in Item Name
[3] Select "After Submit" under Computation Point
[3] Enterer Item Name, which value needs to be passed in 'Source'
thanks -
Apex supplied javascript function
Hi,
Anyone know where can I find all the apex supplied javascript function?
Thanks
VincentHello Vincent ,
Carl’s application - http://apex.oracle.com/pls/otn/f?p=38704:1 – is the best source for now.
The JavaScript library should be officially documented as part of the upcoming 3.1 version.
Regards,
Arie. -
Calling javascript function within a uix event
JDeveloper Version: 9.0.3
Technology: UIX
Goal: To gracefully log out of a database connection, invalidate session, and close browser.
Currently I have a logout.uix page that contains a cancel and logout button. The cancel button redirects the user to the calling page. The logout button fires a logout event that in turn calls a servlet method that closes the user's database connection and invalidates the session.
Question: Upon returning to the logout.uix page, how do I call the self.close() javascript function that will force the user to close the browser?
Thanks in advance for any assistance you can provide.
OraTeamyes, I think it can be achieved. Something like this should suffice
<button text="Log Out" onClick="script that closes the window" >
<primaryClientAction>
<fireAction event="YourEvent goeshere" formSubmitted="true">
<parameters>
<parameter key="Session" value="closeSession"/>
</parameters>
</fireAction>
</primaryClientAction>
</button>in the event handler you should register the event that you would specify above.
<handlers>
<event name="YourEvent goeshere" >
<method class="com.test.ConnectionInvalidate" method="closeConnection" />
</event>
</handlers>In your class the method would be like this
public class ConnectionInvalidate {
public static EventResult closeConnection( BajaContext context,
Page page,
PageEvent event )
throws Throwable
//from the event get the parameters. (if required)
// code here for the close of connection
}When you click the button called "Log Out" the event is fired which closes the connection and javascript is also called which closes the window. Both will happen simultaneously.
hope this helps.
regards,
raj -
Is it possible to name the results table.
Hi, I'm new to java and have hit a brick wall devloping a GUI which access a SAPDB database.
They layout of the GUI is:
have a awt lists in card layout, which is populated with the results of a SQL query to table REGION.
However the number of results returned can be greater then 1Mill. To minimise the mem useage, i'm using the ResultSet absolute(), first() etc methods to collect and display small chunks of the data, for the different card in the gui. This works fine :)
However, the user is able to select an item from the list to perform a new query, which the results a presented in a dialog box, not dependent on the parent frame. Works :)
But, when the user (I) try to move anothe card in the parent frame I get this error:
SAP DBTech JDBC: Object is closed
com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech JDBC: Object is closed
at com.sap.dbtech.jdbc.ConnectionItem.assertOpen(ConnectionItem.java:54)
at com.sap.dbtech.jdbc.ResultSetSapDB.beforeFirst(ResultSetSapDB.java:177)
at blastDb.Table.getResultSetSize(Table.java:205)
at blastDb.Table.setCursor(Table.java:227)
at ViewDatabase$RegionPanel.setRegionList(ViewDatabase.java:354)
at ViewDatabase$TabPanel.showRegionList(ViewDatabase.java:180)
at ViewDatabase$TabButtonListener.actionPerformed(ViewDatabase.java:289)
at java.awt.Button.processActionEvent(Button.java:381)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
After some reading I have come up with this hypothesis:
In the parent frame there is the object (class) RegionTable, which contains the ResultSet (rsR) of the sql query generated by it.
In the dialog box there is the object (class) ProteinTable which also contains the ResultsSet (rsP) of the sql query generated by it.
So when RegionTable querys the database the rsR points to the results table in the SAPDB. All good.
However when ProteinTable querys the database, rsR closes and rsP is valid ie. points to the results table in the SAPDB.
Thus after the second query RegionTable.rsR is unable to collect the results of its query. BAD :(
From what i have read, if the results table is named for the first query, the second call which results table is named something diff then rsR will not close, as the results table is not destroyed, thus rsR can read it's results after the second qury.
This problems occours when the objects share the same connection or diff connections.
As far as I'm aware i'm using JDBC 1.2 drivers and SAPDB latest build.
I know i could hold the results in a view, but that requies more coding, being able to name the results table in the SAPDB make it alot easier.
So my question is:
1. Are my assumptions correct??
2. is there a SQL statement to name the results table for a given query?
From SAPDB:
A result table name identifies a result table (see table).
Syntax
<result_table_name> ::= <identifier>
And I've got no idea what is beging impiled beyond that it is possible to name a results table. Obtained from :
http://www.sapdb.org/htmhelp/da/ed9036dfe4b903e10000009b38f889/frameset.htm
If anyone can help, that would be fantastic!!!
Cheers
fauxnI've check the code, when the dialog box is opened a new connection is made, and i still get the same error:
SAP DBTech JDBC: Object is closed
com.sap.dbtech.jdbc.exceptions.ObjectIsClosedException: SAP DBTech
JDBC: Object is closed
at com.sap.dbtech.jdbc.ConnectionItem.assertOpen(Connection
Item.java:54)
at com.sap.dbtech.jdbc.ResultSetSapDB.beforeFirst(ResultSet
SapDB.java:177)
at blastDb.Table.getResultSetSize(Table.java:205)
at blastDb.Table.setCursor(Table.java:227)
at ViewDatabase$RegionPanel.setRegionList(ViewDatabase.java
:354)
at ViewDatabase$TabPanel.showRegionList(ViewDatabase.java:1
80)
at ViewDatabase$TabButtonListener.actionPerformed(ViewDatab
ase.java:289)
at java.awt.Button.processActionEvent(Button.java:381)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3526
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Ev
entDispatchThread.java:191)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Even
tDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
ead.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThr
ead.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.jav
a:98)
when i ask rsR to collect the results from it's query.
Dosen't make sence, unless its they way I'm implementint the GUI???
I'll look into the JDBC driver bug.
Cheers -
Hi All
Oracle : 10.2.0.4
OS : AIX
Environment : Test but restore from production database
My scenario has 4 as below and set method_opt = 'FOR ALL COLUMNS SIZE REPEAT' and degree = 2 and I deleted stats before run each step and base on same data and no work on test database.
1. gather_schema_stats : estimate_percent = 15 and options = 'GATHER AUTO'
2. gather_schema_stats : estimate_percent = AUTO_SAMPLE_SIZE and options = 'GATHER AUTO'
3. gather_table_stats : estimate_percent = 15
4. gather_table_stats : estimate_percent = AUTO_SAMPLE_SIZE
The result seem like as below on table A
scenario 1 : num_rows = 181928599 and sample_size = 569047 and gather stats time = 27 minutes
scenario 2 : num_rows = 185865585 and sample_size = 185865585 and gather stats time = 30 minutes
scenario 3 : num_rows = 185869720 and sample_size = 27880458 and gather stats time = 13 minutes
scenario 4 : num_rows = 185839451 and sample_size = 660578 and gather stats time = 17 minutes
The question is Why sampling size between gather_schema_stats and gather_table_stats on same estimate_percent and data that different? Did Oracle not gather statistics as estimate_percent parameter? and sometime explain plan had been changed. Weekly task is gather_schema_stats with estimate_percent = 15 on production.
Notes: I tried to search in forum but I cannot found that match as my question.
Thanks,
HikoAn estimate_percent lower than 100 produces an estimation, nothing more, nothing less. An estimation by definition is not always 100% accurate, it can be more, it can be less than the actual number of rows in the tables.
It can even varry between two execution of gather stats within the same extimate_percent value:
15:39:11 SQL> create table mytable as
16:48:22 2 select rownum rn
16:48:33 3 from dual
16:48:35 4 connect by rownum<1000000;
Table created.
Elapsed: 00:00:05.09
16:48:52 SQL> exec dbms_stats.gather_table_stats(user,'MYTABLE',estimate_percent=>1)
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.40
16:49:24 SQL> select num_rows from user_tables where table_name='MYTABLE';
NUM_ROWS
1002000
Elapsed: 00:00:00.09
16:49:47 SQL> exec dbms_stats.gather_table_stats(user,'MYTABLE',estimate_percent=>1)
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.04
16:50:03 SQL> select num_rows from user_tables where table_name='MYTABLE';
NUM_ROWS
1014200
Elapsed: 00:00:00.06
16:50:09 SQL> exec dbms_stats.gather_table_stats(user,'MYTABLE',estimate_percent=>100)
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.71
16:51:52 SQL> select num_rows from user_tables where table_name='MYTABLE';
NUM_ROWS
999999
Elapsed: 00:00:00.04
16:51:55 SQL> exec dbms_stats.gather_table_stats(user,'MYTABLE',estimate_percent=>100)
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.71
16:52:02 SQL> select num_rows from user_tables where table_name='MYTABLE';
NUM_ROWS
999999
Elapsed: 00:00:00.04
16:52:04 SQL> select count(*) from mytable;
COUNT(*)
999999
Elapsed: 00:00:00.14
16:52:18 SQL>Nicolas.
Maybe you are looking for
-
Just recently my phone line has become extremely crackly and my broadband has become so slow that if I use Youtube I can watch approx 3 secs of clips before it stalls and the loading symbol appears. Today it got worse when everytime I use the phone m
-
My ipod touch 5 wont charge with charger
my ipod touch 5th generation is no longer charging with my charger. i don't know whats wrong. i bought it from amazon only two weeks ago. this charger or acsessory may not work reliably with thus ipod keeps poping up on the screen!
-
Problem with showing My Computer in Bridge
Just upgraded PS CS4 to CS5. When I click on the favorites or the Folders tabs in Bridge and select My Computer, the program displays the drives and then starts adding My Documents over an over without stopping...after 1 minute I had >50 icons for M
-
How do i save my iMovies to my devices?
I've made several homemade videos with IMovie and IDVD and I want to view them on my IPad and or IPhone. How do I do that? I have DropBox on my IPad but I don't know how to get it there from my computer.
-
Java and Oracle 8.1.4
Hi All, Does anyone know if you can connect to Oracle 8.1.4 using JDBC thin connections, or even if 8.1.4 supports Java?? I can't find any on-line documentation either. Any suggestion greatly appreciated. Thanks Bruce.