SQL in reports filter expression

Hi All,
I want to filter the report using the 'in' operator and specify a SQL as the expression. I want apex to be use the result of the query as the list of values for the 'in' operator. Is this supported?
for example can I specify the filter as 'user_name in (select name from user_name_tab where group_id = 10)'
Thanks
Edited by: vmedi on Jan 3, 2012 2:53 PM
Edited by: vmedi on Jan 3, 2012 2:53 PM

Hi Micek,
Thanks for your quick reaction.
Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
I just am testing it with constant values in the Answers module.
The problem seems to be that it is not allowed to use a sub-query in the filter expression.
The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
I guess not all regular SQL is allowed in filter expressions.
And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
I need some alternative for the subquery, but one that is allowed in the filter expression.
The problem is based on the fact that the user chooses a different value then the one that is filtered on.
The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
Because I need a between value, wich does not make sense for a timePeriod element
such as '01-08' or 'JAN-08'.
Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
The error says:      
Error getting drill information: SELECT "....
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
Any input is welcome
kind regards

Similar Messages

  • Using sql in the filter expression

    For a project I need to use a filter which is a construction
    with BETWEEN dateFrom AND dateTo.
    But the user does not choose these datevalues,
    he chooses timePeriods which have a unique startDate.
    The dashboard prompts are populated with these timePeriods and the user chooses 2 of these and 2
    presentation variables are set.
    Now I need to retrieve the according startDate for a chosen timePeriod.
    I tried to do this using a sub-query in the filter expression,
    but this seems not to be valid in Answers.
    In standard SQL it is expressed like this:
    select table1.* from table1
    where table1.dateValue  BETWEEN
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue1')+
    AND
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue2')+
    The return of the subqueries are single row, as it should in such constructions.
    I want the where clause to be in the filter expression for the dateValue column in Answers.(trimming of the WHERE keyword)
    Is there any other construction that does this trick in the BI Answers/Dashboard environment to do this?
    Kind regards

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • Interactive Report Filter Expression

    I am a (new) user not a developer.
    The Apex developer has presented me with a web page containing an Interactive Report interface.
    I seem to be managing just fine, for the most part, except to make a filter with multiple OR statements.
    I can easily make multiple AND statements.
    Is there some trick or special way to write the filter statement (OR is this just not possible with Interactive Report - excuse the pun)
    Please help, the developer is stumped!

    I don't think it's possible (someone can correct me if I am wrong) in 3.2.x, but certainly possible in version 4.
    Taken from the Interactive Report help page:
    FilterFocuses the report by adding or modifying the WHERE clause on the query. You can filter on a column or by row.
    If you filter by column, select a column (it does not need to be one that displays), select a standard Oracle operator (=, !=, not in, between), and enter an expression to compare against. Expressions are case sensitive. Use % as a wild card (for example, STATE_NAME like A%).
    If you filter by row, you can create complex WHERE clauses using column aliases and any Oracle functions or operators (for example, G = 'VA' or G = 'CT', where G is the alias for CUSTOMER_STATE).>
    Ta,
    Trent

  • 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)
    Ben

    Ben-
    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

  • QSUF (Query string url filter) and SQL Server reporting services report viewer parameters

    Hi,
    this is my issue:
    I have a SQL Server reporting services web part on a page with a report with 1 parameter, lets say it's a client list
    Then i have a QSUF that will be used to filter the clients list through the URL
    However, once i connect the filter and the report viewer web part, the parameter goes away and is no longer accessible
    I'd like to somehow keep the parameter visible, in case there is no parameter sent through the URL, i would like the user to be able to choose a client from the parameter drop down list
    I saw that there is a "send empty if no values are passed" option, but i can't seem to get this working properly and i don't know if this option will make the parameter visible again
    Any help would be appreciated
    Thanks.

    Hi,
    According to your post, my understanding is that the query string url filter web part not worked well with SQL server reproting services web part.
    Did you use the Wiki page layout in your environment?
    You can change the page to a web part page, then check whether it work.
    There is a similar thread for your reference.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/4d7584e3-8e1a-48bf-9346-32f8cb480dd1/query-string-url-filter-web-part?forum=sharepointgeneralprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to fix a report textbox aggregate expression error in SQL server reporting with multiple datasets?

    I have a SQL Server Reporting Services report that has a textbox within a Report with variations of the following expression 
    =Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) / Sum(Iif(Fields!PointID.Value = 500, 1, 0)) 
    I see the following error when I try to preview the report: 
    The Value expression for the text box ‘Textbox2’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset. 
    What am I missing in this this expression to make it run incorrectly

    Can you include dataset name in your sum functions? e.g. Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) 
    and 
    Iif(Fields!PointID.Value = 500, 1, 0)) should include your dataset name as Sum(IiF(Fields!RegisterID.Value = 6000, 1, 0) and Iif(Fields!PointID.Value = 500, 1, 0),"datasetname")Like wise  Sum(Iif(Fields!PointID.Value = 500, 1, 0))  should also have dataset name Sum(Iif(Fields!PointID.Value = 500, 1, 0),"datasetname") 
    Gaur

  • 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.

  • SQL Server Reporting Services in SQL Server Express 2012

    I installed SQL Server Express 2012 but cannot find SQL Server Reporting Services.
    Is it possible to use SSRS in SQL Server Express 2012?
    If possible, where do I get so that I could install it and make environment?

    Hi ,
     Did you get a chance to look into the below link
    http://blogs.msdn.com/b/mvpawardprogram/archive/2014/03/10/adding-sql-server-express-2012-advanced-services-to-existing-development-environment.aspx
    Best Regards Sorna

  • SQL Server Reporting Services FAQ

    Hi All,
    This thread is a summary of the Frequently Asked Questions on SQL Server Reporting Services. We consolidate them and post here for your reference. If you have any further questions, please kindly start a new thread so that more community members, MVPs, and MSFTs can join the discussion and share their ideas. Thanks for your understanding.
    Part I: SQL Server Reporting Services General Topics
    1. How to migrate SQL Server 2008 Reporting Services to another computer?
    2. How to combine connecting string via parameter?
    3. How to install a 32-bit version of SQL Server 2005 Reporting Services on a computer that is running a 64-bit version of Windows?
    4. Error of EXECUTE permission denied on object 'xp_sqlagent_notify'.
    5. Security consideration for anonymous access to Report Server.
    6. How to create a custom report template in Reporting Services?
    7. Does Reporting Services support horizontal tables which have fixed rows and dynamic columns?
    8. How to reset the page number back to 1 every time the report gets a group break?
    9. How to open the drill- through report in a new browser window?
    10. How to verify the version of SQL Server?
    11. How to use multiple datasets?
    12. How to upgrade report from SQL Server 2000 to SQL Server 2005?
    13. Out of memory error when exporting reports to Excel.
    14. How to improve PDF quality of the report exported in Reporting Services 2005?
    15. How to enable the Select All option for a multi-value parameter?
    Part II: SQL Server Reporting Services SharePoint Integrated Mode Topics
    1. How to deploy reports to SQL Server Reporting Services in SharePoint Services integrated mode?
    2. How to integrate SQL Server Reporting Services and SharePoint Services?
    3. How to refer the reports on the Report Server in SharePoint Services?
    4. How to manage user to view reports in SharePoint integrated mode?
    5. What information is needed when posting questions regarding SharePoint integrated mode?
    6. Is Report Builder available in SharePoint Integrated Mode?
    PLEASE NOTE: Microsoft does not offer formal support for the communities you'll find here. Instead, our role is to provide a platform for people who want to take advantage of the global community of Microsoft customers and product experts. Microsoft may monitor content to ensure the accuracy of the information you'll find, but any information provided by Microsoft staff is offered "AS IS" with no warranties, and no rights are conferred. You assume all risk for your use.
    Microsoft Online Community Support

    1.        Question 3: How to install a 32-bit version of SQL Server 2005 Reporting Services on a computer that is running a 64-bit version of Windows?
    Answer: 
    To install the 32-bit version of Reporting Services on a computer that is running the 64-bit version of IIS 6.0, we can follow these following steps:
    1.       Uninstall the 64-bit version of Reporting Services.
    Note: Side-by-side installations of 32-bit versions of Reporting Services and 64-bit versions of Reporting Services are not supported.
    2.       Run the Dotnetfx64.exe file to manually install the .NET Framework.
    The Dotnetfx64.exe file is in the Tools\redist\2.0 folder on the SQL Server 2005 Setup media. To download the Dotnetfx64.exe file, visit the following Microsoft Web site:
    http://go.microsoft.com/fwlink/?LinkId=70186
    3.       In IIS Manager, click Web Server Extensions.
    4.       In the Details pane, right-click ASP.NET V2.0.50727, and then click Allow.
    5.       Right-click Web Sites, and then click Properties.
    6.       Click the ISAPI Filters tab.
    7.       In the Filter Name column, click ASP.NET_2.0.50727, and then click Edit.
    8.       Replace C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll with C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll.
    Note: The Aspnet_filter.dll file in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ folder is a 32-bit version of the file.
    9.       Click OK two times, and then close IIS Manager.
    10.   At a command prompt, run the following command:
    cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1
    11.   Install the 32-bit version of Reporting Services.
    12.   After setup is complete, open IIS Manager, and then click Web Server Extensions.
    13.   In the Details pane, right-click ASP.NET V2.0.50727 (32-bit), and then click Allow.
    To install the 32-bit version of Reporting Services on a computer that is running the 64-bit version of IIS 7.0, follow these steps:
    1.       Enable ASP.NET and IIS before you install Reporting Services.
    2.       Open a command prompt. To do this, click Start, point to All Programs, point to Accessories, right-click Command Prompt, and then click Run as administrator.
    3.       In the User Account Control dialog box, click Continue.
    4.       Copy the following script:
    cscript %SystemDrive%\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1
    5.       In the upper-left corner of the Command Prompt window, right-click the command prompt icon, click Edit, and then click Paste.
    6.       Press ENTER to run the script.
    7.       Install the 32-bit version of Reporting Services. You must apply SQL Server 2005 Service Pack 2 (SP2) after you install Reporting Services in Windows Vista. If you install SQL Server 2005 Express Edition with Advanced Services, you can run SQL Server 2005 Express Edition with Advanced Services SP2.
    For more information, visit the following Microsoft Web site:
    Microsoft SQL Server 2005 Express Edition with Advanced Services Service Pack 2
    http://go.microsoft.com/fwlink/?LinkID=63922
    8.       Reset IIS.
    9.       Configure the report server for local administration. To access the report server and Report Manager locally, follow these steps:
    a.       Start Microsoft Internet Explorer.
    b.      On the Tools menu, click Internet Options.
    c.       Click Security.
    d.      Click Trusted Sites.
    e.      Click Sites.
    f.        Under Add this website to the zone, type http://servername.
    g.       If you are not using HTTPS for the default site, click to clear the Require server certification (https:) for all sites in this zone check box.
    h.      Click Add.
    i.         Repeat steps f and g to add http://localhost, and then click Close.
    10.   This step lets you start Internet Explorer either to localhost or to the network computer name of the server for both Report Server and Report Manager.
    a.       Create role assignments that explicitly grant you full-permissions access. To do this, follow these steps:  
    b.      Start Internet Explorer by using the Run as administrator option. To do this, click Start, click All Programs, right-click Internet Explorer, and then click Run as administrator.
    c.       Start Report Manager.
    d.      Note By default, the Report Manager URL is http://servername/reports. If you are using SQL Server 2005 Express Edition with Advanced Services SP2, the Report Manager URL is http://servername/reports$sqlexpress. If you are using a named instance of Reporting Services, the Report Manager URL is http://servername/reports$InstanceName
    e.      On the Home page, click Properties.
    f.        Click New Role Assignment.
    g.       Type a Windows user account in the following format: domain\user
    h.      Click to select the Content Manager check box.
    i.         Click OK.
    j.        In the upper-right corner of the Home page, click Site Settings.
    k.       Click Configure site-wide security.
    l.         Click New Role Assignment.
    m.    Type a Windows user account in the following format: domain\user
    n.      Click to select the System Administrator check box.
    o.      Click OK.
    p.      Close Report Manager.
    11.   Open Report Manager in Internet Explorer without using the Run as administrator option.
    Microsoft Online Community Support

  • Filter expression producing different results after upgrade to 11.1.1.7

    Hello,
    We recently did an upgrade and noticed that on a number of reports where we're using the FILTER expression that the numbers are very inflated. Where we are not using the FILTER expression the numbers are as expected. In the example below we ran the 'Bookings' report in 10g and came up with one number and ran the same report in 11g (11.1.1.7.0) after the upgrade and got two different results. The data source is the same database for each envrionment. Also, in running the physical SQL generated by the 10g and 11g version of the report we get different the inflated numbers from the 11g SQL. Any ideas on what might be happening or causing the issue?
    10g report: 2016-Q3......Bookings..........72,017
    11g report: 2016-Q3......Bookings..........239,659
    This is the simple FILTER expression that is being used in the column formula on the report itself for this particular scenario which produces different results in 10g and 11g.
    FILTER("Fact - Opportunities"."Won Opportunity Amount" USING ("Opportunity Attributes"."Business Type" = 'New Business'))
    -------------- Physical SQL created by 10g report -------- results as expected --------------------------------------------
    WITH
    SAWITH0 AS (select sum(case when T33142.OPPORTUNITY_STATUS = 'Won-closed' then T33231.USD_LINE_AMOUNT else 0 end ) as c1,
    T28761.QUARTER_YEAR_NAME as c2,
    T28761.QUARTER_RANK as c3
    from
    XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ,
    XXFI.XXFI_OSM_OPPTY_HEADER_ACCUM T33142 /* Fact_Opportunity_Headers(CloseDate) */ ,
    XXFI.XXFI_OSM_OPPTY_LINE_ACCUM T33231 /* Fact_Opportunity_Lines(CloseDate) */
    where ( T28761.PERIOD_NAME = T33142.CLOSE_PERIOD_NAME and T28761.QUARTER_YEAR_NAME = '2012-Q3' and T33142.LEAD_ID = T33231.LEAD_ID and T33231.LINES_BUSINESS_TYPE = 'New Business' and T33142.OPPORTUNITY_STATUS <> 'Duplicate' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK)
    select distinct SAWITH0.c2 as c1,
    'Bookings10g' as c2,
    SAWITH0.c1 as c3,
    SAWITH0.c3 as c5,
    SAWITH0.c1 as c7
    from
    SAWITH0
    order by c1, c5
    -------------- Physical SQL created by the same report as above but in 11g (11.1.1.7.0) -------- results much higher --------------------------------------------
    WITH
    SAWITH0 AS (select sum(case when T33142.OPPORTUNITY_STATUS = 'Won-closed' then T33142.TOTAL_OPPORTUNITY_AMOUNT_USD else 0 end ) as c1,
    T28761.QUARTER_YEAR_NAME as c2,
    T28761.QUARTER_RANK as c3
    from
    XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ,
    XXFI.XXFI_OSM_OPPTY_HEADER_ACCUM T33142 /* Fact_Opportunity_Headers(CloseDate) */ ,
    XXFI.XXFI_OSM_OPPTY_LINE_ACCUM T33231 /* Fact_Opportunity_Lines(CloseDate) */
    where ( T28761.PERIOD_NAME = T33142.CLOSE_PERIOD_NAME and T28761.QUARTER_YEAR_NAME = '2012-Q3' and T33142.LEAD_ID = T33231.LEAD_ID and T33231.LINES_BUSINESS_TYPE = 'New Business' and T33142.OPPORTUNITY_STATUS <> 'Duplicate' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK),
    SAWITH1 AS (select distinct 0 as c1,
    D1.c2 as c2,
    'Bookings2' as c3,
    D1.c3 as c4,
    D1.c1 as c5
    from
    SAWITH0 D1),
    SAWITH2 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    sum(D1.c5) as c6
    from
    SAWITH1 D1
    group by D1.c1, D1.c2, D1.c3, D1.c4, D1.c5)
    select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5, D1.c6 as c6 from ( select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    sum(D1.c6) over () as c6
    from
    SAWITH2 D1
    order by c1, c4, c3 ) D1 where rownum <= 2000001
    Thank you,
    Mike
    Edited by: Mike Jelen on Jun 7, 2013 2:05 PM

    Thank you for the info. They are definitely different values since ones on the header and the other is on the lines. As the "Won Opportunity" logical column is mapped to multiple LTS it appears the OBI 11 uses a different alogorthim to determine the most efficient table to use in the query generation vs 10g. I'll need to spend some time researching the impact to adding a 'sort' to the LTS. I'm hoping that there's a way to get OBI to use similar logic relative to 10g in how it generated the table priority.
    Thx again,
    Mike

  • Filter Object with Filter Expression error.

    Hello everyone!
    I'm trying to put together the following expression for a filter to be used in a report:
    Order Date -> object name = M1 - (number, measure)
    Current Date -> object name = M2 - (number, measure)
    Comparison between the two:
    <EXPRESSION> IIF (@ Select (M1) = @ Select (M2), 1.0) </EXPRESSION>
    object name 3
    So far everything works fine.
    When I create a report in Web and I put the filter M3 = 1, it filters properly.
    I thought of putting the filter in a filter object in the universe, like this:
    <FILTER EXPRESSION = "Select @ (M3)"> <CONDITION
    OPERATORCONDITION = "Equal"> <CONSTANT CAPTION="1"/></CONDITION></FILTER>
    Just as it is in Olap universes best practices written by Didier. (Page 12), as following example:
    Filter with a calculated member referenced in the filter expression:
    <FILTER EXPRESSION="@Select(Calendar Year\My Calculated Member)"><CONDITION
    OPERATORCONDITION="Equal"><CONSTANT CAPTION="1"/></CONDITION></FILTER
    But does not work when I put the query, the error is dpscommand. And I have no idea where the error is.
    The strange thing is it works, if I filter the query directly. ( Query filter: M3 equal 1).
    Do you have any tips? or something I could try that I have the M3 as a filter object?
    Tks a lot!
    Livia
    I am working on BO XI R3 - SP2 and the basead query is on SAP BW 7.0.

    macearl wrote:
    SQL View does not display unless data is returned by the query. Is that normal?
    Also, none of these options shows the literal result of the expression we built, i.e.:
    expression: CAST(YEAR(TIMESTAMPADD(SQL_TSI_MONTH, -24, CURRENT_DATE)) as CHAR)
    result: *2008*
    Having the ability to test expressions and see their results would be very helpful in debugging. If anyone knows how to do that please share!
    Thanks!
    MacOk, Probably shoud have figured this out before, but in response to my own question, the way to view the result of an expression is to add the expression as a column and include it in the Table Presentation.
    - Mac (he can be taught)

  • Error: Show Details cannot be executed when multiple items are selected in a report filter field or in a slicer

    I have connected TABULAR Model to Excel, and in the pivot the filter is on multiple dimensions. When doing the drillthrough action it gives error - Error: Show Details cannot be executed when multiple items are selected in a report filter field or in a slicer
    Is there any workaround to this error?  so that drillthrough can be done even with multiple selection.

    Hi Vikas,
    The reason behind the error message requires the knowledge on what happens at the backend. When you perform a drill-through action, a query is sent to Analysis Services. This query is expressed in a query language called Multi-Dimensional Expression (MDX).
    Since the MDX language doesnot support drill-through command against a set (collection of tuples) an error is persisted. 
    For now, there is no workaround as it is a limitation of the underlying language that is generating the query.
    When multiple items are selected you lose the ability to drill-down on individual metrics. To resolve you must either:
    1. Select a single Item.
    2. Select all items.
    Hope this helps!
    Please mark as Answer if this helps! Thanks, Rajasekhar.

  • Why do I get "Insufficient memory to continue the execution of the program" in SQL Service Report Services

    Hi fellas,
    I'm facing some serious issues with SSRS. I've tried to create a map report in SQL server reporting service 2008R2. I've insert a map using ESRI shapefile and connected it to my Dataset. Everything seemed to be fine up until I've tried to preview the results
    and I got this:
    I've tried to resolve the problem by increasing the "MaximumTotalPc", but then I got this:
    Ever since this happened my SSRS is acting like it has gotten a virus. I've tried to delete the report, but it doesn't let me and the window I've posted above keeps on popping up every few seconds while the program is open.
    Any idea why do I get it and how can I deal with it?
    P.S. I'm not any kind of developer and I'm not really familiar with the technical language. I need an explanation written in user friendly language, please :-)

    Hi Ellie55,
    According to your description that you are experiencing the issue when you are creating the ESRI shapefile map on the SSRS 2008 R2, you got some error “the number of map point elements for “Map1” exceeds the maximum limits for map” when you click  to
    preview the map, you trying to set the properties of “MaximumTotalPointCount” to fix this issue but cause another error about the “insufficient memory”, right?
    By default, a map can have 20,000 map elements or 1,000,000 points. If your map exceeds these limits, you can increase the MaximumTotalPointCount and the MaximumSpatialElementCount, but it may cause the insufficient memory because of the too much points
    and elements. So I recommend you that you can use one of the following approaches for you have got problem increase the limitations:
    Remove a layer.
    Decrease the map resolution.
    Decrease the map viewport coordinates to view a smaller area.
    If the spatial data comes from a report dataset, set a filter to limit the data from the dataset. The filter must be set on a field that is not a spatial data type.
    If the spatial data comes from a SQL Server database, change the query to use spatial functions to limit the data to a smaller area.
    Details information for your reference :
    http://prashantmishrasblog.blogspot.com/2012/10/using-map-in-ssrs-reports-part1.html
    http://msdn.microsoft.com/en-us/library/ee240843.aspx
    As you this error also caused you can’t delete the report, please try to close the program in the task manager and find the path of project in your computer to delete the .rdl file in your workspace and redesign the map again.
    Any problem, please feel free to ask
    Regards
    Vicky Liu

  • Setting a Default Value in SQL Query Report

    Hello:
    We are using a SQL Query Report to provide a mass update to a table. We are using the apex.collection and having it display a number of records in a SQL Query Report for mass update. We have 14 columns in the report, for which the first 11 are populated via the collection. The remaining 3 are open for input but the individual making the updates. We've were able to provide a default value for 2 of the remaining 3 columns using a named LOV's - however the fourth column we would like to default a sysdate - but we are not successful.
    We've attempted many things but none seem to work, including adding that column to the collection and assigning it a default sysdate value. We've also tried changing the settings in the report attributes --> Tabular Form Elements by setting the Display as to: Datepicker, Default type to PL/SQL Expression and setting the default to sysdate. We've also tried caputuring a date on the previous page and loading it onto the report page and trying to default the date column to a page item default.
    I'd appreciate any help.
    Thanks
    FYI - we are using version 3.2

    use as default
    to_char(sysdate, 'dd/mm/yyy') where the format is your application or item date format

  • 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
    -Jaz

    Edit: 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.

Maybe you are looking for