Information View Query by ODATA
Hello Guys
An Analytic view is exposed using xsodata. Is it possible to query the view from ODATA ?
Thanks,
Hi Ram,
Here is goes
/Products?$filter=Price gt 20
here if you need products with price greater than 20 then you can add $filter=<dimension> operator value.
More details on URI conventions can be accessed here
http://www.odata.org/documentation/odata-version-2-0/uri-conventions/
Best Regards,
Ranjit
Similar Messages
-
Hi Greg,
I had created a view on a table which doesn't have Primary Key, but it has Unique and Not Null constraints on required columns.
I had wrote a procedure to query the data on VIEW. I have experienced strange problem, very first call to procedure will take more time than succeeding requests. For example from second request onwards, it returns data in < 2 Sec, but first transaction is taking 12 Sec to 30 Sec.
I thought that very first time VIEW is taking time to refresh it self. So, I added FORCE keyword in CREATE VIEW stattement. However, that doesn't helped out.
In my further investigation I came to know that base table on which VIEW created, has to be loaded in to memory before querying on VIEW.
So, I had executed a simple select statement on base table, before I execute VIEW query in procedure.
With this change I got results consistently < 2 Sec all the times.
My question is instead of executing the select statement on base table is there a way to load base tables data in memory before querying on VIEW?
Thanks,
SubbaraoHi,
A view is nothing but parsed SQL statements stored in the database, a view may or may not run faster. If you execute the SQL used to define the view how much time is it taking. If you want try looking at MATERIALIZED VIEW , that may help you.
thanks -
Reg: fetch the data by using item_id which is retuned by In line View Query
Hi all,
create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
insert into xxc_transactions values(null,null,null,null);
create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
insert into xxc_items1 values(123,12,'book');
create table xxc_headers(header_id number,order_id number);
insert into xxc_headers values(null,null);
create table xxc_lines(header_id number,item_id number,line_id number);
insert into xxc_lines values(null,null,null);
create table xxc_types_tl(transaction_id number,NAME varchar2(10));
insert into xxc_types_tl values(106,'abc');
create table xxc_quantity(item_id number);
insert into xxc_quantity values (123);
create table xxc_quantity_1(item_id number);
insert into xxc_quantity_1 values (123);
SELECT union_id.item_id,
b.org_id,
e.name,
fun1(union_id.item_id) item_no
FROM xxc_transactions a,
xxc_items1 b,
xxc_headers c,
xxc_lines d,
xxc_types_tl e,
(SELECT item_id
FROM xxc_quantity
WHERE item_id = 123
UNION
SELECT item_id
FROM xxc_quantity_1
WHERE item_id = 123
UNION
SELECT item_id
FROM xxc_transactions
WHERE item_id = 123) union_id
WHERE a.type_id = 6
AND a.item_id = b.item_id
AND union_id.item_id = b.item_id
AND a.org_id = b.org_id
AND c.header_id = d.header_id
AND d.line_id = a.trx_line_id
AND d.item_id = b.item_id
AND c.order_id = e.transaction_id
AND b.org_id = 12
GROUP BY union_id.item_id,
b.org_id,
e.name
ORDER BY union_id.item_id;
create or replace function fun1(v_item in number)
return varchar2
is
v_item_no
Begin
select item_no from xxc_items1
where item_id=v_item;
return v_item_no ;
Exception
When Others Then
v_item_no := null;
return v_item_no;
END fun1;
I need fetch the data by using item_id which is retuned by In line View Query(UNION)
item_id org_id name item_no
123 12 abc book
Version: 11.1.0.7.0 and 11.2.0.1.0
Message was edited by: Rajesh123 Added test cases script
Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)Hi Master , sorry for the late reply and can you please help on this?
create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
insert into xxc_transactions values(null,null,null,null);
create table xxc_items(item_id number,org_id number,item_no varchar2(10));
insert into xxc_items values(123,12,'book');
create table xxc_headers(header_id number,order_id number);
insert into xxc_headers values(null,null);
create table xxc_lines(header_id number,item_id number,line_id number);
insert into xxc_lines values(null,null,null);
create table xxc_types_tl(transaction_id number,NAME varchar2(10));
insert into xxc_types_tl values(106,'abc');
create table xxc_uinon_table(item_id number);
insert into xxc_types_tl values(123);
SELECT union_id.item_id,
b.org_id ,
e.name ,
fun1(union_id.item_id) item_no --> to get item_no
FORM xxc_transactions a,
xxc_items b,
xxc_headers c,
xxc_lines d,
xxc_types_tl e,
( SELECT item_id
FROM xxc_uinon_table ) union_id
WHERE a.type_id= 6
AND a.item_id = b.item_id
AND union_id.item_id = b.item_id
AND a.org_id = b.org_id
AND c.header_id = d.header_id
AND d.line_id= a.trx_line_id
AND d.item_id= b.item_id
AND c.order_id= e.transaction_id ---106
AND b.org_id = 12
GROUP BY union_id.item_id,
b.org_id ,
e.name
ORDER BY union_id.item_id;
Note: xxc_uinon_table is a combination of UNION's
select 1 from dual
union
select 1 from dual
union
select no rows returned from dual;
I will get 1 from the above Query
Thank you in advanced -
Spatial vs. materialized views/query rewrite
Dear all,
we are trying to use Spatial (Locator) functionality together with performance optimization using materialized views and query rewrite, and it does not seem to work. Does anybody has experience with this?
The problem in more detail:
* There is a spatial attribut (vom Typ GEOMETRY) in our table;
* we define a materialized view on that table;
* we run a query that could be better answered using the materialized view with query rewrite;
*the optimizer does not choose the plan using the materialized view, query rewrite does not take place;
This happenes, even if neither the materialized view, nor the query contains the spatial attribut.
The explanation given by the procedure DBMS_MVIEW.Explain_Rewrite is:
"QSM-01064 query has a fixed table or view Cause: Query
rewrite is not allowed if query references any fixed tables or views"
We are using Oracle 9R2, Enterprise Edition, with locator. Nevertheless, it would also be interesting, if there is any improvement in 10g?
A more complicated task, using materialized views to optimize spatial operations (e.g., sdo_relate) would also be very interesting, as spatial joins are very expensive operations.
Thanks in advance for any comments, ideas!
Cheers,
Gergely LukacsHi Dan,
thanks for your rapid response!
A simple example is:
alter session set query_rewrite_integrity=trusted;
alter session set query_rewrite_enabled=true;
set serveroutput on;
/* Creating testtable */
CREATE TABLE TESTTABLE (
KEY1 NUMBER (4) NOT NULL,
KEY2 NUMBER (8) NOT NULL,
KEY3 NUMBER (14) NOT NULL,
NAME VARCHAR2 (255),
X NUMBER (9,2),
Y NUMBER (9,2),
ATTR1 VARCHAR2 (2),
ATTR2 VARCHAR2 (30),
ATTR3 VARCHAR2 (80),
ATTR4 NUMBER (7),
ATTR5 NUMBER (4),
ATTR6 NUMBER (5),
ATTR7 VARCHAR2 (40),
ATTR8 VARCHAR2 (40),
CONSTRAINT TESTTABLE_PK
PRIMARY KEY ( KEY1, KEY2, KEY3 ));
/* Creating materialized view */
CREATE MATERIALIZED VIEW TESTTABLE_MV
REFRESH COMPLETE
ENABLE QUERY REWRITE
AS SELECT DISTINCT ATTR7, ATTR8
FROM TESTTABLE;
/* Creating statistics, just to make sure */
execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE', cascade=>TRUE);
execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE_MV', cascade=>TRUE);
/* Explain rewrite procedure */
DECLARE
Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
querytxt VARCHAR2(1500) :=
'SELECT COUNT(*) FROM (
SELECT DISTINCT
ATTR8 FROM
TESTTABLE
i NUMBER;
BEGIN
DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
FOR i IN 1..Rewrite_Array.count
LOOP
DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
END LOOP;
END;
The message you get is:
QSM-01009 materialized view, string, matched query text
Cause: The query was rewritten using a materialized view, because query text matched the materialized view text.
Action: No action required.
i.e. query rewrite works!
/* Adding geometry column to the testtable -- not to the materialized view, and not to the query! */
ALTER TABLE TESTTABLE
ADD GEOMETRYATTR mdsys.sdo_geometry;
/* Explain rewrite procedure */
DECLARE
Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
querytxt VARCHAR2(1500) :=
'SELECT COUNT(*) FROM (
SELECT DISTINCT
ATTR8 FROM
TESTTABLE
i NUMBER;
BEGIN
DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
FOR i IN 1..Rewrite_Array.count
LOOP
DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
END LOOP;
END;
The messages you get are:
QSM-01064 query has a fixed table or view
Cause: Query rewrite is not allowed if query references any fixed tables or views.
Action: No action required.
QSM-01019 no suitable materialized view found to rewrite this query
Cause: There doesn't exist any materialized view that can be used to rewrite this query.
Action: Consider creating a new materialized view.
i.e. query rewrite does not work!
If this works, the next issue is to use materialized views for optimizing spatial operations, e.g., a spatial join. I can supply you with an example, if necessary (only makes sense, I think, after the first problem is solved).
Thanks in advance for any ideas, comments!
Cheers,
Gergely -
Creating a Hierarchy Viewer query
Hello,
I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
Please, any tips, directions or suggestions on how can I go about doing this?
Thanks!!Hi!
Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree. -
Materialized view query (Oracle 9i)
I have dropped a materialized view query and trying to create the same with additional columns in the prebuilt table.
Option - 1
when Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode fast option, the database throws an error " no table or view exists"
Option - 2
When Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode option either complete or force, it gets created.
I need to create the above materialized view query in the fast mode option, Please help.
-balaHi,
Does a table named profit_mvw already exist?
The following example illustrates the two steps required to register a user-defined table. First, the table is created, then the materialized view is defined using exactly the same name as the table. This materialized view sum_sales_tab is eligible for use in query rewrite.
CREATE TABLE sum_sales_tab
PCTFREE 0 TABLESPACE demo
STORAGE (INITIAL 16k NEXT 16k PCTINCREASE 0) AS
SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
SUM(quantity_sold) AS unit_sales
FROM sales s GROUP BY s.prod_id;
CREATE MATERIALIZED VIEW sum_sales_tab
ON PREBUILT TABLE WITHOUT REDUCED PRECISION
ENABLE QUERY REWRITE AS
SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
SUM(quantity_sold) AS unit_sales
FROM sales s GROUP BY s.prod_id;
Regards,
Simon -
ORA-01762: vopdrv: view query block not in FROM ????
Hi All
any one aware of the error.
ORA-01762: vopdrv: view query block not in FROM
Please reply back.ORA-01762:vopdrv: view query block not in FROM
Cause:This is an internal error message not normally issued.
Action:Contact Oracle Support Services.
Edited by: Karthick_Arp on Sep 23, 2008 11:01 PM -
Declaratively set the value of a bind parameter in a view query
Can I declaratively set that I want the value of the bind parameter in the view query to be the value of a specific field in the current row of a specific iterator in my data bindings? Thanks :D
user11976105 wrote:
Hm I guess I should mention I'm doing the retrieval in Java, using a ValueChangeListenerIn this case, you will still need to bind an ExecuteWithParams action to your page definition and execute it from your ValueChangeListener after supplying its named data.
In the code spinet, the new value from the ValueChangeEvent is passed to the bind variable.
public void yourValidChangeListener(ValueChangeEvent valueChangeEvent) {
// get the ExecuteWithParameters operation binding from the bindings
OperationBinding executeWithParameters = ADFUtils.findOperation("yourExecuteWithParametersBindingId");
// setup bind variable using the new value from the valueChangeEvent
executeWithParameters.getParamsMap().put("yourParameterId", valueChangeEvent.getNewValue());
// execute
executeWithParameters.execute();
// check for errors
if(executeWithParameters.getErrors().size() != 0) {
// error(s) occured
} -
Query a Odata feed on UI update in Excel
I have an Odata service which has a function named Foo() which returns me data after doing operations and also have another function foo2() which returns a different set of data.
now i have a drop down list in excel and on selecting value one it should query the odata feed to return the dataset from foo() and on selecting the second it should return the dataset from foo2()
How do i do this. any help would be much appreciatedHi,
I think you will need to use VBA code to achieve it. As I'm not quite know how to call the Odata service function within Excel, you need to modify the VBA code.
Anyway, if the drop down list was created by using data validation, and located in Range A1, then you can try the VBA code below:
Private Sub worksheet_change(ByVal target As Range)
If target.Address = "$A$1" Then
If Range("A1") = 1 Then
Foo() 'call function Foo (need change)
Else
Foo2() 'call function Foo2
End If
End If
End Sub
Wind Zhang
TechNet Community Support -
Hi,
I m tring to use the DART tool for extract tax data;
We extact the tax data from 2 separately system SAP ECC6 (S1 et S2) with DART
My question is :
It is possible to use a extract file generate by S1 for executing view query in S2 system with the (FTWH) transaction
Thank you for your helpHi,
i m answer my self about this question
it is possible to use a extraction file generated by S2 system in S1 system to query directely this file and we can also to use this file by view query transaction
The only restriction is to use the same technical configuration for the both systems FTWP (technicals options)
bye
Mohamed -
Hi
Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
We dint find any clue when searched in net.
Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
Below are the steps we're executing
EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
dml_table_name => 'EMP',
err_log_table_name => 'ERR_EMP'
> DESC EMP
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
UPDATE EMP set SAL='@'
where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
Could someone help us?Hi
Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
We dint find any clue when searched in net.
Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
Below are the steps we're executing
EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
dml_table_name => 'EMP',
err_log_table_name => 'ERR_EMP'
> DESC EMP
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
UPDATE EMP set SAL='@'
where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
Could someone help us? -
Connecting grid to view\query
I need some tutorial sample project explaining how to connect a grid to view\query from a DB. I failed to google it - any links?
The grid is called JTable.
[JTable tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
You can find examples and similar questions in the [JDBC forum|http://forums.sun.com/forum.jspa?forumID=48].
There's also a link to the [JDBC FAQ|http://java.sun.com/products/jdbc/faq.html]. -
DART: Generate program for data view query:RTXWGQ01
Hi all,
We've this program RTXWGQ01 which is generating programs for data view queries.
I'd like to know what is this data view which is there on the selection screen of this program?
Can we define Z data views, if so how? If we directly run this program in production for a data view does it automatically generate an executable program?
Is there any transaction which runs this program in background?
Regards
Deepthi.Hi,
i m answer my self about this question
it is possible to use a extraction file generated by S2 system in S1 system to query directely this file and we can also to use this file by view query transaction
The only restriction is to use the same technical configuration for the both systems FTWP (technicals options)
bye
Mohamed -
Information view wizard problem
Hi all,
I was trying for hours to obtain a solution for this ... Problem? with no success.
let me explain the situation.
When trying to use hana studio, in order to create a information view, for example Calculated view, I cannot see all the options like this video shows:
HANA Academy -- Attribute, Analytic and Calculation Views example - YouTube
I cannot see the next button and select the tables to create a calculation view. actually in the first instance this shouldn't be a problem because I could add aggregations objects and projections and got the schema that I need, but is imposible to avoid the wizard's suggested schema.
what should I need to do in order to get that interface?
my system is HANA SP6
thanks in advance.Hi,
The video you are refering for creation of calculation view is not applicable for HANA SP6 version and onwards. This flow is applicable only for HANA SP5 and below versions.
Please refer the video link below for creation of calculation view for HANA SP6 and onwards.
SAP HANA Academy - SDA: Creating Calculation View on remote data sources - YouTube
(At time 11:34)
Hope it helps.
Regards,
Rashmi -
previus information... jdeveloper 10.1.3.0.4, the application is java swing adf bc .
hi, i have a bc view (sql only) inside an application module, how could i assign the results of view's query with an array of objects.Not sure if this is on target, but if you are using ADF BC the view object's query results are already in an array of objects. Reference the following document to view how the results are structured. You can programmatically then work with the results set using the ViewObject, RowSet, and RowSetIterator Interfaces. See the SRDemo Application Module services for some examples of this in action (demo is in JSF though, not Swing.)
http://www.oracle.com/technology/products/jdev/tips/muench/mostcommon/index.html
thanks
Maybe you are looking for
-
I'm trying to move all music I purchashed to new pc from old pc. I've downloaded the new Itunes. When I try to open and get a full screen of my account / i tunes store, it doesn't work. Just a little picture box with my music that I have...it won't p
-
Is it possible to access my calendar while on a phone call on my Verizon iPhone?
When I'm on a phone call on my Verizon iPhone 4, it doesn't appear that I can leave the phone screen to view, for example, my calendar. Is there a way to access my calendar while on a phone call? Thanks in advance for your time and responses.
-
I have forgotten my security questions. I can't call the apple people becuase my phone line is down for a while. If you anyone could have a way to reset it becuase I really want to buy stuff.
-
Is there a way to use C to add comments to existing SWF?
I know I can import a swf, but if I try to preview it, I can't see what frame it stopped on in order to put my comment/highlight boxes in. Is there another way?
-
Reporting through Enterprise Portals
Please search the forums before posting Dear All, Can you please help me out with some info regarding "Reporting through Enterprise Portals in BI". Regards Karun Edited by: Arun Varadarajan on Jan 18, 2009 8:25 AM