Problem in using relational operators in Data Templates
Hi All,
I have a query like following in data template type of Data set but I am not getting any data if I use simple < operator. Same query shows data in the database. Is there any other specific way of using relational operators in Data templates ? Please help in this regard
<dataTemplate name="REVIEW_DATE" dataSourceRef="MY_DB">
<dataQuery>
<sqlStatement name="REVIEW_DATE">
<![CDATA[
SELECT
TABLE1.REVIEW_DATE
FROM TABLE1 TABLE1 , TABLE2 TABLE2
WHERE
TABLE1.COLUMN1 = TABLE2.COLUMN2
AND TABLE1.REVIEW_DATE < TABLE2.CURRENT_DATE]]></sqlStatement>
</dataQuery>
<dataStructure>
<group name="REVIEW_DATE" source="REVIEW_DATE">
<element name="REVIEW_DATE" value="REVIEW_DATE"/>
</group>
</dataStructure>
</dataTemplate>Thanks a lot !
-Sookie
solved after watching www.youtube.com/watch?v=FCujba8euWc
thanks to all
Similar Messages
-
Problem Using Relational Operators !!
The code given under is not working corretly. The problem is stated as comments in the program.
if(result.next())
String temp_no=t_no.getText();
String temp_nm=t_name.getText();
String temp_result1= result.getString(2);
String temp_result2= result.getString(3);
if(temp_no!=temp_result1) // The condition is always true.Even if i give the same no & name as in database!! Why is it so?
JOptionPane.showMessageDialog(cdFrame, new String("There Is No Disc With The Specified Number !!"));
else
if(temp_nm!=temp_result2)
JOptionPane.showMessageDialog(cdFrame, new String("There Is No Disc With The Specified Name !!"));
else
upd.executeUpdate();
JOptionPane.showMessageDialog(cdFrame, new String("DATA HAS BEEN UPDATED !!"));
else
JOptionPane.showMessageDialog(cdFrame, new String("There Is No Such Disc As Stated In Old Data !!"));
} The Program compiles properly and gives no runtime error. What's the problem!!yes dude, u can't use relational operators for objects.. its works only on simple data types..
-
Issues with using Outer join in Data Template
Hi all,
this is my data in two tables .
Table Ronny1
colA colB
1 u
2 v
3 x
Table Ronny2
colC colD
1 q
2 r
This is my data template
<dataTemplate name="MGF" dataSourceRef="Source1">
<dataQuery>
<sqlStatement name="Q1" dataSourceRef="Source1">
<![CDATA[select C, D from Ronny2]]>
</sqlStatement>
<sqlStatement name="Q2" dataSourceRef="Source2">
<![CDATA[select A , B from lokesh1 where A = :C]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G1" source="Q1">
<group name="G2" source="Q2">
<element name="A" value="A"/>
<element name="B" value="B"/>
</group>
</group>
</dataStructure>
</dataTemplate>
Now this would give me result as
A B
1 u
2 v
however my requirement is this
A B
1 u
2 v
3 x
that is, i want to display all the rows of table Ronny1 and matching rows from table Ronny2. I tried modifiying my second sql as
<![CDATA[select A , B from lokesh1 where A = :C (+)]]> ( using a outer join)
but this does give me correct data and comes back with the cartesion product.
Can anyone please answer this for me that how can we use the outer join in data templaes.
Thanks
Ronnyhey vetsrini,
sorry for the confusion here,
actually i want to display all the rows from table Ronny1 and i am also pulling in the matching rows from table Ronny2 and my data structure looks as ( pulling in column D from table Ronny2)
<dataStructure>
<group name="G1" source="Q1">
<group name="G2" source="Q2">
<element name="A" value="A"/>
<element name="B" value="B"/>
<element name="D" value="D"/>
</group>
</group>
</dataStructure>
and this is what i want the output to be
A B D
1 u q
2 v r
3 x
Hence the row where A <> C the data in the D column will be null, same as in the case of outer join.
any suggestions
Thx
Ronny -
Using Variable in the Data Template
Hi All,
I am on BIP 10.1.3.4.1 and DB is SQL Server. My Data Model is a Data Template wherein I have written multiple SQL Statements. I want to use a variable in my Data Template, assign it a value and use that variable to limit one of the SQL statements in the where clause like
declare @cnt int;
set @cnt = select count(asset_id) from asset
How do I use in the data template. I tried using it in a separate SQL statement but it throws me an error when i run the report like
"Need to declare the scalar variable '@cnt'
Can we have a variable section like parameter section we have in the data template to declare the parameters?
Any help would be highly appreciated.
Thanks,
RonnySorry for the shot follow up, can anybody please reply on this?
-
How to use Report Parameter on Data Template
Hello All ,
I 've tried to create a Report using Data template and Report Parameter. I create a report using data template and I also created a parameter (P_company_name).
Data Template :
<dataTemplate name="test_Data_template" description="test" dataSourceRef="test">
<parameters>
<parameter name="company_name" dataType="character" include_in_output="false" defaultValue= *** HOW TO DEFINE THE REPORT PARAMETER (P_Company_name) HERE ** />
</parameters>
<dataQuery><sqlStatement name="Q1"> <![CDATA[SELECT customer_no,Company_name, from customers where acquisition_id = :company_name ]]>
</sqlStatement>
Report Parameter
Identifier : P_Company_name
Data Type : String
Default Value : Test
Parameter Type : Text
When the endusers run the Report they will provide the Company name through the report parameter.
I have tried to use the same approach that I used to pass the Parameter to SqlQuery on data Template but it is not working . XML Publisher cannot define the parameter.
How can I do that ?
If you have any suggestion or document I will really appreciate.
Thanks,
Robsonuse this <parameter name="P_Company_name" dataType="character" include_in_output="false" defaultValue= 'Test Value' />and in the querySELECT customer_no,Company_name, from customers where acquisition_id = :P_Company_namehttp://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T434255.htm
Just keep the parameter name in datatemplate and the definition same. -
Use the XML with data template
Hi,
I want to use double sql query with data template.
How can I do ??
Thanks...it's okey, I had use a rtf file insead and search/replace my keywords using the String.replaceAll(String, String) function...
-
Problem when using MS Access as data source
I want to get the source data from MS Access Database and load the data into a Oracle Database by OWB.
I created a ODBC for the Access Database,and added the correlative informations in the files such as hs/admin/initmsaces.ora��network/admin/listener.ora��network/admin/tnsname.ora.
Then I created a new module under the "DataBase->Other->ODBC" in OWB,the schema I selected is "Undefine"��it is the only one selection��Then I created some mappings.All these steps are successful.
But when I was deploying the project,OWB reported a wrong: Talbe or View is not exist.
I want to know how can I resolve the problem.
Thanks!I think we are having the same problem and (I think) set up everything as described in the note.
We are using an ODBC connection to an MS-Access database with OWB 9.2. We have successfully defined the data source to OWB, and imported 2 target tables, then mapped one of the tables to a staging table.
The mapping process validates correctly. From Deployment Manager, we register the source file location, which asks for a schema owner, username, and
password. We supply the value admin for each of these as Location Registration windows requires a value for each [no blanks allowed] and the registration is successful.
However, when we Generate/Deploy the mapping, the Generate succeeds, but deployment fails with the error PL/SQL: ORA-00942: table or view does not exist. Looking at the generated code, we see that the SELECT statement in the generated mapping code specifies the source table as owner.table_name@db_link.
From SQL*Plus, the table_name@db_link can be described correctly. Trying to describe owner.table_name@db_link fails with object does not exist error, which is similar to the OWB table does not exist error.
MS-Access has no concept of schema-owner. Is there a way to generate the Mapping without specifying the schema-owner ??. -
Data link problem between two queries in BIP data template
never mind. I solved.
Edited by: user5131789 on Mar 7, 2012 11:17 AMnever mind. I solved.
Edited by: user5131789 on Mar 7, 2012 11:17 AM -
Data Template using Multiple XML's
I have a requirement to create a data template with data from multiple XML files and this is dynamic based on user selection.
Here is an example
Data Hirerachy
|-PO Header (POHeader.xml)
|-----PO Line (POLine.xml)
|-----PO Receipts (POreciepts.xml)
Now use can choose to print all children or selectively one child . I can do it by creating 3 data templates and then using the appropriate one based on user selection. I am exploring the possibility to use one single dynamic data template created on the fly and passed to the publisher.
Appreciate any pointer to achieve this
Message was edited by:
skarimisHey
I think I answered this on the internal forum
Tim -
Hi,
I am using a data template plus CP combination to generate XMLP reports. From CP i am passing a standard date parameter to the data template. The issue is that there seems to be a problem accesing this variable in the data template SQL where conditions.
for ex:-
The value that CP passes => "2007-05-11 00:00:00.0"
In data template the parameter is like <parameter name="endDate" dataType="date"/>
The where condition is like h.end_date <= nvl(:endDate,h.end_date)
Here :endDate is always null. Interestingly in the XML output the date value is displayed properly for the parameter endDate like <endDate>2007-05-11 00:00:00.0</endDate>
What is the issue here. Pls. suggest on how to handle dates.
Thanks,
Suresh.Hi,
I am using a data template plus CP combination to generate XMLP reports. From CP i am passing a standard date parameter to the data template. The issue is that there seems to be a problem accesing this variable in the data template SQL where conditions.
for ex:-
The value that CP passes => "2007-05-11 00:00:00.0"
In data template the parameter is like <parameter name="endDate" dataType="date"/>
The where condition is like h.end_date <= nvl(:endDate,h.end_date)
Here :endDate is always null. Interestingly in the XML output the date value is displayed properly for the parameter endDate like <endDate>2007-05-11 00:00:00.0</endDate>
What is the issue here. Pls. suggest on how to handle dates.
Thanks,
Suresh. -
How to use relational operator in JSF EL
Hi,
I am trying to set the insert allowed property for the subtab based if the no.of records in the sub tab is less than 2. So i tried the following expressions in the insert allowed property
1. #{bindings.OvrBrowseTypesIterator.estimatedRowCount < 2} which leads to compilation errors - no start tag found etc..
2. #{bindings.OvrBrowseTypesIterator.estimatedRowCount ls 2} which leads to runtime error - encountered "ls" at line 1 col 1752 when expecting one of the following "(" , "<" , ">" etc....
Please advise if any one has used relational operators in the EL.
Thanks, PradeepI found the mistake. I should use "lt" instead of "ls" for less than.
#{bindings.OvrBrowseTypesIterator.estimatedRowCount lt 2} works fine. -
Can I use comparison operators like <,> etc. in case? I was trying to run the following query but its not working
SELECT ENAME,
CASE SAL
WHEN SAL>4000 THEN 500
END FROM EMP;
Can any one please help me?
Thanks in advanceTwo types of case statements you can write.
1. Simple case
2. Searched case
refer the link..
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm
simple case
PRAZY@11gR2> select ename, case job when 'CLERK' then
2 'Job is CLERK'
3 else
4 'Not a CLERK'
5 end Job_Desc
6 from emp;
ENAME JOB_DESC
SMITH Job is CLERK
ALLEN Not a CLERK
WARD Not a CLERK
JONES Not a CLERK
MARTIN Not a CLERK
BLAKE Not a CLERK
CLARK Not a CLERK
SCOTT Not a CLERK
KING Not a CLERK
TURNER Not a CLERK
ADAMS Job is CLERK
JAMES Job is CLERK
FORD Not a CLERK
MILLER Job is CLERK
14 rows selected.
Elapsed: 00:00:00.00Searched case
PRAZY@11gR2> select ename, case when job = 'CLERK' then
2 'Job is CLERK'
3 else
4 'Not a CLERK'
5 end Job_Desc
6 from emp;
ENAME JOB_DESC
SMITH Job is CLERK
ALLEN Not a CLERK
WARD Not a CLERK
JONES Not a CLERK
MARTIN Not a CLERK
BLAKE Not a CLERK
CLARK Not a CLERK
SCOTT Not a CLERK
KING Not a CLERK
TURNER Not a CLERK
ADAMS Job is CLERK
JAMES Job is CLERK
FORD Not a CLERK
MILLER Job is CLERK
14 rows selected.
Elapsed: 00:00:00.06In searched case you can have different search conditions in each when clause and you can use relational operators.
HTH,
Prazy -
Reports Sugestion - Data Template Support for Downloadable PDF Reports.
This is something that I miss in APEX reports that I would like to see. Right now I have BI Publisher tied to my APEX install but there are reports I would like to move over but I hate the fact that APEX does not have the ability to use BI Publisher XML Data Templates! It seems like if you have the integration this would be a natural thing to have so you could use complex report and APEX security (as I found a few issues in BI Publisher that are deal killers for running a few of my newer reports directly on BIP). Most of my reports are too complex and would require extensive XPath coding to setup using RTF templates. This just seems like something that would be very useful in APEX.
David:
I should have a whitepaper on this subject by the end of the month.
http://jastraub.blogspot.com/2008/12/more-changes-to-flexwsapi.html
I know this doesn't help you right now so I will describe how it works. Create a Manual Web reference as described on Tyler's blog, except for the SOAP Envelope, using something like:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<pub:runReport soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<reportRequest xsi:type="pub:ReportRequest">
<attributeFormat xsi:type="xsd:string">#P2_FORMAT#</attributeFormat>
<parameterNameValues xsi:type="pub:ArrayOfParamNameValue" soapenc:arrayType="pub:ParamNameValue[]"/>
<reportAbsolutePath xsi:type="xsd:string">#P2_ABS_PATH#</reportAbsolutePath>
</reportRequest>
<userID xsi:type="xsd:string">#APP_USER#</userID>
<password xsi:type="xsd:string">#P101_PASSWORD#</password>
</pub:runReport>
</soapenv:Body>
</soapenv:Envelope>
You can hardcode format to pdf if that is all you wish to download. You can also hardcode the userID parameter, reportAbsolutePath, and the password parameter if you wish. Use something like DOWNLOAD_DOCUMENT as the collection name.
Now create a page and create a before header process of type Web service that invokes this reference. The document's binary data will be stored in a node of an XML document in the collection encoded in base64 format. You will need another process that converts that to a BLOB and then presents a dialog to the browser to save the document. You can accomplish with a process like the following, after the call to the Web service:
declare
l_mime varchar2(48);
l_name varchar2(4000);
l_base64 clob;
l_blob blob;
l_size number;
l_xml xmltype;
l_ns varchar2(4000) default null;
l_path varchar(255) default '//multiRef';
begin
l_mime := flex_ws_api.parse_response('DOWNLOAD_DOCUMENT',l_path||'/reportContentType/text()',l_ns);
l_name := 'test.pdf';
l_base64 := flex_ws_api.parse_response_clob('DOWNLOAD_DOCUMENT',l_path||'/reportBytes/text()',l_ns);
l_blob := flex_ws_api.clobbase642blob(l_base64);
l_size := dbms_lob.getlength(l_blob);
htp.init;
owa_util.mime_header( nvl(l_mime,'application/octet'), FALSE );
htp.p('Content-length: '||l_size);
htp.p('Content-Disposition: attachment; filename="'||replace(replace(l_name,chr(10),null),chr(13),null)||'"');
owa_util.http_header_close;
wpg_docload.download_file( l_blob );
apex_application.g_unrecoverable_error := true;
end;
I hope that helps. Stay tuned for the white paper and sample application.
Regards,
Jason -
Using less than or equal and greater or equal relational operators in BIP
Hi,
I have a query wherein I am using a relational operator '<=' and '>='. When I run my sql query in TOAD in works fine but when I put it in BIP using a Data Template, it says "Data Template XML is invalid". When I try to remove the '<' and the '>' signs the query is working but of course the output is incorrect.
My question is, what's the syntax in BIP Data Template for operators '<=' and '>='.
Will really appreciate anyone's help.
Thanks :)
AnnYeah this was the first thing I tried when I began to suspect my soundcard was causing the freezing and screeching while playing MTW 2 but as you can see here, I managed to get my card on it's own IRQ but the problem persists as ever.
[img"]http://img82.imageshack.us/img82/8908/wl6.gif[/img]
Truly extrordinary. -
Is it possible to use an XML Data Template to create a report in APEX?
Hi,
I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
Francisco
===========================
Below is a simple data template definition:
<dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
<parameters>
<parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
</parameters>
<dataQuery>
<sqlStatement name="header_query">
<![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
</sqlStatement>
<sqlStatement name="detail_query">
<![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="F_COTIZACIONES" source="header_query">
<element name="ID_COTIZACION" value="ID_COTIZACION"/>
<element name="ID_CLIPRO" value="ID_CLIPRO"/>
<element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
<group name="F_DETALLE_COTIZACIONES" source="detail_query">
<element name="PARTIDA" value="PARTIDA"/>
<element name="CANTIDAD" value="CANTIDAD"/>
<element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
</group>
</group>
</dataStructure>
</dataTemplate>Hi,
I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
Now this older entry is BUMPED maybe we find a solution for our problem this way.
regards,
Steven
Maybe you are looking for
-
Since applying the December 2014 Cumulative Update for SharePoint Server 2010, the Address Book in all of our InfoPath forms will not populate the People Picker field in Chrome, Firefox, or Safari--it only works in Internet Explorer. People can still
-
I'm using Sun Ultra 5/10. I'm trying to add new 250 Gb IDE hard disk. But all I can do is format 127Gb. So, I realized there is LBA limitation. Is it possible to break this threshold?
-
Downloaded Epsom printer app need help to set printer up on iPad 3
Need help to set up Epsom printer to ipad3 downloaded Epsom app can find the printer but don't know where to set up
-
I am having trouble opening iphoto. it just says "iphoto cannot be open because of problem" ...I've reinstaled it and nothing. I have also tried repairing it using the disk utility and it still dont work. This is what it says: Process: iPhoto
-
JNDI name tab not present in J2EE RI ,Deploy tool
I have dowlaoded the J2EE server RI.i have created new applications using the deploytool, but was unable to find the JNDI name Tab as per the tutorials. Can any one help me in figuring out the problem.Let me know what might be wrong with the "deployt