How to apply two conditions in Suppress in Section Expert
Hi,
I need your help in applying to conditions in the Details section for the suppress in the Section Expert. My Report looks like:
Details A: {@SUM -DR} {@SUM -CR} {@SUM -Balance} {@TT-CLASS}
Details B: {Deal_No} {Image_No} {Amount} {@Comments}
Currently, I am applying a condition to suppress both Details A and Details B in the section expert:
{@TT-CLASS}="OB"
Now while running the report, I got some duplicated deals ex:
123 1 1000 Reversal
123 1 1000 Reversal
124 2 2000 Approved
So I applied a condition in the section expert for the details A and B which is:
({Deal_No} = next({Deal_No} ) and {Image_No} =next( {Image_No} ) )
or
{@TT-CLASS}="OB"
And it is still giving me the duplicated deals when I am running the report. So can you please help.
Thanks
Duplicates are usually caused by an incorrect Join.
What is the datasource of the report - tables/views, stored procedures, sql query?
If you're reporting against tables/views, see if checking the 'select distinct records' option under the 'Database' menu helps.
-Abhilash
Similar Messages
-
How to set two Conditions Simultaneously in set where clause
Hi,
I have a messgechoice item , and i need to fire messagechoice VO with two conditions.
For Eg:-- we have three Items ProjectContractor& Work Order on a custom Page , now i need work order list should populate on lelection of project & contractor both, so i have apply a fire partial event on contractor where i i get the parameter values as follows:--
CO Code
if("OrderNoself".equals(event))
String value21 = (String)pageContext.getParameter("ProjectName");
System.out.println("The Selected Project Name for self Contractor is "+value21);
String value22 = (String)pageContext.getParameter("ContractorName");
System.out.println("The SelectedContractor Name for ContractorName is "+value22);
Serializable [] params11 = {value21,value22} ;
am.invokeMethod("initWorkOrderNumberself",params11);
AM Code
public void initWorkOrderNumberself(String ProjectName,String ContractorName");
getDprWorkOrderpopVO1().setWhereClause("PROJECT_NAME = " + "'"+ProjectName+"'");
getDprWorkOrderpopVO1().setWhereClause("CONTRACTOR_NAME = " + "'"+ContractorName+"'");
getDprWorkOrderpopVO1().executeQuery();
Now when i run my form then Work order list only populateon set conditions ofContractor NAme only.
Please suggest....Hi Tarun,
Thanx for ur reply,
i have used below mwntioned code provided by you but still i m getting error...
public void initWorkOrderNumber(String ProjectName,String ContractorName)
//getDprWorkOrderpopVO1().setWhereClause("CONTRACTOR_NAME = " + "'"+ContractorName+"'");
//getDprWorkOrderpopVO1().executeQuery();
getDprWorkOrderpopVO1().setWhereClause("PROJECT_NAME =:1 AND CONTRACTOR_NAME=:2");
getDprWorkOrderpopVO1().setWhereClauseParams(null);
getDprWorkOrderpopVO1().setWhereClauseParam(1,ProjectName);
getDprWorkOrderpopVO1().setWhereClauseParam(2,ContractorName);
getDprWorkOrderpopVO1().executeQuery();
ERROR:---
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (select * from omaxe_work_order_headers
where work_order_number is not null) QRSLT WHERE (PROJECT_NAME =:1 AND CONTRACTOR_NAME=:2)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
at omaxe.oracle.apps.xxopa.boqmain.webui.OmaxeDPRCO.processFormRequest(OmaxeDPRCO.java:107)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.sql.SQLException: ORA-01006: bind variable does not exist
Regards
Saurabh -
How to combine two conditions : Exists and Item not null ?
Hello !
I have a flash chart region that I would like to display only if two conditions are both true.
The first condition is this one :
Exists (SQL query returns at least one row) :
select 1
from observatoire.fiche aa, observatoire.activite_faite bb
where aa.fiche_id = bb.fiche_id
and bb.fiche_id = aa.fiche_id
AND bb.activites_id = TO_NUMBER(:P23_ACTIVITES_ID)
AND TRUNC(aa.date_activite, 'YYYY') = TRUNC(TO_DATE(:P23_ANNEE, 'YYYY'), 'YYYY')And the second condition would be :
Item not null :
P23_ACTIVITES_IDHow to combine these two conditions into one display condition ?
Thank you .
ChristianHello,
The issue is that you're doing -
TO_NUMBER(:P23_ACTIVITES_ID)When you leave the Null return value blank like that, you'll typically see '%null%' used in session state (i.e. it's not actually null). Obviously '%null%' can't be converted to a number, hence the error you're seeing.
A simple solution would be to make your null return value -1 or some other value that is guaranteed not to be a valid id (and alternative is to convert the %null% to a real null via an App/Page process etc (if you search this forum you'll find a few examples on how to do that). Another alternative is to use a DECODE to detect the '%null%' etc.
Hope this helps,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
How to put two conditions (rendered) in a panelGrid
I have two conditions to renderize a panelGrid, how I declare that? I tried to put two rendered but it didn't work. I tried a lot of things, nothing worked.
Here is one of the codes I tried:
<h:panelGrid styleClass="boxForm" columns="1"
rendered = "#{!DHCPMainBean.newParameterDhcp} "
rendered = "#{DHCPMainBean.newGroup}">Your code throwed the following error:
javax.servlet.ServletException: ServletException in '/network/dhcpMain.jsp': java.lang.String
I tried another forms like this:
<h:panelGrid styleClass="boxForm" columns="1"
rendered= "#{!DHCPMainBean.newParameterDhcp && DHCPMainBean.newGroup} ">throwed this error:
javax.servlet.ServletException: ServletException in '/network/dhcpMain.jsp': /network/dhcpMain.jsp(135,46) The entity name must immediately follow the '&' in the entity reference.
I tried this other:
<h:panelGrid styleClass="boxForm" columns="1"
rendered=
"#{!DHCPMainBean.newParameterDhcp&DHCPMainBean.newGroup;}">But, it didn't work either:
javax.servlet.ServletException: ServletException in '/network/dhcpMain.jsp': /network/dhcpMain.jsp(136,57) The entity "DHCPMainBean.newGroup" was referenced, but not declared. -
How to apply Filter condition for a specific column but not to the report?
Hi,
I am having a issue in applying a filter condition to one of the column.
I have a schema with one fact table and around 10 dimension tables. My requirement is to bring a count on the fact table with related to some other columns from the dimension tables.
Lets consider a scenario with tables like Sales (Fact), Region (Dimension), Year(Dimension), Sale Type (Dimension).
Now my requirement is to bring out the fields
City(Region) --City
Year -- Year
Sales Count(Sales table) ---Count of all sales from the fact table
Sales Count(Sales table) -- Count of all sales from the fact table where sales type is 'CASH'
Here my issue is how do I apply the filter condition of Sales Type='CASH' only on one of the Sales Count column which is from the fact table. I want the filter condition to be imposed only for the fourth column.
Can anyone let me know how to achieve this?
ThanksThis is quite simpe. Edit the column formula for the 4th column and put something like this. I am doing this from memory so the syntax might need checking:
Case When "Dimension Table"."Sales Type"='CASH' Then "Fact Table"."Measure" Else Null End
You could also consider making this a permanent addition to your RPD if this measure will be used again and again. You would add a new logical column and use the expression builder to arrive at the same result. -
How to put Two condition at once
Dear all
I am combining two file here for the calculation, but the proble is that i have given a condition when colulm 4 of file-1 and column -2 of file are same then make calculation,,
But i want put a condition when column 4 of file -1 is identical with column 2 of file-2, and column 3 of file-1 is identical with colum -3 of file2 then make calculation,
here i ahve attache my programme and files
Thanks and regards
Prince
Attachments:
test fiel-1.txt 99 KB
test-2.txt 2 KB
test.vi 29 KBSimply use an "AND" node:
Regards,
Even
Certified LabVIEW Associate Developer
Automated Test Developer
Topro AS
Norway -
How to apply Date condition for each month in 12 month period to my SQL query
I am trying to retrieve all Outstanding Problem tickets in my Trendline SSRS report.
I need to pull the OpenDate <= Last day of last month And CloseDate >= 1st day of current month
for each month in the Last 12 months. How do I accomplish this in my query?
I must also need to pull the oustanding tickets for the next 11 months in the same query
where it will automatically pull the outstanding tickets for when a new month comes
in out of the 12 month period?
Here's a sample of my query to pull July 2013 Outstanding Problem tickets:
Select OpenDate, CloseDate, Ref_Num, Type, status
From Call_Req
Where OpenDate <= '2013-07-31 00:00:00' And CloseDate >= '2013-08-01 00:00:00'
And Type = 'P'
My Results:
OpenDate
CloseDate
Ref_Num
Type
status
6/13/2013 7:41
8/26/2013 12:41
P1726456FY13
P
CL
6/13/2013 8:17
8/23/2013 12:31
P1726612FY13
P
CL
6/13/2013 10:17
9/6/2013 16:54
P1727352FY13
P
CL
7/12/2013 10:46
9/6/2013 10:23
P1812568FY13
P
CL
7/18/2013 10:17
9/6/2013 8:53
P1830452FY13
P
CL
7/29/2013 15:54
9/6/2013 16:16
P1862906FY13
P
CL
5/17/2013 20:51
8/22/2013 9:09
P1653380FY13
P
CL
5/30/2013 13:29
8/26/2013 7:33
P1685693FY13
P
CL
7/15/2013 14:14
9/7/2013 9:42
P1818874FY13
P
CL
6/7/2013 15:49
9/6/2013 16:46
P1712265FY13
P
CL
7/18/2013 10:25
9/7/2013 9:18
P1830516FY13
P
CL
7/24/2013 16:30
8/12/2013 18:26
P1849909FY13
P
CL
Talitha DavisWould this Work?
DECLARE @now DATE = GETDATE();
WITH months(lvl, daydate)
AS (
SELECT
1,
@now
UNION ALL
SELECT
lvl + 1,
DATEADD(MONTH, -1, daydate)
FROM months
WHERE lvl < 12
), dateranges(period, opendate, closedate)
AS (
SELECT
CAST(YEAR(daydate) AS CHAR(4))
+ '-'
+ RIGHT('0' + CAST(MONTH(daydate) AS varCHAR(2)), 2),
DATEADD(DAY, 0-DAY(daydate), daydate),
DATEADD(DAY, 1-DAY(daydate), daydate)
FROM months
SELECT
b.period,
a.OpenDate,
a.CloseDate,
a.Ref_Num,
a.Type,
a.status
From Call_Req a
INNER JOIN dateranges b
ON
a.OpenDate <= b.opendate
AND
a.CloseDate >= b.closedate
WHERE Type = 'P';
Microsoft Certified Trainer & MVP on SQL Server
Please "Propose as Answer" if you got an answer on your question, and vote for it as helpful to help other user's find a solution on a similar question quicker. -
This script how to ensure two conditions
page number pairs and object style how do you spell
var d = app.activeDocument;
for(i = 0; i < d.pages.length; +2) {
p = d.pages.item(i);
if(p && p.isValid) {
pi = p.pageItems;
for(k = 0; k < pi.length; ++k) {
it = pi[k];
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "(.+?) - (\\d+)";
found = app.activeDocument.findGrep (true);
for (j = 0; j < found.length; j++)
found[j].select();
if(i % 2 == 0)
//if(i % 2 == 0 && found[j].parentTextFrames[0].appliedObjectStyle.name == "AA1")
if(found[j].parentTextFrames[0].appliedObjectStyle.name == "AA1")
found[j].texts[0].select();
//found[j].texts[0].appliedParagraphStyle = "myParaStyle";
app.changeGrepPreferences.changeTo = "$2 / $1";
app.selection[0].changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;Try this,
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "(.+?) - (\\d+)";
found = app.activeDocument.findGrep (true);
for (j = 0; j < found.length; j++)
found[j].select();
if(found[j].parentTextFrames[0].parentPage.name % 2 == 0 && found[j].parentTextFrames[0].appliedObjectStyle.name == "AA1")
found[j].texts[0].select();
app.changeGrepPreferences.changeTo = "$2 / $1";
app.selection[0].changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
Vandy -
How to check two conditions while loading to target
Hi All,
I am New to ODI could you please help me in solving this issue.
Actually I scenario is
I am loading from DB2/As400 to oracle
I have so many itemsno's in source table, and I have to check
if count(itemno)>1 and uom='CS' then UOM_flag = 'N' else 'Y'Hi,
Welcome to ODI world! lol
At the column UOM_flag mapping use a "case when" structure (I'm assuming you Work/Stage area is at Oracle)
I believe will be something like:
Case when count(itemno) > 1 then 'N'
else 'Y'
end
ODI will define, automatically, all necessary columns as group by expression...
Does it help you?
Message was edited by:
Cezar_Santos -
How to implement two different websites with one section that has the same content?
I have two sister websites, each for a separate but related department in a hospital. On each of these websites, I have a main tab called library, which has about 30 pages within it for related healthcare issues. The library is the exact same content on each site, but the main navigation and header for the site is obviously different. I have been upkeeping this identical content on both sites (if something is changed, then I have to do it twice). This isn't efficient and I would like to find a way to combine them somehow. I don't have a ton of experience but I catch on pretty quickly and I basically need ideas for the best way to handle this. I have considered creating a third site, and the library tab on each of the other sites would take you to this new site. I have also wondered if there is a way to embed duplicate content into two separate pages (maybe with an iframe). That way I would update the original file and it would be updated on both sites.
The sites also have different body sizes. One is 960 pixels wide and the other is 690 because it has a sidebar that makes it smaller. How would you all recommend I handle this? I use Dreamweaver CS6 and my pages are all HTMLI looked into Server Side Includes and I think I would like to try it, but I can't seem to get it working. The problem is both of my sites are under a separate domain but hosted the same way I believe. For instance, I have two dreamweaver sites, but when I use my FTP, I have one large folder for the main site, then the sister site is in a folder within the main site folder. Although you can get to the main site using www.ukneurology.com, you can also get to the site using kyneurosurgery.com/neurology/index.html. I think this is what is messing me up because I can't seem to get it to work right.
-
Suppressing the field using two conditions
how to supress a field using Two conditions?
In format field common tab
Click formula icon next to suppress and enter your conditions eg
field1 = x and field2 = y
Ian -
Suppressing a section based on two conditions
Hello
currently, I am trying to suppress a section of group based on two conditions:
- The first condition is to suppress the section always if the user is not at DrillDownGroupLevel 1.
- The second condition is to supress the section if the GroupName ({Customer.TerritoryID}) is not UK or US.
I went to the section expert and entered this code in the "Suppress (No drill-down)" x-2 formula field:
DrillDownGroupLevel <> 1 AND
GroupName ({Customer.TerritoryID}) <> "US" OR
GroupName ({Customer.TerritoryID}) <> "UK"
Unfortunately, it does not work. Any ideas are very welcome!!
I am using Crystal Reports XI
Thanks in advance!!Which "section of a group" are you trying to conditionally suppress? (group header, group footer or details within a particular group......or all of them?)
AND you stated,
"currently, I am trying to suppress a section of group based on two conditions:
The first condition is to suppress the section always if the user is not at DrillDownGroupLevel 1.
The second condition is to supress the section if the GroupName ({Customer.TerritoryID}) is not UK or US.
Try this formula for the conditional suppression:
(DrillDownGroupLevel <> 1) AND
(GroupName ({Customer.TerritoryID}) "US") OR
(GroupName ({Customer.TerritoryID}) "UK")
If that does not work you may want to check and make sure your values are upper case in the TerritoryID.
In addition, a GOOD way to test conditional suppression formulas is to put them into a conditional highlighting color for the section so you can still see the values and the highlighting lets you know if it's working. For example:
IF
(DrillDownGroupLevel <> 1) AND
(GroupName ({Customer.TerritoryID}) "US") OR
(GroupName ({Customer.TerritoryID}) "UK")
then YELLOW else WHITE -
How to apply condition when parsing XML using XMLTable
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
XML Response to be processed by stored proc:
<TFSResponse>
<TFS>
<referenceNumber>39760</referenceNumber>
<reqId>39760</reqId>
<fromAccount>
<id>1550796</id>
<number>0003210011</number>
</fromAccount>
<toAccount>
<id>1550769</id>
<number>3199109643</number>
</toAccount>
<createdBy>
<userId>627892</userId>
<userLoginId>AAAAAA</userLoginId>
<userTypeId>1</userTypeId>
</createdBy>
</TFS>
</TFSResponse>
Register schema script:
DECLARE
l_schema CLOB;
BEGIN
l_schema := '<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb">
<xs:element name="TFSResponse" type="TFSResponseWSResponseType" xdb:defaultTable="TEMP_RESULT" />
<xs:complexType name="TFSResponseWSResponseType">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="TFS" type="TFSSummaryWSTO"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="TFSSummaryWSTO">
<xs:sequence>
<xs:element name="referenceNumber" type="xs:string"/>
<xs:element name="reqId" type="xs:long"/>
<xs:element name="fromAccount" type="tns:AccountSummaryWSTO" />
<xs:element name="toAccount" type="tns:AccountSummaryWSTO"/>
<xs:element name="createdBy" type="tns:userWSTO"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="AccountSummaryWSTO">
<xs:sequence>
<xs:element minOccurs="1" name="accountId" type="xs:long" />
<xs:element minOccurs="1" name="accountNumber" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="userWSTO">
<xs:sequence>
<xs:element name="userId" type="xs:long" />
<xs:element name="userLoginId" type="xs:string" />
<xs:element name="userTypeId" type="xs:short" />
</xs:sequence>
</xs:complexType>
</xs:schema>';
dbms_xmlSchema.registerSchema(schemaurl => 'TFSWebService_schema.xsd',
schemadoc => l_schema,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE);
END;/
Object Type:
CREATE OR REPLACE TYPE DOC_ROWTYPE AS OBJECT
REFERENCENUMBER VARCHAR2(255),
REQID NUMBER(12),
FROMACCOUNTID NUMBER(12),
FROMACCOUNTNUMBER VARCHAR2(35),
TOACCOUNTID NUMBER(12),
TOACCOUNTNUMBER VARCHAR2(35),
CREATEDBYUSERID NUMBER(12),
CREATEDBYUSERLOGINID VARCHAR2(12)
Collection Type:
CREATE OR REPLACE TYPE DOC_TABLETYPE IS TABLE OF DOC_ROWTYPE;
CREATE OR REPLACE PROCEDURE SP_TFS_REPORT (LoginId IN STRING,
requestedByUser IN STRING,
result_cursor OUT SYS_REFCURSOR)
IS
SYSTEM_USER VARCHAR2(12) := 'SYSTEM';
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
l_string_request VARCHAR2(1024);
l_result_xml XMLTYPE;
docExtTable_XML DOC_TABLETYPE := DOC_TABLETYPE();
docExtRecord DOC_ROWTYPE;
BEGIN
l_string_request := .....(prepare web service request here)
l_http_response := UTL_HTTP.get_response(l_http_request);
resp_in_xml := XMLTYPE(l_clob_response);
INSERT INTO TEMP_RESULT VALUES l_result_xml;
SELECT DOC_ROWTYPE (t1.referenceNumber, t1.reqId, t2.accountId, t2.accountNumber, t3.accountId, t3.accountNumber,
t4.userLoginId, t4.userId)
BULK COLLECT INTO docExtTable_XML
FROM TEMP_RESULT ltr,
XMLTABLE('/TFSResponse/TFS'
PASSING ltr.object_value
COLUMNS
referenceNumber VARCHAR2(255 BYTE) PATH 'referenceNumber',
reqId NUMBER(12) PATH 'reqId',
fromAccountXML XMLTYPE PATH 'fromAccount',
toAccountXML XMLTYPE PATH 'toAccount',
createdByXML XMLTYPE PATH 'createdBy'
) t1,
XMLTABLE('/fromAccount'
PASSING t1.fromAccountXML
COLUMNS
accountId NUMBER(12) PATH 'accountId',
accountNumber VARCHAR2(35 BYTE) PATH 'accountNumber'
) t2,
XMLTABLE('/toAccount'
PASSING t1.toAccountXML
COLUMNS
accountId NUMBER(12) PATH 'accountId',
accountNumber VARCHAR2(35 BYTE) PATH 'accountNumber'
) t3,
XMLTABLE('/createdBy'
PASSING t1.createdByXML
COLUMNS
userId NUMBER(12) PATH 'userId',
userLoginId VARCHAR2(12 BYTE) PATH 'userLoginId' ----- This value should be set based on a condition*
) t4
OPEN result_cursor FOR SELECT * FROM TABLE (DOC_TABLETYPE);
COMMIT;
END SP_TFS_REPORT
The condition is like this
IF (requestedByUser = true and createdByUserType = '2') then
CREATEDBYUSERLOGINID := SYSTEM_USER;
ELSE
Take CREATEDBYUSERLOGINID from XML value 'userLoginId'
where 'requestedByUser' is the input parameter to the stored procedure and 'createdByUserType' is the value from XML.
'userTypeId' is not required to be set in collection.
Now my question is how to put that condition when doing the XML parsing.
Edited by: 991900 on Mar 19, 2013 9:54 AMAdd a projection for "userTypeId" in T4, then use a CASE statement in the SELECT clause :
SELECT DOC_ROWTYPE (
t1.referenceNumber, t1.reqId, t2.accountId, t2.accountNumber, t3.accountId, t3.accountNumber,
t4.userId,
CASE WHEN requestedByUser = 'true' AND t4.userTypeId = 2
THEN system_user
ELSE t4.userLoginId
END
BULK COLLECT INTO docExtTable_XML
FROM TEMP_RESULT ltr,
XMLTABLE('/TFSResponse/TFS'
PASSING ltr.object_value
COLUMNS
referenceNumber VARCHAR2(255 BYTE) PATH 'referenceNumber',
reqId NUMBER(12) PATH 'reqId',
fromAccountXML XMLTYPE PATH 'fromAccount',
toAccountXML XMLTYPE PATH 'toAccount',
createdByXML XMLTYPE PATH 'createdBy'
) t1,
XMLTABLE('/fromAccount'
PASSING t1.fromAccountXML
COLUMNS
accountId NUMBER(12) PATH 'accountId',
accountNumber VARCHAR2(35 BYTE) PATH 'accountNumber'
) t2,
XMLTABLE('/toAccount'
PASSING t1.toAccountXML
COLUMNS
accountId NUMBER(12) PATH 'accountId',
accountNumber VARCHAR2(35 BYTE) PATH 'accountNumber'
) t3,
XMLTABLE('/createdBy'
PASSING t1.createdByXML
COLUMNS
userId NUMBER(12) PATH 'userId',
userLoginId VARCHAR2(12 BYTE) PATH 'userLoginId',
userTypeId NUMBER PATH 'userTypeId'
) t4
; -
How to insert 2 conditions in a Query
Hi ,
How can i apply 2 conditions to a query
First i need to apply a condition X to query and then i need to apply condition Y to the results which are based on condition X
How can i acheve thisHi
We can create multiple condition in one query
When ever u select condition on tab it shows two options Chenge condition and new condition
If we have 2 comndition in one query it works with AND function .
If we have all applicable condition in one condition then it works with OR functionality.
Assign points -
How can i maintain conditions for vendor sub-ranges
Hi All,
How can i maintain conditions for vendor sub-ranges. These conditions apply to all materials from vendor's sub-range.
Eg: vendor X has the two subranges R1 & R2. I want to maintain separate conditions for R1 & R2. When ever i created PO with ref to particular subrange that Vendor conditions has to be appeared.
How can i achieve this?
Could u pls suggest?
Thanks & Regards
Anilkumar DalaiHi,
First Create a Condition Table with field "Vendor sub-range" in M/03
Then create an Access Sequence using this Condition Table in M/07
Then assign this Access Sequence in the Gross Price Condition Type in M/06
Then assign this Condition type in Calculation Schema in M/08
Then maintain condition record for this condition type in MEK1
And then select the appropriate VSR Code in ME21N and check the Pricing.
Maybe you are looking for
-
Folder Sync and System Back Up, please help !!!
Right, there are the two things I can do with my Windows XP machines and can't find a valid solution on Mac OS X yet: 1. Folder Sync I use 5 computers everyday, 2xMacs+1PCs at home, 1xMac at school and 1xPC in my office (part-time sys admin). It is o
-
What can I do to see items that I have purchased but upgraded to iTunes Plus? They are not showing in my iCloud as purchased, but I still can see the original protected versions from old backups. The original was downloaded with my iMac but the compu
-
Company finally updated to CS6, large client's jobs all use Interstate. Yesterday would show as missing in CS6 but worked fine in CS5.5, Today show as missing in both versions but after exporting as various file types, the fonts are infact there. Ho
-
Recording sound for "ring tone"
I can't figure out how to record my own voice and then use it for a ring tone. I could do it on my old phone....how do I do it on my iphone4???
-
Dear All, Can anyone help me in - Database table from where i can identify Customer is also a Vendor. Pls hlp asap. Thanks in advance. Best Regards.