Using report parameter in data set filter expression with an SSAS data source
I have an SSRS report with an SSAS data source.
Report parameters:
Param1 - text, single select
Param2 - text, multi-select
Dataset:
In Query Designer, I want to include Param1 as a filter expression so I can have "Dimension1 Begins with @Param2". I'm not sure the exact syntax to make param2 work in this.
The point is to filter my data set on param1. If A is selected for param1, I want the data set to have the filter saying "Dimension1 begins with A"
Anyone know how to use a report parameter in the dataset filter expression for an ssas data source?
hi,
try this maybe the dates you are comparing are not in the same format.
I test data template in EBS but not with dates.
to_date(date,'dd/mm/YY') between to_date(:p_from_date ,'dd/mm/YY') and to_date(:p_to_date ,'dd/mm/YY')
if dont works try to put values insted of your parameter like :
to_date(date,'dd/mm/YY') between to_date(:p_from_date ,'10/01/07') and to_date(:p_to_date ,'01/12/07') ... put dates where u can have some values in report...
if dont work then try to print the values of the 2 parameters and the date of the select somwhere in ur report to see what you have in it..
hope it helps..
Regards Joe.
Similar Messages
-
How to use the prompted value in the filter expression
Hi
Is it possible to use the prompted value in the filter expression?
My requirement is that user will be prompted for a date field and I need to filter the records such that the records are displayed for the last 5 weeks from the date entered by the user.
If somehow I know how to use the prompted value in the filter expression then this requirement is easy to be done. If this is possible, please guide me?
If there are other ways to acheive the desired results then please suggest.
Thanks
-JazEdit: example added
SQL> create table tb_test
2 ( id number(5)
3 , tot number(5)
4 , mon_tot number generated always as (tot*15) virtual
5 );
Table created.
SQL> insert into tb_test (id, tot) values (1, 5);
1 row created.
SQL> select * from tb_test;
ID TOT MON_TOT
1 5 75
1 row selected.
SQL> update tb_test
2 set tot = 15
3 where id = 1;
1 row updated.
SQL> select * from tb_test;
ID TOT MON_TOT
1 15 225
1 row selected. -
The filter expression is on external data and could not be validated.
The filter expression is on external data and could not be validated. It may not be supported in Web browser forms.
I am reciveing this error in my infopath 2010 browser form when I am trying to filter a drop down list from sharepoint.
I thought filters were available on infopath 2010 browser forms or are they only available from values inside the form?
I did have a look around the forums but only could find this error occuring during beta stage.
ThanksOk, so you shouldn't be filtering in the form, because that means it downloads the entire list first and then filters out the items. That's client-side filtering. What you want to do is server-side filtering by doing a parameterized query.
Set the data connection NOT to automatically download
Add Form Load rules that do the following:
First, "Set a Field's Value" and set the position query node of the data connection to the value of "manager" (whatever the exact syntax is)
Then query the data connection
Doind this should make it ONLY download items where position=manager instead of downloading all items and filtering. This is a much better practice and was not even available in 2007, so you should make full use of it in 2010. Even so, what you
were doing should have worked anyway, so I'm not sure what's going on there.
When you do the filtered dropdown, your Source field should be the repeating group of the data connection, not the property itself. The property should only be selected in Value and DisplayName. The group should be in the Source field, and THAT'S
where you apply the filter.
SharePoint Architect || Microsoft MVP ||
My Blog
Planet Technologies ||
SharePoint Task Force -
How to use shared parameter on request set
Hi
I have a request set with two stages
First stage contains From Date and To date where i have named the shared parameter as StartSP and EndSP
i have to use these shared parameter in one of the query in next stage where my Type is SQL Statment and i have these two date fields From date and To date in next stage as well where i am able to retirve the values from previous stage
based on these values i need to get the name in next parameter where my Type is SQL Statment
select name from tablename where '02-MAR-09' > =start_Date and '29-MAR-09' <=end_Date
I have written SQL as
select name from tablename where StartSP > =start_Date and EndSP <=end_Date but it throws an error.
I need the values of 02-Mar-09 and 29-Mar-09 from StartSP and EndSP
Appreciate if any one has idea about this.hi user;
please check:
http://download-west.oracle.com/docs/cd/A60725_05/html/comnls/us/fnd/repset04.htm
http://download-east.oracle.com/docs/cd/A60725_05/html/comnls/us/fnd/10gch609.htm
Also you can check this search:http://www.google.com.tr/search?hl=tr&source=hp&q=How+to+use+shared+parameter+on+request+set+&meta=&aq=f&oq=
Hope it helps
Regard
Helios -
I have just bought a 2011 iMac (2.5 ghz, 4gb) and logic express 9, and when i installed logic and tried to run it i had a message saying 'you can't use this version of the application logic express with this version of Mac OS X. How do i sort this out!? It is very frustrating as the main reason i have bought a mac is to use logic! Any help would be great as i am a complete novice when it comes to Macs!
You're probably on OS X Lion?
I had the same problem as you. I used Software Update to update Logic Express to the latest version, and then it ran without any problems. -
How does iCloud manage app data( like whatsapp) ? Does it overwrite the data everytime I backup to I cloud with the data on the phone when i backup or it merges the data from previous backups with the new data?
You need to subscribe to iTunes Match to store your music on iCloud:
http://www.apple.com/itunes/itunes-match/
To transfer iTunes Store purchases made on your phone to your computer, connect your phone then choose "Transfer purchases..." from the File menu in iTunes.
Photostream transfers photos taken on your iOS devices to other devices and your computer. For troubleshooting Photostream see: http://support.apple.com/kb/TS3989 -
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. -
Urgent! Using Reports parameter forms with RUN_REPORT_OBJECT on 9iAS
Hi all, I am migrating client-server to 3-tier with 9iAS Rel2 on AIX 5.1. The forms and reports are upgraded from Forms4.5 to forms9i and Reprots 2.5. We used to have user defined parameter in parameter form(e.g. articale no.) to select records appearing in the report.
However, the Report parameter form doesn't work on web.
I have read Note : 139546.1 but I want the parameter entered in Report parameter form, not in the Form that call the report.
Does anyone has samples of Forms and Reports doing to achieve that? Thank you very much in advance.
best regards,
KathyKathy,
please have a look at the Forms and reports integration Whitepaper that is available from otn.oracle.com/products/forms. This shows you a coding example of what needs to be done to make parameter forms work on teh Web. This papaer is available for Forms9i/Reports9i and Forms6i/Reports6i
Frank -
STATIC "HTML Data Set Photo Gallery" with CAPTIONS
Because of search engines and validation I would really like to use the STATIC "HTML Data Set Photo Gallery" http://labs.adobe.com/technologies/spry/demos/gallery_pe/static/china.html.
But I definitely need captions for the Photos. I found possibilities to add them via XML, but not for the HTML-Version.
As far as I got I think I have to edit this function from "gallery_hds.js" and add some RegEx, to extract caption text.
function PhotosFilter(ds, row, rowIndex)
var tnStr = row.thumbimg;
if (tnStr)
row.path = tnStr.replace(/.*<a[^>]*href="?([^"]*)"?.*/i, "$1");
row.thumbpath = tnStr.replace(/.*<img[^>]*src="?([^"]*)"?.*/i, "$1");
return row;
In the following rows within the html-document
<span class="thumbnail"><a href="../../gallery/galleries/paris/images/paris_02.jpg"><img src="../../gallery/galleries/paris/thumbnails/paris_02.jpg" alt="paris_02.jpg" /></a></span>
I would insert text before the closing span-tag (or before the closing a-tag?) - like so
<span class="thumbnail"><a href="../../gallery/galleries/paris/images/paris_02.jpg"><img src="../../gallery/galleries/paris/thumbnails/paris_02.jpg" alt="paris_02.jpg" /></a>Here is some HTML Text</span>
This text must be extracted via RegEx - similar to the rows within the if-Statement of the upper mentioned function "PhotosFilter". But here my RegEx-knowledge is definitely to short!
Thank you very much in advance for any help or suggestion.
Angela FenglerBecause of search engines and validation I would really like to use the STATIC "HTML Data Set Photo Gallery" http://labs.adobe.com/technologies/spry/demos/gallery_pe/static/china.html.
But I definitely need captions for the Photos. I found possibilities to add them via XML, but not for the HTML-Version.
As far as I got I think I have to edit this function from "gallery_hds.js" and add some RegEx, to extract caption text.
function PhotosFilter(ds, row, rowIndex)
var tnStr = row.thumbimg;
if (tnStr)
row.path = tnStr.replace(/.*<a[^>]*href="?([^"]*)"?.*/i, "$1");
row.thumbpath = tnStr.replace(/.*<img[^>]*src="?([^"]*)"?.*/i, "$1");
return row;
In the following rows within the html-document
<span class="thumbnail"><a href="../../gallery/galleries/paris/images/paris_02.jpg"><img src="../../gallery/galleries/paris/thumbnails/paris_02.jpg" alt="paris_02.jpg" /></a></span>
I would insert text before the closing span-tag (or before the closing a-tag?) - like so
<span class="thumbnail"><a href="../../gallery/galleries/paris/images/paris_02.jpg"><img src="../../gallery/galleries/paris/thumbnails/paris_02.jpg" alt="paris_02.jpg" /></a>Here is some HTML Text</span>
This text must be extracted via RegEx - similar to the rows within the if-Statement of the upper mentioned function "PhotosFilter". But here my RegEx-knowledge is definitely to short!
Thank you very much in advance for any help or suggestion.
Angela Fengler -
Filter records with month and date
Hi,
i have records as follows in the table.
custno trn_dt amount
1 01-jan-06 100
1 10-jan-06 200 --->
1 15-feb-06 300
2 15-dec-06 111
2 15-jan-06 222 --->
2 01-fen-06 333
If i specify the runtime parameter as JAN-06 the output of the report should be with 2 records indicated with arrows above.
the query should pick up the record with the highest date for a specific customer.
in the above example for customer "1" 10-jan-06 is highest date and for customer "2" 15-jan-06 is the highest date.
hope the requirement is clear.
thanks in advanceSELECT custno, trn_dt, amount
FROM TABLE
WHERE (custno,trn_dt) IN
(SELECT custno, MAX(trn_dt)
FROM TABLE
GROUP BY custno)
There are many examples on this in SQL and PL/SQL forum. -
Please Help, Data Set Master/Detail with mySQL DB
Hi...
I installed the Data Set Master/Detail Sample (states and
citys autopopulate) getting values from a XML file...
when a user adds a listing in my site, it works great.. i use
the XML file values for the states/citys and then everything is
stored in a DB... BUT i need to do this..
when he comes back to edit his listing, i want the Data Set
Master/Detail to show hes values (from de DB) with the option to
edit them, not the first XML file values.
ThanksThank you kinblas!!!!!
I saw another post with the solution!!!
Here it is
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=602&threadid =1308016&highlight_key=y&keyword1=SetDefaultState
Thanks again! -
If i buy a Unlocked iphone 4s and use it in another country, will it work with the countrys Local data Services
hi guys,
i recently bought a new iphone 4s factory unlocked. in order to avoid sim failures and invalid sim errors or No service errors, Each phone has to be unlocked by connecting it to the Itunes.
Kindly follow the below steps to avoid any SIM card conflicts
iPhone FULL Unlock - How it Works:
-Connect your iphone to itunes without any network sim inside and when connected click on the iphones name.
- Click Restore install latest version of iTunes on your Pc or Mac or click check for updates
- Let itunes Backup your phone and then Flash to the Latest Version.
- Now disconnect phone and reconnect after 10 seconds.
- Now Enter another network simcard that's not the same network its locked on to
- Connect phone to iTunes with not accepted (not valid) simcard
- Wait until iTunes detects the phone
- iTunes will display (Congratulations, Your iPhone is now unlocked)
- Phone Unlocked
- just follow the instructions about activating the Iphone.
and iphone is unlocked
NOTE : This is the only FULL LIFE TIME UNLOCK solution for Apple iPhone as the IMEI is registered as UNLOCKED in Apple database.
This solution should be used ONLY THOSE WHO BOUGHT FACTORY UNLOCKED iPHONE 4S.
Your phone will always be unlocked even after each new update of your phone firmware !
All reasons given like bad IMEI series, manufacturing defects etc blah blah are not logical as everything was tested before every sale. -
Purchase Requisition Date is not updated with Scheduleline Delivery Date
Hi,
This is a third part Sales Scenario. The Delivery date on the schedule line is passed on to purchase requisition as the delivery date of that item. Due to some business requirement, the delivery date of the schedule line is changed just before saving the sales order in the BADI called through the userexit userexit_save_document_prepare. Now on saving the sales order, the purchase requsition is also created.The delivery date of the schedule line is changed but has not reflected on the Purchase Requision.
If the Sales Order is opened in VA02 and the schedule line delivery date is modified, the Purchase Requisition delivery date is also getting modified.
Why did it not happen at the time of saving the Sales Order.
What is the structure into which the purchase requsition information is stored, so that on processing the sales order, this information is utilized to create the purchase requsition.
Please help.Hi,
Check the following table for the mentioned fields EBAN-BADAT and EBAT-FRGDT
Thanksk and Regards,
Hari Challa. -
How To hide a column on a Matrix using a parameter that is set-up as a multi-select
Hi,
I have a multi-select parameter (has 4 choices ie. A,B,C,D). In the matrix the parent Column group is a date and the child group is based on the Multi-select parameter field. When all choices are selected the report returns a column per
date and then within that date column 4 sub columns as expected.....This all works.
Challenge ... I added another column (Col5). For Col5 I only want it to show if value B has been selected from the multi choice
Another way of saying it.... How do I get a column to appear (Visibility) if a specific Value has been select in a multi-choice parameter
Tx
Andrew
Andrew PayzeHi,
here is the query
SELECT ProjectNumber, ProjectDescription, WBS, TaskNumber, TaskName, TaskDescription, TaskManager, Results, ResourceExpenditure, CostSet, Currency,
ReportingDate, Value, YEAR(ReportingDate) AS Year, { fn MONTHNAME(ReportingDate) } AS Month, ActualValue, PriorEAC
FROM vwForecastAccuracy
WHERE (CostSet IN (@CostType)) AND (YEAR(ReportingDate) = @Year) AND (Results = 'Cost')
below is the Code, not sure how to attach RDL
Thanks
Andrew
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Tablix Name="matrix1">
<TablixCorner>
<TablixCornerRows>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox3</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
<TablixCornerRow>
<TablixCornerCell>
<CellContents>
<Textbox Name="Textbox8">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value />
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox8</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCornerCell>
</TablixCornerRow>
</TablixCornerRows>
</TablixCorner>
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1in</Width>
</TablixColumn>
<TablixColumn>
<Width>1in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.21in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Value">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Sum(Fields!Value.Value)</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<Format>'$'#,0;('$'#,0)</Format>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Value</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<rd:FormatSymbolCulture>en-US</rd:FormatSymbolCulture>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox4">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=RunningValue(Fields!ActualValue.Value,sum, "matrix1_ProjectNumber")</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox4</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
<DataElementOutput>Output</DataElementOutput>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_ReportingDate">
<GroupExpressions>
<GroupExpression>=Fields!ReportingDate.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!ReportingDate.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.21in</Size>
<CellContents>
<Textbox Name="Month">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!Month.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Format>MM/dd/yyyy</Format>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Month</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember>
<Group Name="CostSet">
<GroupExpressions>
<GroupExpression>=Fields!CostSet.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!CostSet.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>0.25in</Size>
<CellContents>
<Textbox Name="CostSet1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!CostSet.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>CostSet1</rd:DefaultName>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<TablixMembers>
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixMember>
</TablixMembers>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="matrix1_ProjectNumber">
<GroupExpressions>
<GroupExpression>=Fields!ProjectNumber.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!ProjectNumber.Value</Value>
</SortExpression>
</SortExpressions>
<TablixHeader>
<Size>1in</Size>
<CellContents>
<Textbox Name="ProjectNumber">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!ProjectNumber.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>ProjectNumber</rd:DefaultName>
<ActionInfo>
<Actions>
<Action>
<Drillthrough>
<ReportName>BUDVAR 11 Budget Detail By WBS</ReportName>
<Parameters>
<Parameter Name="ProjectNumber">
<Value>=Fields!ProjectNumber.Value</Value>
</Parameter>
<Parameter Name="Year">
<Value>=Parameters!Year.Value</Value>
</Parameter>
<Parameter Name="CostSet">
<Value>=Parameters!CostType.Value</Value>
</Parameter>
</Parameters>
</Drillthrough>
</Action>
</Actions>
</ActionInfo>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#6e9eca</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixHeader>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<RepeatColumnHeaders>true</RepeatColumnHeaders>
<RepeatRowHeaders>true</RepeatRowHeaders>
<DataSetName>BudgetData</DataSetName>
<Height>0.67in</Height>
<Width>3in</Width>
<Style />
</Tablix>
</ReportItems>
<Height>0.84708in</Height>
<Style />
</Body>
<Width>3.85417in</Width>
<Page>
<LeftMargin>1in</LeftMargin>
<RightMargin>1in</RightMargin>
<TopMargin>1in</TopMargin>
<BottomMargin>1in</BottomMargin>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="BIDatabase">
<DataSourceReference>VSPDEV011</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>f3bf5788-4fb5-4822-89d9-2f4518f5488d</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="BudgetData">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<QueryParameters>
<QueryParameter Name="@CostType">
<Value>=Parameters!CostType.Value</Value>
</QueryParameter>
<QueryParameter Name="@Year">
<Value>=Parameters!Year.Value</Value>
</QueryParameter>
</QueryParameters>
<CommandText>SELECT ProjectNumber, ProjectDescription, WBS, TaskNumber, TaskName, TaskDescription, TaskManager, Results, ResourceExpenditure, CostSet, Currency,
ReportingDate, Value, YEAR(ReportingDate) AS Year, { fn MONTHNAME(ReportingDate) } AS Month, ActualValue, PriorEAC
FROM vwForecastAccuracy
WHERE (CostSet IN (@CostType)) AND (YEAR(ReportingDate) = @Year) AND (Results = 'Cost')</CommandText>
</Query>
<Fields>
<Field Name="ProjectNumber">
<DataField>ProjectNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ProjectDescription">
<DataField>ProjectDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="WBS">
<DataField>WBS</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskNumber">
<DataField>TaskNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskName">
<DataField>TaskName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskDescription">
<DataField>TaskDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TaskManager">
<DataField>TaskManager</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Results">
<DataField>Results</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ResourceExpenditure">
<DataField>ResourceExpenditure</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CostSet">
<DataField>CostSet</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Currency">
<DataField>Currency</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ReportingDate">
<DataField>ReportingDate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="Value">
<DataField>Value</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Year">
<DataField>Year</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="Month">
<DataField>Month</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ActualValue">
<DataField>ActualValue</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="PriorEAC">
<DataField>PriorEAC</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="ProjectLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT ProjectNumber, ProjectDescription, ProjectNumber AS Expr1
FROM vwForecastAccuracy</CommandText>
</Query>
<Fields>
<Field Name="ProjectNumber">
<DataField>ProjectNumber</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ProjectDescription">
<DataField>ProjectDescription</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Expr1">
<DataField>Expr1</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="CostTypeLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT CostSet, CostSet AS CostSetDesc
FROM vwForecastAccuracy
UNION
SELECT NULL AS Expr1, 'All' AS CostSetDesc
ORDER BY CostSet</CommandText>
</Query>
<Fields>
<Field Name="CostSet">
<DataField>CostSet</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CostSetDesc">
<DataField>CostSetDesc</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="YearLookup">
<Query>
<DataSourceName>BIDatabase</DataSourceName>
<CommandText>SELECT DISTINCT YEAR(ReportingDate) AS Year
FROM vwForecastAccuracy
ORDER BY Year</CommandText>
</Query>
<Fields>
<Field Name="Year">
<DataField>Year</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<ReportParameters>
<ReportParameter Name="Year">
<DataType>String</DataType>
<Prompt>Year</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>YearLookup</DataSetName>
<ValueField>Year</ValueField>
<LabelField>Year</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>
<ReportParameter Name="CostType">
<DataType>String</DataType>
<Prompt>Cost Set</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>CostTypeLookup</DataSetName>
<ValueField>CostSet</ValueField>
<LabelField>CostSetDesc</LabelField>
</DataSetReference>
</ValidValues>
<MultiValue>true</MultiValue>
</ReportParameter>
</ReportParameters>
<Language>en-US</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>19da6d82-a69b-4bb7-a634-2fee3191c5d8</rd:ReportID>
</Report>
Andrew Payze -
Re: not exists SQL using ! filter expression with a variable
This is still not producing the correct result set in Kodo JDO 3.0.0RC4. I
see the following SQL statement in the log.
DEBUG ExecuteThread: '10' for queue: 'default' kodo.jdbc.SQL - <t 7720801,
conn 5232795> [10 ms] executing prepstmnt 1654874 SELECT DISTINCT t0.pk,
t0.JDOCLASS, t0.JDOVERSION, t0.AEndPoint, t0.AEndPointType, t0.DS0, t0.DS1,
t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint, t0.ZEndPointType, t0.adminState,
t0.creationDate, t0.speckey, t0.spectype, t0.description,
t0.lastModifiedDate, t0.lastModifiedUserId, t0.lastupdate, t0.name, t0.note,
t0.previousVersion, t0.resourceBusinessName, t0.signalType, t0.supporting,
t0.direction, t0.validForEnd, t0.validForStart FROM dschannel t0 CROSS JOIN
channelsegment t1 WHERE (NOT (t0.pk = t1.channel AND t0.supporting = ? AND
(t1.validForEnd > ? OR t1.validForStart < ?))) [params=(String)
101/DS3/LOC01/LOC02, (Timestamp) 2001-07-24 20:29:14.0, (Timestamp)
2038-01-18 22:14:07.0]
INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
resultSet size=0
It looks to me like the CROSS JOIN is not the right join to be using. ---
unless I am doing something altogether incorrect in the JDO Query itself,
which is highly likely.
Ben
"Ben Eng" <[email protected]> wrote in message news:...
Using Kodo JDO 2.5.3, I am attempting to do queries of the following form:
select * from dschannel as c
where not exists (select pk from channelsegment as s
where c.pk = s.channel and
c.supporting = ? and
(s.validForEnd > ? or
s.validForStart < ?));
select * from dschannel as c
left join channelsegment as s
on c.pk = s.channel and
c.supporting = ? and
(s.validForEnd > ? or
s.validForStart < ?)
where s.channel is null;
The code looks like this:
extent = pm.getExtent( ChannelValue.class, true );
query = pm.newQuery( this.extent );
query.declareImports( "import
com.metasolv.resources.entity.connection.ChannelSegmentValueImpl; import
java.util.Date;" );
query.declareParameters( "String pConn, Date pStart, Date pEnd" );
query.declareVariables( "ChannelSegmentValueImpl assign" );
String filter = "! (key == assign.channel && supportingConnection == pConn
&& (assign.validForEnd > pStart || assign.validForStart < pEnd))";
query.setFilter( filter );
resultSet = (java.util.Collection) query.execute( connection,
interval.getStartDateTime(), interval.getEndDateTime() );
I am seeing the following Exception with mysql 4.0.15 and mysql connector
JDBC driver 3.0.8:
com.solarmetric.kodo.runtime.DataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t> 0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,t0.signalType,> t0.supporting, t0.direction, t0.validForEnd, t0.validForStart FROMDSChannel> t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK = t1.channel AND> t0.supporting = ? AND (t1.validForEnd > ? OR t1.validForStart < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0"
at
com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
tions.java:64)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
reManager.java:1167)
at
com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
26)
at
com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
ryImpl.java:1565)
at
com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
ryImpl.java:1401)
at
com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
>
atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
>
at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:55)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
>
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
NestedThrowablesStackTrace:
java.sql.SQLException: Syntax error or access violation, message from
server: "You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'WHERE NOT (t0.PK = t1.channel AND t0.supporting = '101/DS3/LOC0"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedSta
tementWrapper.java:93)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryI
nternal(SQLExecutionManagerImpl.java:707)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(
SQLExecutionManagerImpl.java:600)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
tionManagerImpl.java:355)
at
com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.selectPrimaryMappings(
ClassMapping.java:1743)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
reManager.java:1136)
at
com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
26)
at
com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
ryImpl.java:1565)
at
com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
ryImpl.java:1401)
at
com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
>
atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
>
at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:55)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
>
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
ignoring exception
javax.oss.IllegalArgumentException:
com.solarmetric.kodo.runtime.DataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK => t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? ORt1.validForStart> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0"
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:61)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
>
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
BenBen-
Is the SQL statement that is being executed returning incorrect results,
or is it causing an exception with the MySQL server?
If the former, can you describe the results you are seeing? If the
latter, can you post the stack trace?
In article <[email protected]>, Ben Eng wrote:
This is still not producing the correct result set in Kodo JDO 3.0.0RC4. I
see the following SQL statement in the log.
DEBUG ExecuteThread: '10' for queue: 'default' kodo.jdbc.SQL - <t 7720801,
conn 5232795> [10 ms] executing prepstmnt 1654874 SELECT DISTINCT t0.pk,
t0.JDOCLASS, t0.JDOVERSION, t0.AEndPoint, t0.AEndPointType, t0.DS0, t0.DS1,
t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint, t0.ZEndPointType, t0.adminState,
t0.creationDate, t0.speckey, t0.spectype, t0.description,
t0.lastModifiedDate, t0.lastModifiedUserId, t0.lastupdate, t0.name, t0.note,
t0.previousVersion, t0.resourceBusinessName, t0.signalType, t0.supporting,
t0.direction, t0.validForEnd, t0.validForStart FROM dschannel t0 CROSS JOIN
channelsegment t1 WHERE (NOT (t0.pk = t1.channel AND t0.supporting = ? AND
(t1.validForEnd > ? OR t1.validForStart < ?))) [params=(String)
101/DS3/LOC01/LOC02, (Timestamp) 2001-07-24 20:29:14.0, (Timestamp)
2038-01-18 22:14:07.0]
INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
resultSet size=0
It looks to me like the CROSS JOIN is not the right join to be using. ---
unless I am doing something altogether incorrect in the JDO Query itself,
which is highly likely.
Ben
"Ben Eng" <[email protected]> wrote in message news:...
Using Kodo JDO 2.5.3, I am attempting to do queries of the following form:
select * from dschannel as c
where not exists (select pk from channelsegment as s
where c.pk = s.channel and
c.supporting = ? and
(s.validForEnd > ? or
s.validForStart < ?));
select * from dschannel as c
left join channelsegment as s
on c.pk = s.channel and
c.supporting = ? and
(s.validForEnd > ? or
s.validForStart < ?)
where s.channel is null;
The code looks like this:
extent = pm.getExtent( ChannelValue.class, true );
query = pm.newQuery( this.extent );
query.declareImports( "import
com.metasolv.resources.entity.connection.ChannelSegmentValueImpl; import
java.util.Date;" );
query.declareParameters( "String pConn, Date pStart, Date pEnd" );
query.declareVariables( "ChannelSegmentValueImpl assign" );
String filter = "! (key == assign.channel && supportingConnection == pConn
&& (assign.validForEnd > pStart || assign.validForStart < pEnd))";
query.setFilter( filter );
resultSet = (java.util.Collection) query.execute( connection,
interval.getStartDateTime(), interval.getEndDateTime() );
I am seeing the following Exception with mysql 4.0.15 and mysql connector
JDBC driver 3.0.8:
com.solarmetric.kodo.runtime.DataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t>> 0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,> t0.signalType,>> t0.supporting, t0.direction, t0.validForEnd, t0.validForStart FROM> DSChannel>> t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK = t1.channel AND>> t0.supporting = ? AND (t1.validForEnd > ? OR t1.validForStart < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0"
at
com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwDataStore(SQLExcep
tions.java:64)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
reManager.java:1167)
at
com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
26)
at
com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
ryImpl.java:1565)
at
com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
ryImpl.java:1401)
at
com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:55)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
NestedThrowablesStackTrace:
java.sql.SQLException: Syntax error or access violation, message from
server: "You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'WHERE NOT (t0.PK = t1.channel AND t0.supporting = '101/DS3/LOC0"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1538)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedSta
tementWrapper.java:93)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryI
nternal(SQLExecutionManagerImpl.java:707)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(
SQLExecutionManagerImpl.java:600)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
tionManagerImpl.java:355)
at
com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.selectPrimaryMappings(
ClassMapping.java:1743)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
reManager.java:1136)
at
com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.executeQuery(JDBCQuery.java:1
26)
at
com.solarmetric.kodo.query.QueryImpl$DatastoreQueryExecutor.executeQuery(Que
ryImpl.java:1565)
at
com.solarmetric.kodo.query.QueryImpl$AggregateQueryExecutor.executeQuery(Que
ryImpl.java:1401)
at
com.solarmetric.kodo.query.QueryImpl.executeQueryWithMap(QueryImpl.java:685)
atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:545)
at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:531)
at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:513)
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:55)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
INFO ExecuteThread: '10' for queue: 'default' com.metasolv.oss.inventory -
ignoring exception
javax.oss.IllegalArgumentException:
com.solarmetric.kodo.runtime.DataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0" [code=1064;state=42000]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = '101/DS3/LOC01/LOC02' AND (t1.validForEnd >>> {ts '2001-07-24 20:59:49.0' OR t1.validForStart < {ts '2038-01-18
22:14:07.0'}))]
[PRE=SELECT DISTINCT t0.PK, t0.JDOCLASSX, t0.JDOLOCKX, t0.AEndPoint,
t0.AEndPointType, t0.DS0, t0.DS1, t0.DS2, t0.DS3, t0.DS4, t0.ZEndPoint,
t0.ZEndPointType, t0.adminState, t0.creationDate, t0.SPECKEY, t0.SPECTYPE,
t0.description, t0.lastModifiedDate, t0.lastModifiedUserId, t0.LASTUPDATE,
t0.name, t0.note, t0.previousVersion, t0.resourceBusinessName,
t0.signalType, t0.supporting, t0.direction, t0.validForEnd,
t0.validForStart>> FROM DSChannel t0 LEFT OUTER JOIN ChannelSegment t1 WHERE NOT (t0.PK =>> t1.channel AND t0.supporting = ? AND (t1.validForEnd > ? OR> t1.validForStart>> < ?))
Syntax error or access violation, message from server: "You have an error
in your SQL syntax. Check the manual that corresponds to your MySQLserver
version for the right syntax to use near 'WHERE NOT (t0.PK = t1.channelAND
t0.supporting = '101/DS3/LOC0"
at
com.metasolv.resources.queries.ChannelAvailabilityQueryBean.execute(ChannelA
vailabilityQueryBean.java:61)
at
com.metasolv.oss.inventory.InventorySessionBean.queryInventory(InventorySess
ionBean.java:1343)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl.queryInventory
(InventorySessionBean_xf0gis_EOImpl.java:3998)
at
com.metasolv.oss.inventory.InventorySessionBean_xf0gis_EOImpl_WLSkel.invoke(
Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:821)
at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
Ben
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com
Maybe you are looking for
-
I am having a very difficult time with accessing my music from the cloud. I need to have itunes open on my laptop in order for it to work. And as soon as I close out itunes on my laptop, it gives me a warning that all users will be logged out. Hel
-
How to make use of variable present in sap standard FM to custom badi.
Hi All, Scenario: I am using a transaction which makes use of SAP standard FM. Also I have used a zbadi to achieve my requirement. While debugging, I found that when the control goes to zbadi, i am unable to make use of the variables which are define
-
HTTP reciever adapter pass URL parameters
Hello all, I have a question regarding passing parameters as querystring in the url of reiever HTTP adapter. This is an RFC> XI> HTTP scenario and we're posting to an external URL. Here are the details URL: xxxx.yyyyy.com Service Number: 80 Path: /ap
-
Problem in displaying data in sapscript
Hi, I am working on the sapscript for the tcode QC21 and the form name is 'YQM_QCERT_02'. here the data is represented in the column wise and i want to disply the data row wise. Plzz provide me guidlines how to display the row wise data in the SAPSCR
-
Why do we see "Course Image" on Public Sites?
Whenever we fail to provide an image for a channel/collection, iTunes U comes up with a placeholder image instead. That's the good part. The bad and confusing (to Contributors) part is that this placeholder image says, "Course Image" which I assume