XML - ORA-19025: EXTRACTVALUE returns the value of a single node
HelloI'm new to XML DB. Can someone help me with the below XML
I use the following XML... (I pasted a part only of it coz I need data only up to this article)
XML
--------------------
<? XML version = "1.0" encoding = "UTF-8"? > < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-."
example"container ="http://www.w3.org/2001/XMLSchema"> < SOAP - ENV:Body >
< ns:PicklistWS_GetPicklistValues_Output xmlns:ns = "urn: crmondemand/ws/list dropdown /" >
< ListOfParentPicklistValue xmlns = "urn: / xml/crmondemand/list of choices" >
< ParentPicklistValue >
< language > ENU < / language >
< ParentFieldName > plProduct_Team < / ParentFieldName >
< ParentDisplayValue > Marketing On Demand < / ParentDisplayValue >
< ParentCode > Marketing On Demand < / ParentCode >
< Disabled > N < / disabled >
< ListOfPicklistValue >
< PicklistValue >
Escalation of OCP/SME < code > < code >
Escalation of OCP/SME < DisplayValue > < / DisplayValue >
< Disabled > N < / disabled >
< / PicklistValue >
< PicklistValue >
Ask fusion < code > < code >
Merge request < DisplayValue > < / DisplayValue >
< Disabled > N < / disabled >
< / PicklistValue >
Code
---------
SELECT distinct
EXTRACTVALUE (value (SR), ' / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code ','xmlns = "urn: / crmondemand/xml/list of choices"') AS display.
Return EXTRACTVALUE (value (SR),'/ ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue ',' xmlns = "urn: / crmondemand/XML/picklist"'),.
EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentDisplayValue','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_display,
EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentCode','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_return
TABLE (XMLSEQUENCE ((EXCERPT)
WEB_SERVICE (' <? xml version = "1.0" encoding = "UTF - 8" standalone = "no"? > < envelope soap: xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/")
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >
< soap: Body >
< PicklistWS_GetPicklistValues_Input xmlns = "urn: crmondemand/ws/list dropdown /" >
Type < FieldName > < / FieldName >
Service request < RecordType > < / RecordType >
< / PicklistWS_GetPicklistValues_Input >
< / soap: Body >
"< / envelope soap: >.
(' document / urn: crmondemand/ws/list dropdown /: ' GetPicklistValues, Id_de_la_session).
"/: soap envelope / soap: Body / * / * / * ',' xmlns:soap ="(http://schemas.xmlsoap.org/soap/envelope/'))) SR "
ERROR
---------
ORA-19025: EXTRACTVALUE returns the value of a single node
UNDERSTANDING
---------------------------
As my Xpath only points until the node - ParentPicklistValue and not the child nodes under it. That's why, when I try to interview the child nodes - / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I get the error mentioned above.
REQUIREMENT
-----------------------
Can someone help me to receive the values of the mother and child values based on xml and query above.
Hello
It's a classic ;)
You need a second XMLSequence who shreds the collection of PicklistValue in relational lines:
select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
, extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
, extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
, extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
from table(
xmlsequence(
extract( WEB_SERVICE( ... )
, '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
, 'xmlns="urn:/crmondemand/xml/picklist"
xmlns:ns="urn:crmondemand/ws/picklist/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
)
) sr1
, table(
xmlsequence(
extract( value(sr1)
, '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
, 'xmlns="urn:/crmondemand/xml/picklist"' )
)
) sr2
;
What is your version of the database BTW?
10.2 and upward, you can use the XMLTable.
Tags: Database
Similar Questions
-
DICOM metadata - extractvalue returns the value of a single node
Hello
I have difficulties in getting the value of the objects with repeated elements. Specifically, I need to get the value of spacing of pixels in the following excerpt from xml.
Normally, I use the following query to get the value of spacing of pixels:<DICOM_OBJECT> .. <DECIMAL_STRING tag="00181063" definer="DICOM" name="Frame Time" offset="900" length="2">0.0</DECIMAL_STRING> <CODE_STRING tag="0018106A" definer="DICOM" name="Synchronization Trigger" offset="910" length="10">NO TRIGGER</CODE_STRING> .. <DECIMAL_STRING tag="00280030" definer="DICOM" name="Pixel Spacing" offset="1660" length="22">0.003562</DECIMAL_STRING> <DECIMAL_STRING tag="00280030" definer="DICOM" name="Pixel Spacing" offset="1660" length="22">0.003562</DECIMAL_STRING> <UNSIGNED_SHORT tag="00280100" definer="DICOM" name="Bits Allocated" offset="1690" length="2">8</UNSIGNED_SHORT> <UNSIGNED_SHORT tag="00280101" definer="DICOM" name="Bits Stored" offset="1700" length="2">8</UNSIGNED_SHORT> .. </DICOM_OBJECT>
It works, but not when there are two elements. Then I get the error: "ORA-19025: EXTRACTVALUE returns the value of a single node.select EXTRACTVALUE(t.dicom.metadata ,'/DICOM_OBJECT/*[@name="Pixel Spacing"]' ,'xmlns=http://xmlns.oracle.com/ord/dicom/metadata_1_0') scale_factor from my_dicom_object t
All I really need is to get the value of the first node with the name of "spacing of pixels. Despite the many examples available to do with traditional xml paths, I was unable to find an example that makes using XPATH search strings rather than direct tag structure.
Can someone give an example?
Thank you!
Published by: rcdev on August 10, 2009 15:20All I really need is to get the value of the first node with the name of "spacing of pixels.
This? :
select EXTRACTVALUE(t.dicom.metadata ,'/DICOM_OBJECT/*[@name="Pixel Spacing"][1]' ,'xmlns=http://xmlns.oracle.com/ord/dicom/metadata_1_0') scale_factor from my_dicom_object t
-
Do stuff to PL/SQl that returns the value and redirect to modal page by setting this value
Hello
a button click Page1 I would perform a PL/SQL procedure that returns a value in P1_ITEMVAL and then redirect to a page 2 (modal page) and the value of an item on this page with the value previously returned. To do the same thing with a normal page is quite easy:
Button action is present, then process of PL/SQL that returns the value in the P1_ITEMVAL element and, finally, a branch at page 2 that sets P2_ITEMVAL with P1_ITEMVAL. I really have no idea how to do the same thing when the target is a modal page.
I created a unit test on https://apex.oracle.com/pls/apex (application 1554 - redir_to_modal)
Workspace: tests
USER: supporter
PWD: supporter1234
Any help would be much appreciated.
Kind regards
Pavel
Pavel
If you prepare a URL using the value calculated in the PLSQL of DA part you can then use a subsequent stage of javascript to set the location of the window.
This will jump to the top of the page of the modal dialog box
: P1_URL: = apex_util.prepare_url)
' f ? p ='|| : APP_ID - Application id
|': 2' - Page id
||': ' || : APP_SESSION - Session id
||':' -- Request
||':NO' -- Debug
: ': ' - Clear Cache
: ': ' - Settings
||' P2_ITEMVAL'
: ': ' - Parameter values
|| (: P1_ITEMVAL);
then in the action of javascript
Window.Location.Replace ($v ('P1_URL'));
Hope this is of some use
Concerning
Kelvin
-
Returns the value of column line
Greetings! I currently have a request we will tell
SELECT value, period FROM MAS_CFUS_KEYACM_CONTROLDATA ORDER BY cf_keyword_ID
RESULTS
Period value
--------------------------
100.0002 1 JANUARY 14
-35.68 1 DECEMBER 14
-1943.67 NOVEMBER 1, 14
678.0013 OCTOBER 1, 14
This continues for about 15 results by cf_keyword_ID.
I'm looking to return the VALUE first in a new column called PREV1, the second value of PREV2, third in PREV3 and so on. The same goes for the dates. And all this for only the first 10 values of each cf_keyword_ID. Can anyone suggest the best way to achieve this?
Thank you!!
Hello
This is called pivoting. Because I don't have a copy of your table test, I'll use scott.emp to illustrate.
This shows the first 3 employees for each job, in order by hiredate, along with their hiredates:
WITH relevant_data AS
(
SELECT ename, job, hiredate
row_number () taken OVER (PARTITION OF work
ORDER BY hiredate
) AS r_num
FROM scott.emp
)
SELECT *.
OF relevant_data
PIVOT (MIN (ename) AS ename
MIN (hiredate) AS hiredate
FOR r_num (1, 2, 3)
)
ORDER BY job
;
Output:
WORK 1_ENAME 1_HIREDATE 2_ENAME 2_HIREDATE 3_ENAME 3_HIREDATE
--------- ---------- ----------- ---------- ----------- ---------- -----------
ANALYST FORD 3 December 1981 SCOTT April 19, 1987
The CLERK SMITH December 17, 1980, 3 December 1981 JAMES MILLER January 23, 1982
MANAGER JONES 2 April 1981 BLAKE 1 May 1981 CLARK June 9, 1981
PRESIDENT KING November 17, 1981
SELLER ALLEN 20 February 1981 WARD 22 February 1981 TURNER 08-Sep-1981
There are actually more than 3 SECRETARIES and SALESMEN. Which does not cause an error; the only first 3 are shown.
As you can see, having less of 3 does not cause any errors, either.
For more info on pivots, see the FAQ of the Forum:
Re: 4. How can I convert rows to columns?
I hope that answers your question.
If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
If yod post rather a problem using scott.emp, then you need not display the sample data; just results and explanations.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum:
-
How can I retrieve all the values in a single query in the oracle XML
Hi all
I have xml format below, how do I retrieve all the values in a single query.
< files >
< job > MANAGER < / job >
< details >
< ename > JONES < / ename >
< sal > 2975 < / sal >
< ename > BLAKE < / ename >
< sal > 2850 < / sal >
< ename > CLARK < / ename >
< sal > 2450 < / sal >
< / details >
< / documents >
Thank you
I prefer desgin a little more sophisticated xml and wrap the details in a separate label.
Then you could something like that
1 with testdata until)
2. Select xmltype)
3'
4MANAGER
5
6
7JONES
82975
9
10
11BLAKE
122850
13
14
15CLARK
162450
17
18
19
20 ') in the form x
21 double
22)
23 select
24 j.job
25, d.ename
26, d.sal
27 of testdata
28 join
29 xmltable ("Scriptures" in passing testdata.x)
30 columns
31 job varchar2 (30) path "job."
32, details xmltype path «details»
(33) j
34 (1 = 1)
left outer join 35
36 xmltable (' details/emp' in passing j.details)
37 columns
path of varchar2 (30) 38 'ename' ename
39, path of varchar2 (30) sal "sal".
(40) d
41 * (1 = 1)
>/JOB ENAME SAL
------------------------------ ------------------------------ ----------
JONES MANAGER 2975
BLAKE MANAGER 2850
MANAGER CLARK 2450 -
Hello
When I try to install a trial like photoshop cs6 or master collection cs6 product, I get the error "Installer has not initialized. I used Adobe cleaner to remove all products cs6 and tried again, but no luck, same error.
I opened the log file and find this line:
[FATAL] Setup error - installation package C:\Users\moshe-a\Desktop\MasterCollection_CS6_LS6\packages\core\PDApp.pimx.
Returns the value of pim_installPackage = - 1
No idea how to fix?
Thank you, Momu
start at the top and work your way down to apply applicable patches until your problem is solved.
If (win) cc: https://helpx.adobe.com/creative-cloud/kb/creative-cloud-desktop-application-failed.html
If your error is:
"Setup failed to initialize. File not found. ' or 'could not initialize installation. This could be due to missing files.
first of all, rename folder OOBE OOBE.old.
to find the OOBE:
Win 64 bit OS: Program Files x86\Common Files\Adobe\OOBE
Win 32 bit OS: Program Files \Common Files\Adobe\OOBE
Mac os: HD > library > application support of > adobe > caps
Mac os: USER > library > application support of > adobe > OOB
If it fails or isn't the exact error you see, uninstall, clean (http://www.adobe.com/support/contact/cscleanertool.html) and reinstall.
If you use an installation dvd:
Copy the contents of the drive in a desktop folder and install from this directory.
If you are using a mac:
1. try to create a new user account in Mac with administrator privileges.
2. connect to the new user, navigate to Mac HD > Application > utilities > Adobe Installer folder, locate products such as Adobe Reader, Adobe Flash, Adobe Air and uninstall the
3. navigate to the user library > Application Support > Adobe and Adobe put in the trash.
4. navigate to Mac HD > library > Application Support > Adobe and Adobe put in the trash.
5 restart the installation.
If everything is applicable above fails, check your Setup logs:
http://helpx.Adobe.com/Photoshop-elements/KB/troubleshoot-install-using-logs-elements.html
-
Mathmatical function to return the value in injectors
Hello
I have obliged. If value for ex Lake 4400000, he should return as 4.4millions even for billions.
is there an oracle function to return the value in this format. ???Hello
When I want to have a "readable" released in large numbers, I use to do the following:
Scott@my11g SQL>with t as ( 2 select 3456123456 n from dual 3 union all select 4567123 from dual 4 union all select 123465 from dual 5 ) 6 select n, case when n>1000000000 then trunc(n/1000000000,1)||' Billions' 7 when n>1000000 then trunc(n/1000000,1)||' Millions' 8 else to_char(n) end fmtn 9 from t ; N FMTN ---------- ------------------------------------------------- 3456123456 3.4 Billions 4567123 4.5 Millions 123465 123465
------
* + [change] + *.
Moreover, lakh [url http://en.wikipedia.org/wiki/Lakh] has no meaning outside of South Asia.
Especially for a French man like me, grown with [url http://en.wikipedia.org/wiki/International_System_of_Units] International system of units that is fighting against what I call "funky" measures empirical such miles, yards, feet, inches, just not multiple of 10³
Same billion mean differ depending on the country (see [url http://en.wikipedia.org/wiki/Long_and_short_scales] long and short scales)Just for "fun": [url http://articles.cnn.com/1999-09-30/tech/9909_30_mars.metric.02_1_climate-orbiter-spacecraft-team-metric-system?_s=PM:TECH] this is what can happen when we do not use the same system of units.
-
How to return the value 0 for no data using the County?
Hi all
I used this query to count the number of records for each month of the year:
SELECT DISTINCT COUNT (I.information_sid) COUNT, TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM') MONTH
INFORMATION I
TO_DATE GROUP (TO_CHAR (INSERT_DATE, 'MM'), 'MM')
ORDER BY TO_DATE (TO_CHAR (INSERT_DATE, 'MM'), 'MM')
But this code returns no value for months without data
I want to return the value '0' for any month of data. How, please?
Note: I use reports 6i.Maybe this?
SELECT SUM(CNT_REC) CNT_REC, MONTH FROM ( SELECT COUNT(I.information_sid) CNT_REC, TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM') MONTH FROM INFORMATIONS I GROUP BY TO_DATE(TO_CHAR(INSERT_DATE,'MM'),'MM') UNION ALL SELECT 0, LPAD(ROWNUM,2,0) FROM ALL_OBJECTS WHERE ROWNUM <= 12 ) GROUP BY MONTH ORDER BY MONTH
No need to SEPARATE during the use of GROUP BY.
-Clément
-
too many return values for a single node
I have a table with two columns
the table structure
----------------------
string school_name type
xmltype obj_xml
Row1
----------
abc_school,
< student >
< student >
< id > 101 / < ID >
< teacher > CBA < / teacher >
< / student >
< student >
< id > 102 / < ID >
XYZ < teacher > < / teacher >
ONP < teacher > < / teacher >
RSM < teacher > < / teacher >
< / student >
< / students >
row2
-----------
def_school,
< student >
< student >
< id > 301 / < ID >
pqr < teacher > < / teacher >
< / student >
< student >
< id > 302 / < ID >
XYZ < teacher > < / teacher >
< / student >
< / students >
is it possible to display data in the format using a query oracle below.
---------------------------------------------------------------------------------------------------
teacher id school_name
--------------------- ------- ------------
abc_school 101 abc
abc_school 102 xyz
abc_school 102 onp
RSM abc_school 102
I used the slot request, throwing an error - too many return values for a single node
SELECT school_name, teacher
ExtractValue (value (x), ' / / key ') like student_id
extractValue (value (x), ' / / value ') AS teacher
SCHOOL t,.
TABLE)
XMLSequence (extract (obj_xml, ' / students/pupils '))
) x
Please post How can I modify this query, the teacher tags may vary for each student
Published by: user7955917 on May 8, 2012 04:00As mentioned in your other thread today, it would be helpful if you could post your exact version of db.
Samples of work would be appreciated too, the XML data, you gave are not correct.I would do it with two XMLTables, like this:
SQL> SELECT school_name 2 , x1.id 3 , x2.teacher 4 FROM school t 5 , XMLTable('/students/student' 6 passing t.obj_xml 7 columns id number path 'id' 8 , teachers xmltype path 'teacher' 9 ) x1 10 , XMLTable('/teacher' 11 passing x1.teachers 12 columns teacher varchar2(30) path '.' 13 ) x2 14 ; SCHOOL_NAME ID TEACHER ------------------------------ ---------- ------------------------------ abc_school 101 abc abc_school 102 xyz abc_school 102 onp abc_school 102 rsm def_school 301 pqr def_school 302 xyz 6 rows selected
-
DBMS_CRYPTO. HASH returns the value encrypted letters
Hi all
SE 12.1
I'm using dbms_crypto. Hash to encrypt the values. But encrypted the returned string is at the top of the case. Calling WebService Im externally requires the proper case... I've seen other ciphers (java-based) hash functions that seem to properly encrypt with a mixture of cases, what I need.
Is it possible to return the string that is encrypted in the proper case.
DECLARE
l_ccn_raw RAW (128);
BEGIN
l_ccn_raw: = utl_raw.cast_to_raw('1234');
l_ccn_raw: = dbms_crypto.hash (l_ccn_raw, dbms_crypto.hash_sh256);
dbms_output.put_line (' TOKEN: ' |) ( l_ccn_raw) ;
END;
You can always try dbms_output.put_line (' TOKEN: ': bass (l_ccn_raw));
But are you sure that you don't need a hashvalue base64-coded?
dbms_output.put_line (' TOKEN: ' | utl_raw.cast_to_varchar2 (utl_encode.base64_encode (l_ccn_raw)));
-
Need help: not prepared statement to return the value:
Hi refugees,
In LICS, prepared statement does not return any value...
This is the code...
String p_person_id = pageContext.getParameter ("person_id");
Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();
String payment_query = "select max (payment_date) in the xxbdf_payslip_detail_mv where assingment_id = (select assignment_id from the people_reporting_info where person_id ' + p_person_id + ') ';
PreparedStaement stmt = stmt.executeQuery ();
ResultSet rs = stmt.executeQuery ();
While ((rs! = null) & & RS.) Next
{
java.sql.Date sql_date = rs.getDate (1);
SOP (SQL_DATE)
/ * I tried this also * /.
java.util.Date util_date = rs.getDate (1);
SOP();
String string_date = rs.getString (1);
SOP();
}
and I have to format the date as "DD-MM-RRRR.
Please give your valuable suggestions refugees...
Thank you
Jaya
Jaya Hey,
Write the code below in the PR
Code for the prepared statement
String PaymentData;
String p_person_id = pageContext.getParameter ("person_id");
System.out.println ("The person Id is" + p_person_id); check the id of the person should not be null.
try {}
Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();
String query = "select max (payment_date) in the xxbdf_payslip_detail_mv where assingment_id = (select assignment_id from the people_reporting_info where person_id ' + p_person_id + '); '
PreparedStatement stmt = conn.prepareStatement (Query);
ResultSet = stmt. ExecuteQuery();
While (resultset.next ())
{
PaymentData = (String) resultset.getString("payment_date").toString ();
}
Conn.Commit ();
}
catch (System.Exception e)
{
e.printStackTrace ();
}
See below the Code for the Date Format Conversion
cabu.ui.validate.Formatter formatter = new OADateValidater (PaymentData, "dd-MMM-YY" "");
Thank you
Dilip
-
Case in SQL condition does not return the values as expected
Hello gurus of PL/SQL,.
SELECT amd.brkr_nm, amd.brkr_sym, AMD.MINORITY_FLG, atdf.comm_brkr_dim_key, atdf.exec_brkr_dim_key,
WHEN atdf.COMM_BRKR_DIM_KEY = AMD.ACCESS_METHOD_DIM_KEY - CASE THEN
WHEN AMD BOX. MINORITY_FLG = 'Y' THEN
CASE WHEN atdf.EXEC_BRKR_DIM_KEY = atdf.COMM_BRKR_DIM_KEY THEN 'Done' ELSE 'InDirected.
END
ANOTHER "NA".
END
ELSE ' 0'
END
AS Direction_Method
Of
alloc_tran_det_fact atdf,
ACCESS_METHOD_DIM AMD
But it returns me the 0 value in the Direction_Method field. But when I checked the values in DB then my first condition (atdf.COMM_BRKR_DIM_KEY = AMD.ACCESS_METHOD_DIM_KEY)
second condition (AMD. MINORITY_FLG = 'Y') and third (atdf.EXEC_BRKR_DIM_KEY = atdf.COMM_BRKR_DIM_KEY) condition of all them have passed, then it should show the value as indicated, but it is shwoing the '0' value only in the Direction_Method column.
Kindly help me.. .am I missing something?
I use Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production. I can't create the test data in the database, I did not have the required privileges to make :(
Kindly help me, thnanks in advance for your time and your comments
Published by: user555994 on May 24, 2012 02:00could be a space or case (upper or lower case). Try:
/* Formatted on 2012/05/24 16:00 (Formatter Plus v4.8.8) */ SELECT amd.brkr_nm, amd.brkr_sym, amd.minority_flg, atdf.comm_brkr_dim_key, atdf.exec_brkr_dim_key, CASE WHEN trim(upper(atdf.comm_brkr_dim_key)) = trim(upper(amd.access_method_dim_key)) THEN CASE WHEN trim(upper(amd.minority_flg)) = 'Y' THEN CASE WHEN trim(upper(atdf.exec_brkr_dim_key)) = trim(upper(atdf.comm_brkr_dim_key)) THEN 'Directed' ELSE 'InDirected' END ELSE 'NA' END ELSE '0' END AS direction_method FROM alloc_tran_det_fact atdf, access_method_dim amd
-
I have an Acrobat only plugin, developed in 2005 VS. Originally with Acrobat 7 SDK, now updated to use Acrobat 9 SDK. The ultimate goal of this feature is to open a PDF file from a web server Agile: If a user string, a URL is created, a request sent to the URL, then pay back the answer. The answer can be either the PDF itself or a string path to the PDF file. I thought it would be easier to use the version of PDF path to simply open the new PDF of the http:// address.
I created a folder level javascript with a call to Net.HTTP.request confidence. I have a script that works when invoked from a menu item added by the folder level javascript file. But when you use this same command in my C++ with AFExecuteThisScript code, I can't get the HTTP response to finish pending in the code for the result.
The Net.HTTP.request and the asynchronous callbacks confuse me, so maybe that's my big problem. I could not Net.HTTP.request to return a value in a service simple javascript right now, I'm trying to use a "global" variable in the JavaScript folder level and two calls. The first call "sets" the global variable, the other "becomes" it. But this seems to be the issue. When I have my code debugging or stop execution, the part of the response of the Net.HTTP.request is never called. But when I left to go beyond this step with error recovery, the answer appears later.
So how kick off of the Net.HTTP.request and be notified when it's over? either in JavaScript or VC ++?
Any help is appreciated. Even if the best option is to stream the file from the web server to a local file and then open the (this is the option that I take in another tool that runs outside of Acrobat).
Here's the code.
Javascript controls at the level of the files (urls truncated for the post)
var THE_PATH = ''; function setTHE_PATH ( gURL ) { console.println('setTHE_PATH Begin'); var params = { cVerb: 'GET', cURL: gURL, oHandler: { response: function( msg, uri, e) { console.println('response method: Setting Path'); THE_PATH = SOAP.stringFromStream( msg ); console.println('<<' + THE_PATH + '>>'); } } }; console.println('URL: ' + params.cURL + '\n oHandler: ' + params.oHandler ); console.println('Path: ' + THE_PATH ); var netResult = trustedNetHTTPrequest(params); console.println('setTHE_PATH End'); return THE_PATH; }; trustedNetHTTPrequest = app.trustedFunction( function ( params ) { console.println('trustedNetHTTPrequest begin'); app.beginPriv(); var netResult = Net.HTTP.request( params ); app.endPriv(); console.println('trustedNetHTTPrequest end'); return netResult; } );
Added MenuItems with JavaScript at the folder level
app.addMenuItem( { cName: "mysetTHE_PATH", cUser: "set THE_PATH", cParent: "Tools", cExec: "setTHE_PATH('http://......&getURL=true');", nPos: 0 } ); app.addMenuItem( { cName: "mygetTHE_PATH", cUser: "get THE_PATH", cParent: "Tools", cExec: "console.println( THE_PATH );", nPos: 0 } );
Here's the JavaScript Console output when you run these two commands:
setTHE_PATH Begin URL: http://......&getURL=true oHandler: [object Object] Path: trustedNetHTTPrequest begin trustedNetHTTPrequest end setTHE_PATH End response method: Setting Path <<https://......DesiredFilename.pdf>>
Here is the function in the plugin C++, with additional measures to prove AFExecuteThisScript works here
sprintf(jsScript, "testVal='%s';event.value = testVal;", strURL.c_str() ); AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue ); // After this, pReturnValue is the passed-in URL, as expected. sprintf(jsScript, "setTHE_PATH('%s');event.value = 'Step 1 Worked!!';", strURL.c_str() ); AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue ); // After this, pReturnValue is 'Step 1 Worked!!', as expected. sprintf(jsScript, "event.value = THE_PATH;", strURL.c_str() ); AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue ); // After this, pReturnValue is NULL
This is the JavaScript Console output when you run the commands using the plugin (mode debugger, to wait after step 1)
setTHE_PATH Begin URL: http://......&getURL=true oHandler: [object Object] Path: trustedNetHTTPrequest begin trustedNetHTTPrequest end setTHE_PATH End
Note that he never gets to the part of the "method of response.
Thank you!
Tim James
You need not limit yourself to the plugin API. The requests HTTP from C/C++ is a fairly common condition, just observe the restrictions in my answer.
-
Query must return the values null
Hi once again, everything
The query below should return zero values for the date, but instead it brings back each transaction in the table, any ideas why?
SELECT CID.transaction_id, MMT.ITEM_ORD PART_NUMBER, CID.DESCRIPTION, CID.TRANSACTION_TYPE_NAME, CID.LINE_TYPE_NAME, CID.SUBINVENTORY_CODE, MMT.TRANSACTION_QUANTITY, CID.BASE_TRANSACTION_VALUE TRANSACTION_VALUE, GLC.SEGMENT1, GLC.SEGMENT2, GLC.SEGMENT3, GLC.SEGMENT4, GLC.SEGMENT6, TO_CHAR (MMT.TRANSACTION_DATE, 'DD-MON-YY HH24:MI') transaction_date_and_time, TRUNC (MMT.TRANSACTION_DATE) transaction_date FROM CST_INV_DISTRIBUTION_DAV_V CID, MTL_MATERIAL_TXNS_VAL_V MMT, GL_CODE_COMBINATIONS GLC WHERE CID.TRANSACTION_ID = MMT.TRANSACTION_ID AND CID.REFERENCE_ACCOUNT = GLC .CODE_COMBINATION_ID; AND MMT.TRANSACTION_DATE = '26-AUG-11 22:00'
Yes. It's true. You must use TO_DATE to convert a string to a date and you must use TO_CHAR to convert a date into a string.
-
Return the value of the DB display in a Popup Lov (selected)
Hello
I use a Popup Lov to select a value and check in the DB (it works), but I do not know how to return this value as selected in the popup Lov and keep the other options available to select again.
Any ideas?
Thank you in advance,
Alan MartiniHi Alan,
OK - keep in mind that this will affect each using the popup LOV page
Text on the page popup LOV template, under the body of Page attributes, I removed the onload = "first_field ()" let fair: style = "margin: 0;" "
Then, as part of Page footer text below that, I added:
<script type="text/javascript"> var aa = document.getElementsByTagName("A"); if (aa) { aa[0].focus(); } </script>
It's just a collection of tags 'A', and if there is at least one, it shifts the focus to the first. My previous SQL makes the value currently selected one in the list, so this should be the same as that. As the item has focus, the user has just need to press ENTER to select this option.
Andy
Maybe you are looking for
-
Why most of the files by e-mail in local folders open with the Message Search screen?
Not much more to say. Instead of open and display the message headers and the preview window, most of the E-mail files opens with message search window. It seems that the size of folders or something small to display headers of message, messages in t
-
Problem with keys Fn + F10 on a Satellite A120SE-189
Hello I am facing a problem with my Toshiba Satellite A120SE-189: the F10 function turn off by pressing Fn + F10. Although the F10 function on, I use the keyboard Overlay. Yet, when I try to turn it off (Fn + F10), the keyboard does not work (as it s
-
I changed my date of the bios (back 2 days) in order to access my computer when my administrative password has expired. Do I need to change it to the correct date, now that it's been a few days or would just cause me more problems? Thank you. I cha
-
Card system ThinkPad X 61 replacing X60T?
Hello Can I use a card system on a laptop X60T X 61? The X 61 systemboard is FRU: 43Y9032, which I can't find any info about it. Can someone please throw some info about FRU: 43Y9032 system board. Thank you
-
How to play .asx files in Windows Media Player
original title; Can I play a video file of .asx with WMP? or if not, how to play with this extension .asx files? Can I play a video file of .asx with WMP? or if not, how to play with this extension .asx files? When I try to play the file, WMP shows e