Multiple where conditions in one parameter
Hi,
Is it possible to have more than one where condition in one parameter?
For example, my WHERE_CLAUSE parameter holds the value "where id='12345' and name='john smith'"
when i run the report, I get a [052008_033528064][][EXCEPTION] java.lang.NullPointerException at oracle.apps.xdo.dataengine.DataTemplateParser.getObjectVlaue(Unknown
Source) Thus the sql statement did not execute.
But if I change the WHERE_CLAUSE to "where id='12345'" or "where name='john smith'" it works fine.
My observation is that if there are two where conditions, BI publisher wont allow it. Am I correct?
But the report has to be open to the possibility of having more than one where clause condition. Is there a work around for this?
Thanks,
Shanak
nope your mistaken. bip will handle multiple joins.
1. make sure the where_clause parameter is defined in your package.
2. make sure use & syntax
3. make sure your sql is not malformed. This is probably the issue.
4. also, read my article on bind variables. the practice of coding the actual value in a where clause should be avoided at all costs. Causes the query execution plan to be reparsed each time that particular query is executed.
http://bipublisher.blogspot.com/2007/10/bi-publisher-what-lexical-understanding.html
Ike Wiggins
http://bipublisher.blogspot.com/
Similar Messages
-
Multiple "FromAddressContainsWords" Conditions in One Rule via PowerShell?
My organization recently moved to Exchange Online and I am looking at trying to convert the old mail rules from our old system (Sieve rules from Zimbra) to something that will work in Exchange Online. My plan is to massage the Sieve output into New-InboxRule
statements. The massaging part is the easy part. What I'm having difficult with is using PowerShell to recreate a rule that should have multiple -FromAddressContainsWords parameters. Here's what I started off with:
New-InboxRule -Name "Annoyances" -FromAddressContainsWords roxioemail.com -FromAddressContainsWords "Covalent Technologies" -FromAddressContainsWords process.con -FromAddressContainsWords [email protected] -DeleteMessage $true -StopProcessingRules -Mailbox George.Lenzer
This didn't work as the -FromAddressContainsWords option can only be used once. The error also suggested trying to do an array if the parameter would accept one. I don't know, because that isn't documented anywhere. The only thing mentioned
in the help is that it will take a "MultivaluedProperty" which I assume means some sort of string or array that has multiple values in it.
I then tried this:
New-InboxRule -Name "Junk Mail" -FromAddressContainsWords {roxioemail.com; Covalent Technologies; process.com; [email protected]} -DeleteMessage $true -StopProcessingRules $true -Mailbox George.Lenzer
While this worked, when I went into OWA to look at the rule and check the list of words, instead of each word on it's own line, had a single entry containing everything between { and }. This doesn't look right, and I don't expect it would do what I
want. So how does one go about creating an Inbox rule from PowerShell that needs to check multiple conditions, some of the identical type? It can be done from the GUI, so there must be a way to do it from PowerShell. Any suggestions?Hi George. Thanks for posting in the forums. Looking at both of your code snippets, I can see where the problem is. MultivaluedProperties in PowerShell are exactly as you describe: a set of properties presented as a single argument to a
parameter. The mistake you made was attempting to use the semicolon to separate the items in your multivalued property and then trying to present them as a single string. This is why you get the whole blob of text between the squiggly braces.
Before I give you the solution, let me say that what you want is to pass an array to -FromAddressContainsWords. In PowerShell. the comma along with multiple quoted strings is what defines an array. See here for a better explanation than I can
give:
http://theessentialexchange.com/blogs/michael/archive/2008/02/08/Multivalued-Parameters-.aspx
With that said, here's the solution to your issue:
New-InboxRule -Name "Junk Mail" -FromAddressContainsWords ("roxioemail.com", "Covalent Technologies", "process.com", "[email protected]") -DeleteMessage $true -StopProcessingRules
$true -Mailbox George.Lenzer
Hope this helps! -
Chart for representing multiple inputs (conditions) and one output
Hello everyone,
I am using Microsoft Excel 2010.
I have a list of sells. Each sell amount can be only one from the following range $25, $30, $50, $40, $75, $85, $100 and number of clients can be any number between 0 and 500 in each month. We assume each client will buy the services at least once a year or
at most once a month. A sales representative will make 10% profit out of these sells.
What type of chart representation can best show the minimum and maximum profits per month during a year for a sales rep.?
Any help is appreciated in advance.
ThanksHello Ring Gee.
Thanks for reply,
Suppose you are working for a company, consider the followings at the end of the first month. They will pay you 10% commission if you sell the telephone services to 100 people. You will continue to receive this amount of commission for 12 months. If you
sell the telephone services to 300 people your commission rate will be 14% and they will pay you this commission for 20 months. This means in the first case you will receive $3000 to $12000 (varies by sell's amount) and if you sell the services to 600
clients you will receive between $96000 and $384000 (varies by sell's amount).
This way, life time and rate of your commission will increase if you increase the number of sells.
Is it clear enough?
I want to visualize this scenario using the chart that covers all conditions. There was no option to upload the actual excel file, so I took a picture of it. Look at the image bellow please: -
Passing multiple parameter to where condition
Hi all,
I want to pass multiple parameters to where condition.. it is as follows:
i'll pass only TODAY date to M_DATE_TO variable.
CURSOR C_COUNT(M_DATE_FROM DATE, M_DATE_TO DATE) IS
SELECT COUNT (*)
FROM table_name
WHERE TRUNC(table_name.join_date) BETWEEN M_DATE_FROM AND M_DATE_TO;
begin
SELECT TRUNC(LAST_DAY(ADD_MONTHS(:REP_VALUE_4,-1)))+1 INTO M_FIRST_DATE_MONTH FROM DUAL;
SELECT TRUNC(:REP_VALUE_4, 'YEAR') INTO M_FIRST_DATE_YEAR FROM DUAL;
SELECT TRUNC(ADD_MONTHS(:REP_VALUE_4,-12)) M_SAME_DATE_PYR FROM DUAL;
SELECT TRUNC(LAST_DAY(ADD_MONTHS(:REP_VALUE_4,-13)))+1 INTO M_FIRST_DATE_MONTH_PYR FROM DUAL;
SELECT ADD_MONTHS(TRUNC(:REP_VALUE_4,'YEAR'), -12) INTO M_FIRST_DAY_PYR FROM DUAL;
M_DATE_FROM:=M_FIRST_DATE_MONTH;
M_DATE_TO := TODAY;
IF C_COUNT%ISOPEN THEN
CLOSE C_COUNT;
END IF;
OPEN C_COUNT (M_DATE_FROM,M_DATE_TO);
FETCH C_COUNT INTO M_COUNT_MTD;
CLOSE C_COUNT;
:cp_count_mtd:=m_count_mtd;
M_DATE_FROM:=M_FIRST_DATE_YEAR;
M_DATE_TO:= TODAY;
IF C_COUNT%ISOPEN THEN
CLOSE C_COUNT;
END IF;
OPEN C_COUNT (M_DATE_FROM,M_DATE_TO);
FETCH C_COUNT INTO M_COUNT_YTD;
CLOSE C_COUNT;
:cp_count_ytd:=m_count_ytd;
M_DATE_FROM:=M_FIRST_DATE_MONTH_PYR;
M_DATE_TO:= M_FIRST_DAY_PYR;
IF C_COUNT%ISOPEN THEN
CLOSE C_COUNT;
END IF;
OPEN C_COUNT (M_DATE_FROM,M_DATE_TO);
FETCH C_COUNT INTO M_COUNT_MTD_PYR;
CLOSE C_COUNT;
:cp_count_ytd_pyr :=m_count_ytd;
Is there any easy way or other method, Please help me...Thanks in advance.
RegiThanks Roberto for reply.
Please find the screenprint as per your suggestion. Also I have mentioned the code in above question. We are using the stored procedure to write the value into a table , passed from front end. We are able to write the value passed from front end into a table. So it means that system is passing the value.
But when I try to bring same value into the data task flow , system is throwing a error. The description of error is also mentioned below.
Kindly advise.
Error Description in DM package:
Description = Executing the query "exec dbo.sp_ver_copy2 'Account'" failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_STR)". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. -
Multiple choose for one parameter
Hi, does Oracle Report support the multiple choose for one parameter? i used a IN statement inside my WHERE conditions as following
Select ....
where ....
content.style IN (:p_style)
(content.style is a column in table "content", and "p_style" is a bind variable)
i want user can have multiple choises on p_style value. but in the parameter form i only can make one choise. Does any one know how to do the multi choise from parameter form? if you do, please help me. Thank you very much.
Li<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by whl:
Hi, does Oracle Report support the multiple choose for one parameter? i used a IN statement inside my WHERE conditions as following
Select ....
where ....
content.style IN (:p_style)
(content.style is a column in table "content", and "p_style" is a bind variable)
i want user can have multiple choises on p_style value. but in the parameter form i only can make one choise. Does any one know how to do the multi choise from parameter form? if you do, please help me. Thank you very much.
Li<HR></BLOCKQUOTE>
you can do that by flowing the stap
at first you will write a select statement
select ...
From ...
where Style (colomn name) = &style1
then you create a user parameter soupose wich name is P_style and which valus is x, y, and z you should enter another value soupose that name is 'All' (All means x + y + Z)
then you write in after parameter form trigger...
IF :P_style = 'All' then
:style1 := null;
Else :style1 := 'and style (style means your column name) = :P_style;
end if;
null -
CASE Statement in Where Condition with Multi Valued parameter in SSRS
Hi All,
I am little confused while using CASE statement in Where condition in SSRS. Below is my scenario:
SELECT
Logic here
WHERE
Date IN (@Date)AND
(CASE
WHEN NAME LIKE 'ABC%' THEN 'GROUP1'
WHEN ID IN ('123456', '823423','74233784') THEN 'GROUP2'
WHEN ABC_ID IS NULL THEN 'GROUP3'
ELSE 'GROUP4'
END ) IN (@GROUP)
So above query uses WHERE condition with CASE statement from @GROUP parameter. I want to pass this parameter as multi- valued parameter and hence I have used CASE statement IN (@GROUP).
For @Date one dataset will pass the available and default values and
for @GROUP parameters, another dataset will pass the available and default values.
But this is not working as expected. Please suggest me where I am making mistake in the query.
Maruthu | http://sharepoint-works.blogspot.comHi Maruthu,
According to your description, I create a sample report in my local environment. It works as I expected. In your scenario, if the selected values from the Date parameter contains some of the Date field values, the selected values from the GROUP parameter
contains some of GROUPS (‘GROUP1’,’GROUP2’,’GROUP3’,’GROUP4’) and the corresponding when statement is executed , then the dataset returns the corresponding values.
In order to trouble shoot this issue, could you tell us what results are you get and what’s your desired results? If possible, you can post the sample data with sample dataset, then we can make further analysis and help you out.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Passing one parameter to multiple views
Is this possible? I would like to pass one parameter, a date field, to multiple views. I cannot use it in the record selection, because my views do a mathematical computation which returns a single value, but I only want to select the data for a single day.
The problem is that there are several views and I do not want to have to enter the date parameter a dozen times.Try to use add command and write the query like this
select * from view where datefield={?date}
also create another add command for the other view
select * from view2 where datefield2={?date}
for all the queries create the same parameter with the name {?date}
Regards,
Raghavendra -
Unable to build SQL query for one parameter at multiple locations
Hi,
Below one is the sample SQL in which I used :p_organization_id at 3 positions
First one at in the main where clause
Second one after START WITH
Third one is after CONNECT BY PRIOR
SELECT bs.assembly_item_id
,msia.segment1 a_item
,SYS_CONNECT_BY_PATH(msi.segment1, '---->') "Path",
bc.component_item_id,
bc.disable_date,
bc.item_num,
mp.organization_code organization_code,
LEVEL,
bc.attribute1 reference_no,
msi.segment1 item_number,
msi.description description
FROM inv.mtl_system_items_b msi,
inv.mtl_system_items_b msia,
bom.bom_structures_b bs,
bom.bom_components_b bc,
inv.mtl_parameters mp
WHERE
bc.component_item_id = msi.inventory_item_id
AND bc.bill_sequence_id = bs.bill_sequence_id
AND bs.assembly_item_id = msia.inventory_item_id
and msi.segment1 = 'P5200802-DB100'
AND bs.organization_id = msia.organization_id
AND msia.organization_id = msi.organization_id
AND msi.organization_id = mp.organization_id
AND mp.organization_code = :p_organization_id
AND NVL(TRUNC(bc.disable_date),TRUNC(SYSDATE + 1)) > TRUNC(SYSDATE)
START WITH msia.segment1 = '24310003-13.1' AND mp.organization_code = :p_organization_id
CONNECT BY PRIOR bc.component_item_id = bs.assembly_item_id
AND mp.organization_code = :p_organization_id
ORDER SIBLINGS BY bc.item_num
My question is how to use single parameter value that should go in the multiple positions in the SQL.
Please suggest if this can archived either in the Discoverer Admin / Desktop in detail.
Regards,
Chiranjeevi MedaHi,
The only way you can use SQL with a connect by in Discoverer is to either put the SQL in a view or put the SQL in a custom folder. Either way you will not be able to pass parameter directly from Desktop/Plus to the view or custom folder.
The solution probably is to use session parameters and replace the :p_organization_id in the 3 positions with SYS_CONTEXT('DISCO_CONTEXT', 'ORGANIZATION_ID') once you have defined your DISCO_CONTEXT namespace and ORGANIZATION_ID session parameter.
See these threads for more information. (Re: Passing multiple parameters into Custom Folder... http://learndiscoverer.blogspot.com/2008/11/metalink-note-304192.html)
Rod West -
Passing the column name on Where condition based on input parameter
Hi,
I am using Oracle10g. Following are my table schema.
Table Name : Codes
Columns( ID, Level0, Level1,Level2)
View Name : SampleView
I have a scenario : A parameter will be passed to my view from C# application. I need to cut the last 4 places of the parameter and need to check 4 conditions as follows :
1. IF last 4 places of parameter contains the value as "AMPD" then pass level0 column on where condition.
Sample code : A123XPAMPD
Expeted Result: Select * from Codes where Level0 ='A123XPAMPD'
2. IF last 4 places of parameter contains the value as "Alpha numeric" then pass level1 column on where condition.
Sample code : A123XPAA00
Expeted Result: Select * from Codes where Level1 ='A123XPAA00'
3. IF last 4 places of parameter contains the value as 0000 then pass level1 column on where condition.
Sample code : A123XP0000
Expeted Result: Select * from Codes where Level1 ='A123XP0000'
4. IF last 4 places of parameter contains the value as (cannot be all 0's) and cannot contain "Alphabets" then pass level2 column on where condition.
Sample code : A123XP1001
Expeted Result: Select * from Codes where Level2 ='A123XP1001'
Could any one please help me on writing this logic inside the view.
Thanks in advance.Do you want to make sure that at least one alphabet and one number is there?
select case
when regexp_like('1111','^[a-zA-Z]+$') -"This says - Only alphabets, not even space
THEN 'Alphabets'
when regexp_like('1111','^[a-zA-Z0-9]*$') --"This says - Only alpha-numeric, not even space
and regexp_like('1111','[a-zA-Z]') --"To make sure atleast one alphabet is there
and regexp_like('1111','[0-9]') --"To make sure atleast one number is there
THEN 'AlphaNumeric'
else 'NULL' --"This is a string. Not actual NULL
end
from dual;
{code} -
One parameter for multiple Crystal reports in Publication
Does anyone know if it is possible to enter one identical parameter for multiple Crystal reports in publication when scheduling? BOE 3.1 SP3 Windows, Java.
To elaborate I am creating publication with multiple reports, each report has one parameter and this parameter is identical in every report in publication. So instead of entering this parameter many times I would like to enter once.
If yes point me in the right direction to get the how to or post the steps.Daniel,
Thank you so much for your answer. It was very helpful. In the end, it didn't work but it helped me figure out what was happening. I use a different form for the reports and I had it coded in the form which report to use. I created a second form for the second crystal and then I used an if statement to choose the form and it worked like a charm.
Thanks so much again! -
How can i pass input date parameter in where condition in exec_sql.parse
EXEC_SQL.PARSE(source_connid, source_cursor,'SELECT substr(empid,3,6) ,
attdate ,
to_char(intime1,''HH24MI'') ,
nvl(to_char(outtime2,''HH24MI''),nvl(to_char(intime2,''hh24mi''),nvl(to_char(outtime1,''hh24mi''),null))) ,
''G'' ,
null ,
null ,
55
FROM ' || source_table||'
WHERE attdate = '||:control_main.input_dt);
when i gave this input_dt the output is zero.
without this where condition i am getting records.
its urgent,please help me in this.
Edited by: saru on Jan 12, 2009 2:06 AM
Edited by: saru on Jan 12, 2009 2:53 AMI guess you have a problem with your formats...
try this:
[...]WHERE attdate = to_date('''||to_char(:control_main.input_dt,'dd.mm.yyyy')||''', ''dd.mm.yyyy'')[...]regards -
Multiple rebate condition types in one invoice
I had defined multiple rebate condition types as Y000, Y001 and Y002, which are montly offtake rebate, distance rebate and yearly offtake rebate.
Y000 and Y001 can be in the same validity period and also will be applicable to the same invoicee.
When i create a rebate agreement for customer for Y000 and go for the settlement of the rebate it is happening fine.
But for the same customer, i had defined Y001 as a rebate agreement type for the same period and materilal.
The sales volume is not updated in the rebate agreement. Evenif I do VBOF the sales volume is not updated.
the error that comes while doing VBOF is :
"7000158055 Document number RCFL 7000158055 2011 was already assigned
7000158053 Document number RCFL 7000158053 2011 was already assigned
7000158052 Document number RCFL 7000158052 2011 was already assigned
7000158054 Document number RCFL 7000158054 2011 was already assigned"
Please help me to solve this problem.
Mrs. Swati PawarHello Swati,
the suggestion of JP is correct.
I explain it better.
- the document type of FI document created from SD depends on the customizing of billing type field TVFK-BLART. If it is blank, then by default is 'RV'.
- if the number range assigned to the account document type is External, then the FI document gets the same number of the SD invoice.
- transaction VBOF creates FI document referred to SD invoice. If it has external number range, and an FI document already exist with same number (created when SD invoice has been released to accounting), then the errof F5152 occurs.
SOLUTION:
in the selection screen of VBOF there is the field FI-Doc-type. Here you should specify the FI document type that should be created by execution of VBOF, and of course it must have number range internal.
Please try this.
Best regards,
Ivano. -
Using multiple 'and' conditions in a SQL query
Is it possible to reduce the SQL required to query using multiple 'and' conditions, e.g. I have a query like the following:
select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
where stat.apy_apn_id = apps.rgn_apt_id
and apps.rgn_apt_id = appt.rgn_apt_id
and stat.application_completed is null
and stat.application_started_date > '01-MAY-11'
and stat.amount_paid is null
and stat.personal_details = 'C'
and stat.further_details = 'C'
and stat.education = 'C'
and stat.employment = 'C'
and stat.personal_statement = 'C'
and stat.choices = 'C'
and stat.reference = 'C'
and stat.student_finance = 'C'
Is there a way, to reduce all the multiple 'and' queries, to be read from say one line? If you know what I mean.......Ah, Ok this looks nice, thanks very much. It doesn't quite run as is because the stat.amount_paid query value is 'is null', while the others are 'C'. I tried amending the relevant line to various versions of the following:-
in (select 'is null' 'C','C','C','C','C','C','C','C' from dual)
which doesn't work.
I can get the following to work so I am assuming that the it is not possible to use different query values within the brackets of the 'in (select....' statement?
select stat.personal_id, appt.username, appt.password, apps.rgn_apt_id, apps.apy_apn_id
from apy_ast_application_status stat, rgn_usr_user appt, rgn_aps_applications apps
where stat.apy_apn_id = apps.rgn_apt_id
and apps.rgn_apt_id = appt.rgn_apt_id
and stat.application_completed is null
and stat.application_started_date > '01-MAY-11'
and stat.amount_paid is null
and (stat.personal_details, stat.further_details, stat.education,
stat.employment, stat.personal_statement, stat.choices, stat.reference, stat.student_finance)
in (select 'C','C','C','C','C','C','C','C' from dual)
Thanks for everybodys help - the suggested alternatives seem so much more elegant -
How to pass multiple values to a single parameter in BW report URL
Hi Experts,
I am new to EP and learning .... i am stuck at one point where we need to pass multiple parameters to a BW report URL, this is the URL that we launch from BSP.... Suppose i have to pass different multiple values to a single parameter, how to do it....
i m getting many answers to pass parameters to iviews, reports, but not specific to my case.. can u plz help me....
Thanks in advance
Priya RaiWhat is the prolem you are facing if you split the single date param as two parameters say startdate and enddate?
If you pass as single string then you might have to split the same at reciever end.
Are you trying any thing specific? -
Multiple free goods for one item in standalone CRM
Hi Gurus,
We are trying to implement multiple free goods for one item in standalone CRM.
As per SAP.help.com, it says that we can configure multiple free goods scenario in standalone CRM system.
We tried to set up this in our system. Basically we want to implement the scenario, where a user wants to purchase item A, he should get a prompt for choosing between two free goods B and C.
We did the relevant IMG settings required for Free goods at IMG ->CRM -> Basic Functions -> Free Goods.-> Set up Free Goods
We also did the relevant item category determination where we have made an entry with
Item Usage = " Free Goods" , Main item cat. = "TAN' , Item Category = "TANN".
Now we went to create condition records in the path "SAP Menu -> Master Data -> Prices and Conditions -> SAPCND/GCM - Maintain condition"
We chose Application ="PRT", MaintenanceGrp="PRT_FGOODS", Maintenance context ="GCM"
Then while creating conditon records , when I try to create two condition records where the Main Product is same but free good product is different, the system is not allowing to save these two condition records.
it is giving error "Overlapping validity periods for two condition records".
Please advice, if i am missing something. Thanks in advance for your help.
thanks,
Randhir
Edited by: Randhir Soni on Feb 8, 2010 8:12 AMConstraints in free goods in R3 taken from SAP library
Free goods can only be supported on a 1:1 ratio. This means that an order item can lead to a free goods item. Agreements in the following form are not supported: u2018With material 1, material 2 and material 3 are free of chargeu2018 or u2018If material 1 and material 2 are ordered at the same time, then material 3 is free of chargeu2018.
Free goods are not supported in combinations with material structures (for example, product selection, BOM, variants with BOM explosion).
Free goods are only supported for sales orders with document category C (for example, not quotations).
Free goods are not supported for deliveries without reference to a sales order.
Free goods cannot be used in make-to-order production, third-party order processing and scheduling agreements.
If you defined a free goods for variants in a generic article (only SAP Retail), you can only process the variants in the purchase order and goods receipt individually (as single articles). In other words, you cannot process them using the generic article matrix.
This answers your qn Not possible in R3
If you are on Retail scenario this is possible thro bonus buy schemes
But a lot of customizations needs to be done and you need a retail server to do that
Regards
Raja
Maybe you are looking for
-
How to enter a range of ports in the firewall
Does anyone know the syntax of how to enter a range of ports in the firewall so I don't have to enter each individual number? For instance, to open port 15000 to 15264, is it possible to type something like "15000 - 15264" instead each port followed
-
How to delete an email address from appearing in "iCal File New Calendar"?
I've already removed the email from my Address Book & Mail Program (previous recipients, accounts, etc.) and the email address I no longer use is still showing up in iCal under New Calander & New Reminder Group. I don't want to see this address appea
-
Can Automator assign iPhoto keywords on import?
I collect a lot of images from friends, websites, etc. I would like to import a group of photos on my desktop to iPhoto, then auto-assign a specific keyword to that group. Can I do this with Automator?
-
Calculator does not have enough resolution
I am using MBA with OS 10.8.2, using Calculator 10.8 (123) I set calculator to Scientific, with decimal place = 15 (max). If I try to calculate 1.6e-19 * 2, the answer is 0, because 1.6e-19 exceeds 15-bit decimal, and is truncated to 0. This is silly
-
Files not found installing 12c on windows 8.1
mk_dir.sql.sbs, dr0ulib.sql.sbs not found while installing 12c on wondows 8.1. I had heard its a downloading issue, so I downloade dit again. File not found persists. Details: Oracle 12c installation - Pastebin.com