UI5 Table JSON Data without columnnames
Hey there,
if I want to use JSON Data to be consumed by a SAPUI5 Table the developer guide suggests this format:
var aData = [
{lastName: "Dente", name: "Al", checked: true, linkText: "www.sap.com", href: "http://www.sap.com", src: "images/person1.gif", gender: "male", rating: 4},
{lastName: "Friese", name: "Andy", checked: true, linkText: "www.sap.com", href: "http://www.sap.com", src: "images/person2.gif", gender: "male", rating: 2}];
But since I have big JSON files I don't want to write the columnname in for each row. It should be specified just by order. So it would look like this:
var aData = [
["Dente", "Al", true, "www.sap.com", "http://www.sap.com", "images/person1.gif", "male", 4],
["Friese", "Andy", true, "www.sap.com", "http://www.sap.com", "images/person2.gif", "male", 2] ];
here is a full example: JS Bin - Collaborative JavaScript Debugging</title> <link rel="icon" href="http://static.jsbin.…
Is this possible? And how?
Thank you.
Hi Andreas,
i don't think you'll have to worry about optimizing JSON.
The reason for JSON being preferred is it's lightweight and easy for humans to read & write
How much would ideally a bunch of 1000 or more than that of extra characters could save the loading time ? It's not gonna be any much difference! And if you remove the column name (object's key), your JSON would become complex to read (naturally/programatically)
And the format you've suggested is Array of arrays. Though you don't give any column name there, it's gonna take the column name by default as 0...n as below
A proper JSON would be an Collection of Objects. Objects are supposed to be defined in key:value pairs which you meant as columnName:value.
Regards
Sakthivel
Similar Messages
-
Create report based on JSON data
Dear All,
I'm on Oracle APEX 4.1 and Oracle 11g. I'm receiving JSON data in my application and would like to print report based on JSON data without storing it in any table.
Can you please suggest best way to achieve it?
Regards,
ChintanHi,
in 4.1 you can for example use the open source PL/JSON library (http://sourceforge.net/projects/pljson/) to parse JSON.
In APEX 5.0, we currently plan to add a JSON API package that e.g. can be used to convert JSON to XML. Here is an example:
SQL> select col1, col2
2 from xmltable (
3 '/json/row'
4 passing apex_json.parse('[{"col1": 1, "col2": "hello"},{"col1": 2, "col2": "world"}]')
5 columns
6 col1 number path '/row/col1',
7 col2 varchar2(5) path '/row/col2' );
COL1 COL2
1 hello
2 world
At the last OOW, it was also announced that the RDBMS will provide native support. That should be the preferred option in the future.
Regards,
Christian -
Using expdp to export a mix of tables with data and tables without data
Hi,
I would like to create a .dmp file using expdp, exporting a set of tables with data and another set without data. Is there a way to do this in a single .dmp file? For example, I want all the tables in a schema with data, but for the fact tables in that schema, I only want the fact table objects, not the data. I thought it might be easier to create two separate .dmp files, one for each scenario, but would be nice to have one .dmp file that satisfies my requirement. Any help is appreciated.
Thanks,
-Rodolfo
Edited by: user6902559 on May 11, 2010 12:05 PMYou could do this with where clauses. Let's say you have 10 tables to export, 5 with data and 5 without data. I would do it like this
tab1_w_data
tab2_w_data
tab3_w_data
tab4_w_data
tab5_w_data
tab1_wo_data
tab2_wo_data
tab3_wo_data
tab4_wo_data
tab5_wo_data
I would make one generic query
query="where rownum = 0"
and I would make 5 specific queries
query=tab1_w_data:"where rownum > 0"
query=tab2_w_data:"where rownum > 0"
query=tab3_w_data:"where rownum > 0"
query=tab4_w_data:"where rownum > 0"
query=tab5_w_data:"where rownum > 0"
The first query will be applied to all tables that don't have their own specific query and it will export no rows, the next 5 will apply to each of the corresponding table.
Dean -
Possible to hit enter on table cell & retrieve data without selecting line?
Hi All,
We're using ECC6. I I have a situation where the user wants to be able to hit a cell in a table which will then fire a report and pass the contents of that cell to the report.
So far I have been only able to get this working when the row is highlighted, I can easily pick up the values from the lead selection. But the user does not want to have to highlight a row every time to run the report. The user just wants to hit return a cell and for the report to be updated with the value in that cell.
So, I'm just wondering if it is possible to hit enter in any table cell and retrive the data without highlighting the row?
Many thanks in advance,
Liz.Hi,
You want complete row data or perticular cell data??
Basic q's, without selecting a row how can we get data? without selecting means you get complete data on table,
In that case which data you have to pass to report?
Or if you dont want to select data means, create one more field of type button. so in thins button action get that row data
and call report from here itself.
Cheers,
Kris. -
How to display table data without using ALV and table element.
Hi,
Its possible to display table data without using ALV and table element.
Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
(every time i am fetching single row data ),
But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
settings and header data etc..things.
Give solution to display data part..
Regards,
Rakhi.Hi,
Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
* Standard Filter Function setting to FALSE
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
* Standard Filter Function setting to FALSE Ends
Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
Hope this answers your query.
Thanks.
Kumar Saurav. -
SAP UI Table and escaped JSON data
Hi,
There is table which is bound to a JSON data.
I'm getting the JSON data via ajax call. Some of the data in the JSON is escaped.
But, i'm loading the table data via Table.bindRows() API. This shows the data in the escaped format. I want to show it in the unescaped format
=========================== Representative code =================================
oControl = new sap.ui.commons.TextField().bindProperty("value","Token").setEditable(false);
oMasterTbl.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "MYDATA"
template : oControl,
sortProperty : "mydata",
filterProperty : "mydata",
width : "50%"
function onBody() {
var aUrl = '../services/MyCustom.xsjs;
jQuery.ajax({
url: aUrl,
method: 'GET',
dataType: 'json',
success: this.onCompleteBody
function onCompleteBody(myTxt){
oModel.setData({ businessData : myTxt });
oMasterTbl.bindRows("/businessData/MyData");
oMasterTbl.setModel(oModel);
oMasterTbl.invalidate();
=========================== End Representative code ==============================
Tried oModel.setData({ businessData : unescape(myTxt) });
This invalidates the JSON and the table data is empty.
How and where do i unescape the relevant data ?
I know that the value in the field may be escaped. How do i unescape the data from the model ?
regards,
sreeramHello,
The below code snipped worked
function onCompleteBody(myTxt){
oModel.setData({ businessData : myTxt });
oMasterTbl.bindRows("/businessData/MyData");
oMasterTbl.setModel(oModel);
var nrows = oModel.getProperty("/businessData/MyData");
var cntxt, len, i;
len = nrows.length;
for (i=0; i<len; i++) {
cntxt = oMasterTbl.getContextByIndex(i);
tkn = cntxt.getProperty("mydata");
tkn = unescape(tkn);
oModel.setProperty("mydata", tkn, cntxt);
oMasterTbl.setModel(oModel);
oMasterTbl.invalidate(); -
How to bind data from odata to the ui5 table .
HI ,
Can anybody help to bind Odata service to the ui5 table in eclipse .
This is my code.Check this
http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html
http://baigsorcl.blogspot.com/2010/03/moving-to-jdeveloper11g-your-first-adf.html
@John now you won :D -
SAP UI5, MII, & JSON
I've been using jQuery ajax calls to fetch MII JSON data and display it in various ways for some time now when I want to display data in something other than an MII applet. My client wants to transition to using SAP UI5 in their web reports and so I've been doing some prototyping.
I've found that I cannot get a UI5 table to bind to an MII Rowsets result set when the content type is JSON.
Some example code...
// This works fine...
function buildTableAjax() {
"use strict";
var q = miiUtils.miiGet(queryTemplate, {}); // (wrapper function around $.ajax)
q.done(function (data, status, xhr) {
var model = new sap.ui.model.json.JSONModel();
// if I setData to the returned "Rowsets" object I can
// not figure out a bindRows expression that works so
// I use the 0th rowset instead
model.setData(data.Rowsets.Rowset[0]);
var str = model.getJSON();
var table = new sap.ui.table.Table({
title: "Water Samples",
visibleRowCount: 20
var cols = data.Rowsets.Rowset[0].Columns.Column;
$.each(cols, function (i, col) {
if ($.inArray(col.Name, hideColumns) === -1) {
table.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({
text: col.Name
template: new sap.ui.commons.TextView().bindProperty("text", col.SourceColumn),
sortProperty: col.SourceColumn,
filterProperty: col.SourceColumn,
width: "75px"
table.setModel(model);
table.bindRows("/Row");
table.placeAt("tableHolder");
I know that this isn't the preferred way to do this and I would like to use the whole UI5 stack sometime soon, so I came up with the following.
function buildTableUI5() {
"use strict";
var requestUrl = miiUtils.createRequestURL(queryTemplate, {
"Content-Type": "text/json"
var model = new sap.ui.model.json.JSONModel();
var table = new sap.ui.table.Table({
title: "Water Samples",
visibleRowCount: 20,
// maybe add columns based on result set later...
table.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({
text: "Description"
template: new sap.ui.commons.TextView().bindProperty("text", "Description"),
sortProperty: "Description",
filterProperty: "Description",
width: "75px"
model.attachRequestCompleted(function () {
// do something with data if required...
//var str = model.getJSON();
model.loadData(requestUrl);
table.setModel(model);
table.bindRows("/Rowset/Row");
table.placeAt("tableHolder");
buildTableUI5 will always display "No Data". If I simply change the url's Content-Type to text/xml and change the model type to XMLModel, the function works as expected and data is bound.
I would prefer to use JSON if possible, Can it be done through model.loadData()? What would I put in the bindRows call to get it to work? (The value of the commented out str variable in attachRequestCompleted is the expected json result, so the data is being returned just fine).
Thanks!Hi Allan,
The data structure changes when your content type is JSON hence you cannot map rowsets/rowset/row structure and get the desired output.
Generally, MII 14.0 onwards is capable of giving JSON result that can be directly mapped to ui5 components.
What is miiUtils.createRequestURL retur ning you here. I suspect a mapping issue here as everything else looks good.
See is below example helps you. This is referring to UI5 Charts but atleast can give you some idea on model and data binding.
Getting started with Viz Charts
Table - SAPUI5 Demo Kit
Best Regards,
Swaroop -
How can I get a date without the hour from sql server 2000 ?
hellou!
I have a JTable, and one of it's columns has to show a date. This date i have to show is specified as datetime on the Sql Server 2000 database where I have to take the data.
the query of the dataset attached to the JTable is something like "select * from Table".
The problem is that the JTable column that displays the date shows the date and the hour, for example:
7/10/04 0:00:00
and I need to show the date without the hour, only the 7/10/04. Can anyone tell me how to do that?
thank you very much! : )The easiest way to format a date is with java.text.SimpleDateFormat. When creating it you pass a format string which can be used to parse or format date objects.
SimpleDateFormat formater = new SimpleDateFormat( "MM/dd/yyyy" );
// Get date objects directly from sql
Date foundDate = result.getDate( 1 ); //where result is the ResultSet and 1 is the date column
String formatedDate = formater.format( foundDate );Now the JTable's table model can be adjusted to store a formated String instead of a Date. If for some reason it is required to store the value as a Date overload the table model to return the formated string when getValueAt is called. -
Different discount date from that of due date without using payment terms
Hi,
We would like have separate discount due date from due date without using payment terms for each invoice.
We wants to modify ERDK-FAEDS but unable to find suitable event/exit for the same.
So can anyone suggest any event where this can possibly be achived.
Regards,
PareshHi,
We are using continuous days for working out due date from document date.
But for discount due date business sought to provide only working days (say 7 days) from document date.
So as to satisfy this requirement, I had adopted event R436 where system intially takes values provided but somehow it gets cleared in below lines. So I am unable to find a workaround to resolve this issue.
PERFORM get_user_exit_function USING 'R436'.
LOOP AT t_fbstab WHERE funcc <> 'ISU_SAMPLE_R436'.
tmp_erdk = p_iiu-print_doc-erdk.
tmp_erdz[] = p_iiu-print_doc-t_erdz[].
CALL FUNCTION t_fbstab-funcc
EXPORTING
x_invoice_param = p_param
x_invoice_unit = p_iiu
TABLES
xy_printdoc_lines = tmp_erdz
y_new_bill_lines = tmp_new_bill_lines
CHANGING
xy_printdoc_header = tmp_erdk
EXCEPTIONS
error_message = 1.
Regards,
Paresh -
Modify JSON data after Approval
I've managed to write my own UI5 app based on the "Building SAP Fiori-like UIs with SAPUI5", and I want the Approve function to work now.
I have the following JSON data detail:
"BusinessPartnerList": [
"BPId": "0100000000",
"Role": "01",
"EmailAddress": "[email protected]",
"PhoneNumber": "6789",
"WebAddress": "http://www.sap.com",
"CompanyName": "SAP",
"LegalForm": "AG",
"Country": "DE",
"City": "Walldorf",
"PostalCode": "69190",
"Street": "Dietmar-Hopp-Allee",
"Building": "15",
"SalesOrders" : [
"SalesOrderID": "0500000009",
"Netto Amount": "3338.00",
"Time Stamp": "2014.04.28. 9:00:00",
"Gross Amount": "3972.22",
"Status": "N",
"CurrencyCode": "EUR",
"Items": [
"Position": "0000000010",
"QuantityUnit" : "EA",
"Tax": "181.64",
"ProductName": "First Item Name",
"ProductID": "HT-1000",
"Quantity": "1",
"DeliveryDate": "2014-05-05T07:00:00.0000000",
"CurrencyCode": "EUR"
"Position": "0000000020",
"QuantityUnit" : "EA",
"Tax": "596.60",
"ProductName": "Second Item Name",
"ProductID": "HT-1002",
"Quantity": "2",
"DeliveryDate": "2014-05-05T07:00:00.0000000",
"CurrencyCode": "USD"
"SalesOrderID": "0500000030",
"Netto Amount": "22337.00",
"Time Stamp": "2014.04.28. 9:00:00",
"Gross Amount": "26581.03",
"Status": "P",
"CurrencyCode": "EUR"
"SalesOrderID": "0500000039",
"Netto Amount": "3338.00",
"Time Stamp": "2014.04.28. 9:00:00",
"Gross Amount": "3972.22",
"CurrencyCode": "EUR",
"Status": "N"
I can list the SalesOrders for the specific partner, and than list the items of the specific SalesOrder.
Now I'd like to Approve the order, and change it's status from "n" to "P" in the JSON file as well.
But I have no idea how to do it in the SalesOrderItem.controller.
I hope someone can help meSince "BusinessPartnerList" and "SalesOrders" are both arrays, i think you need some index in your path.
if you want to adress a specific business partner and sales order, you would need something like oJsonModel.setProperty("/BussinessPartnerList/0/SalesOrders/1/Status" , 'P' ); -
ODP OracleCommandBuilder. Updating a table including DATE columns.
Hi
I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
I have created a test table (called DATETEST) with three columns:
STRINGCOLUMN VARCHAR2 10
DATECOLUMN DATE
NUMBERCOLUMN NUMBER
The STRINGCOLUMN is the primary key.
Then I created a typed dataset that looks like this:
STRINGCOLUMN string
DATECOLUMN string
NUMBERCOLUMN long
This is the XML schema for the typed dataset:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DateDS" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="DATETEST">
<xs:complexType>
<xs:sequence>
<xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
<xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
<xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
And this is the test code:
Dim connection As Oracle.DataAccess.Client.OracleConnection
Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
Dim sqlstring As String
Dim data As New DateDS() 'Typed dataset
Const ConnectionString As String = "User Id=............."
Try
'Connect to database
connection = New OracleConnection(ConnectionString)
connection.Open()
'Get data from table DATETEST
dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
dbCommand.Connection = connection
adapter.SelectCommand = dbCommand
adapter.Fill(data, "DATETEST")
'Make changes to dataset
data.DATETEST(0).DATECOLUMN = Now()
data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
'Update database
sqlstring = "SELECT * FROM DATETEST"
adapter.SelectCommand = New OracleCommand(sqlstring, connection)
Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
custCB.DataAdapter = adapter
adapter.Update(data, "DATETEST")
'Disconnect
connection.Close()
connection.Dispose()
Catch exc As Exception
MessageBox.Show(exc.Message)
End Try
Getting the data from the database is not a problem.
The dataset contains the correct information.
But updating the database is impossible.
I get errors like:
ORA-01861: literal does not match format string
And if I don't specify a DATE format in the TO_CHAR statement I get this error:
Concurrency violation: the UpdateCommand affected 0 records.
I think I've tried everything.
I've used the OracleGlobalization class, with the SetSessionInfo method.
I've tried all different types of date conversions to make sure that
the date format on the database is the same as in the dataset.
I've tried to change the NLS parameters on the DB server and in the registry on the client.
I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
But it still doesn't work.
The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
A strange thing is that when I instead of using the ODP classes use
the System.Data.OracleClient and its OracleCommandBuilder
the code works perfectly without any errors.
This is the test code that works:
Dim connection As System.Data.OracleClient.OracleConnection
Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
Dim dbCommand As New System.Data.OracleClient.OracleCommand()
Dim data As New DateDS()
Dim sqlstring As String
Const ConnectionString As String = "User Id=......."
Try
'Connect to database
connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
connection.Open()
'Get data from table DATETEST
dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
dbCommand.Connection = connection
adapter.SelectCommand = dbCommand
adapter.Fill(data, "DATETEST")
'Make changes to dataset
data.DATETEST(0).DATECOLUMN = Now()
data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
'Update database
sqlstring = "SELECT * FROM DATETEST"
adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
custCB.DataAdapter = adapter
adapter.Update(data, "DATETEST")
'Disconnect
connection.Close()
connection.Dispose()
Catch exc As Exception
MessageBox.Show(exc.Message)
End Try
My experience until this came up is that the ODP provider is better on everything
than the microsoft Oracle provider so I don't want to switch unless I have to.
Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
I would be the happiest man on earth if someone had a solution :-)
ErikDon't convert the dates to strings. Ever.
The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
Also in your typed dataset you should change the type from a string to a date.
David -
What's the best way to read JSON data?
Hi all;
What is the best way to read in JSON data? And is the best way to use it once read in to turn it into XML and apply XPath?
thanks - davejtahlborn wrote:
without having a better understanding of what your definition of "use it" is, this question is essentially unanswerable. Jackson is a fairly popular library for translating json to/from java objects. the json website provides a very basic library for parsing to/from xml. which one is the "best" depends on what you want to do with it.Good point. We have a reporting product ([www.windward.net|http://www.windward.net]) and we've had a number of people ask us for JSON support. But how complex the data is and what they want to pull is all over the place. The one thing that's commin is they generally want to pull down the JSON data, and then put specific items from that in the report.
XML/XPath struck me as a good way to do this for a couple of reasons. First it seems to map well to the JSON data layout. Second it provides a known query language. Third, we have a really good XPath wizard and we could then use it for JSON also.
??? - thanks - dave -
Read XML data without name spaces from PL/SQL
Hi,
I am trying to upload XML data without namespaces into Oracle tables from PL/SQL. Below is the sample XML data.
Please let me know,How this is achievable in PL/SQL?
<?xml version="1.0" ?>
<insplist ver="2" count="1">
<insp id="219991" timestamp="134817078" stat="G" operator_id="999999" >
<data name="TIME CLOCK - PUNCH" val="INNER" type="STRING" />
</insp>
</insplist>
ThanksAnd it's even simpler with the GET method as we just have to pass the url :
SQL> DECLARE
2
3 v_url varchar2(200) := 'http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=';
4 v_address varchar2(200) := '1 rue Victor Hugo Paris France';
5
6 v_req utl_http.req;
7 v_rsp utl_http.resp;
8
9
10
11 v_xml varchar2(32767);
12
13 v_lng number;
14 v_lat number;
15
16 BEGIN
17
18 v_req := utl_http.begin_request(v_url || utl_url.escape(v_address), 'GET', utl_http.HTTP_VERSION_1_1);
19 v_rsp := utl_http.get_response(v_req);
20
21 utl_http.read_text(v_rsp, v_xml);
22 utl_http.end_response(v_rsp);
23
24 select longitude, latitude
25 into v_lng, v_lat
26 from xmltable(
27 '/GeocodeResponse/result/geometry/location'
28 passing xmlparse(document v_xml)
29 columns longitude number path 'lng'
30 , latitude number path 'lat'
31 )
32 ;
33
34 dbms_output.put_line('Longitude = ' || v_lng);
35 dbms_output.put_line('Latitude = ' || v_lat);
36
37 END;
38 /
Longitude = 2.2734472
Latitude = 48.8282741
PL/SQL procedure successfully completed
Or, taking shorcuts :
SQL> select *
2 from xmltable(
3 '/GeocodeResponse/result/geometry/location'
4 passing httpuritype('http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address='
5 || utl_url.escape('1 rue Victor Hugo Paris France')
6 ).getxml()
7 columns longitude number path 'lng'
8 , latitude number path 'lat'
9 )
10 ;
LONGITUDE LATITUDE
2,2734472 48,8282741 -
Accessing data nested inside a JSON data source in Project Siena
Hi all
I'm trying to work with JSON data sources via REST in Project Siena. I can easily set up the JSON data source and get the data into my data sources list. However, the data is nested, so for example a REST request to search returns JSON data that is unpacked
(correctly) as:
search_query > entries > name
I have tried two different REST-based data sources with the same result. I have tried accessing the data a couple of ways: firstly via a Gallery view and secondly just getting a listing with a DropDown.
For this example, I've tried setting the Data items to search_query!entries (and a bunch of other things) with the idea that I could then refer to ThisItem!name and when that failed trying almost everything I could from the function reference
http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745469
Should this work? It seems like it's an extremely common structure for JSON returned from a RESTful service (top level containing count, pagination, other data and then a set of result details beneath).
Any ideas appreciated. For completeness, the two data sources I've tried are the Box.com Content API (Search and Folders) and the ZenDesk API (Groups).
Cheers.What you get back from the call is essentially a table with a single row--the "entries" column within that row have multiple rows that contain the name data. Try binding First(search_query)!entries to extract the name records.
Maybe you are looking for
-
Work order via Sub-Inventory level planning
Hello Team, We want to create work order via Sub-Inventory level planning as standard program 'min-max planning report' is nor creating WIP Jobs at sub-inventory level. Kindly guide me if this requirement is possible and if so do share your knowledge
-
Hi, I need to upload sales orders from MS-excel spread-sheets. The upload process has to take place in Production once the system is live. LSMW does not seem to be a good option here as the user is going to run this upload process after go-live. We d
-
Inserting job completion time stamp to another table
Hi - I've a requirement where i need to insert job completion timestamp to another table. I'm loading data from oracle table to Sql server table. this job is running fine. Once this is done i need to insert the completion timestamp to another Sql ser
-
EIM/WIM v4.3: Language support
Hi all, I'm trying to determine the different GUI language it supports. The list i got so far Swedish, Russian, Danish,Canadian French, Portuguese, Dutch, French, Italian, German, Spanish, and Brazilian Portuguese Any idea if GUI supports Asian langu
-
FORMS & REPORTS QUESTIONS.
Hi, Can any one provide me a good no of Forms and reports question to prepare for the interview ? Thanks in advance .