The Query returns a JBO Sql Exeptions of Invalid number

Here is the query which returns the Invalid number exception on a R12 environment -
SELECT feb.entity_id,
rel.parent_entity_id,
fetl.entity_name,
pfetl.entity_name parent_entity_name,
ccytl.currency_code,
ccytl.name AS currency_name,
fettl.entity_type_name,
fettl.entity_type_code,
rel.cons_relationship_id,
decode( fettl.entity_type_code,
'E', to_number(''),
decode( operassoc.parent_entity_id,
to_number(''), rel.ownership_percent,
to_number(''))) ownership_percent,
ttl.treatment_name,
cttl.curr_treatment_name,
decode( fettl.entity_type_code,
'O', 'Y',
'X', 'Y',
decode( rel.cons_relationship_id,
'', 'Y',
'N')) AS details_icon_displayed,
decode( fettl.entity_type_code,
'E', 'N',
'O', decode(feb.entity_id,
operassoc.child_entity_id, 'N',
'Y'),
'Y') AS add_entity_icon_displayed,
decode( fettl.entity_type_code,
'E', 'N',
'C', decode( rel.cons_relationship_id,
'', 'N',
'Y'),
decode( operassoc.parent_entity_id,
'', 'Y',
'N')) AS move_remove_icon_displayed,
decode( fettl.entity_type_code,
'E', 'N',
'C', decode( rel.cons_relationship_id,
'', decode( childassoc.child_entity_id,
'', 'N',
'Y'),
'Y'),
decode( operassoc.parent_entity_id,
'', 'Y',
'N')) AS create_update_icon_displayed,
decode( fettl.entity_type_code,
'E', 'N',
'C', decode( rel.cons_relationship_id,
'', 'N',
'Y'),
decode( operassoc.parent_entity_id,
'', 'Y',
'N')) AS update_update_icon_displayed,
imageattr.entity_image,
decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
rel.end_date,
decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
FROM FEM_ENTITIES_B feb,
FEM_ENTITIES_TL fetl,
FEM_ENTITIES_TL pfetl,
GCS_ENTITY_CONS_ATTRS eca,
FND_CURRENCIES_TL ccytl,
FEM_ENTITIES_ATTR fetea,
FEM_DIM_ATTRIBUTES_B fetda,
FEM_DIM_ATTR_VERSIONS_B fet_dav,
FEM_ENTITY_TYPES_TL fettl,
GCS_CONS_RELATIONSHIPS rel,
GCS_TREATMENTS_TL ttl,
GCS_CURR_TREATMENTS_TL cttl,
(SELECT operea.entity_id AS parent_entity_id,
operea.dim_attribute_numeric_member AS child_entity_id
FROM FEM_ENTITIES_ATTR operea,
FEM_DIM_ATTRIBUTES_B operda,
FEM_DIM_ATTR_VERSIONS_B oper_dav
WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
AND operda.attribute_id = operea.attribute_id
AND oper_dav.attribute_id = operda.attribute_id
AND oper_dav.default_version_flag = 'Y'
AND oper_dav.version_id = operea.version_id) operassoc,
(SELECT operea.entity_id AS parent_entity_id,
operea.dim_attribute_numeric_member AS child_entity_id
FROM FEM_ENTITIES_ATTR operea,
FEM_DIM_ATTRIBUTES_B operda,
FEM_DIM_ATTR_VERSIONS_B oper_dav
WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
AND operda.attribute_id = operea.attribute_id
AND oper_dav.attribute_id = operda.attribute_id
AND oper_dav.default_version_flag = 'Y'
AND oper_dav.version_id = operea.version_id) childassoc,
(SELECT imageea.entity_id,
imageea.varchar_assign_value AS entity_image
FROM FEM_ENTITIES_ATTR imageea,
FEM_DIM_ATTRIBUTES_B imageda,
FEM_DIM_ATTR_VERSIONS_B image_dav
WHERE imageda.attribute_varchar_label = 'IMAGE_NAME'
AND imageda.attribute_id = imageea.attribute_id
AND image_dav.attribute_id = imageda.attribute_id
AND image_dav.default_version_flag = 'Y'
AND image_dav.version_id = imageea.version_id) imageattr
WHERE feb.entity_id = fetl.entity_id
AND fetl.language = userenv('LANG')
AND eca.entity_id (+)= feb.entity_id
AND eca.hierarchy_id (+)= :1
AND ccytl.currency_code (+)= eca.currency_code
AND ccytl.language (+)= userenv('LANG')
AND fetea.entity_id = feb.entity_id
AND fetea.attribute_id = fetda.attribute_id
AND fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
AND fet_dav.attribute_id = fetda.attribute_id
AND fet_dav.default_version_flag = 'Y'
AND fet_dav.version_id = fetea.version_id
AND fettl.entity_type_code = fetea.dim_attribute_varchar_member
AND fettl.language = userenv('LANG')
AND rel.child_entity_id (+)= feb.entity_id
AND rel.hierarchy_id (+)= :2
AND rel.actual_ownership_flag (+)= 'Y'
AND pfetl.entity_id (+)= rel.parent_entity_id
AND pfetl.language (+)= userenv('LANG')
AND ttl.treatment_id (+)= rel.treatment_id
AND ttl.language (+)= userenv('LANG')
AND cttl.curr_treatment_id (+)= rel.curr_treatment_id
AND cttl.language (+)= userenv('LANG')
AND operassoc.child_entity_id (+)= rel.child_entity_id
AND operassoc.parent_entity_id (+)= rel.parent_entity_id
AND childassoc.parent_entity_id (+)= feb.entity_id
AND imageattr.entity_id (+)= feb.entity_id
AND (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
AND (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
ORDER BY decode( operassoc.parent_entity_id,
'', decode( entity_type_code,
'O', 2,
'C', 3,
'E', 4,
999),
1),
entity_name
Same query returns correct results in 11i environment.
This query fails at the executeQueryForCollection method.
Any ideas why?
Thanks - Alpi
Edited by: user581082 on Sep 17, 2009 1:16 AM

Here is the full Error Stack -
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT     feb.entity_id,
     rel.parent_entity_id,
     fetl.entity_name,
     pfetl.entity_name parent_entity_name,
     ccytl.currency_code,
     ccytl.name AS currency_name,
     fettl.entity_type_name,
     fettl.entity_type_code,
     rel.cons_relationship_id,
     decode(     fettl.entity_type_code,
          'E', to_number(''),
          decode(     operassoc.parent_entity_id,
               to_number(''), rel.ownership_percent,
               to_number(''))) ownership_percent,
     ttl.treatment_name,
     cttl.curr_treatment_name,
     decode(     fettl.entity_type_code,
          'O', 'Y',
          'X', 'Y',
          decode(     rel.cons_relationship_id,
               '', 'Y',
               'N')) AS details_icon_displayed,
     decode(     fettl.entity_type_code,
          'E', 'N',
          'O', decode(feb.entity_id,
operassoc.child_entity_id, 'N',
'Y'),
          'Y') AS add_entity_icon_displayed,
     decode(     fettl.entity_type_code,
          'E', 'N',
          'C', decode(     rel.cons_relationship_id,
                    '', 'N',
                    'Y'),
          decode(     operassoc.parent_entity_id,
               '', 'Y',
               'N')) AS move_remove_icon_displayed,
     decode(     fettl.entity_type_code,
          'E', 'N',
          'C', decode(     rel.cons_relationship_id,
                    '', decode(     childassoc.child_entity_id,
                              '', 'N',
                              'Y'),
                    'Y'),
          decode(     operassoc.parent_entity_id,
               '', 'Y',
               'N')) AS create_update_icon_displayed,
     decode(     fettl.entity_type_code,
          'E', 'N',
          'C', decode(     rel.cons_relationship_id,
                    '', 'N',
                    'Y'),
          decode(     operassoc.parent_entity_id,
               '', 'Y',
               'N')) AS update_update_icon_displayed,
     imageattr.entity_image,
     decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
     rel.end_date,
     decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
     decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
FROM     FEM_ENTITIES_B feb,
     FEM_ENTITIES_TL fetl,
     FEM_ENTITIES_TL pfetl,
     GCS_ENTITY_CONS_ATTRS eca,
     FND_CURRENCIES_TL ccytl,
     FEM_ENTITIES_ATTR fetea,
     FEM_DIM_ATTRIBUTES_B fetda,
     FEM_DIM_ATTR_VERSIONS_B fet_dav,
     FEM_ENTITY_TYPES_TL fettl,
     GCS_CONS_RELATIONSHIPS rel,
     GCS_TREATMENTS_TL ttl,
     GCS_CURR_TREATMENTS_TL cttl,
     (SELECT     operea.entity_id AS parent_entity_id,
          operea.dim_attribute_numeric_member AS child_entity_id
     FROM     FEM_ENTITIES_ATTR operea,
          FEM_DIM_ATTRIBUTES_B operda,
          FEM_DIM_ATTR_VERSIONS_B oper_dav
     WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
     AND     operda.attribute_id = operea.attribute_id
     AND     oper_dav.attribute_id = operda.attribute_id
     AND     oper_dav.default_version_flag = 'Y'
     AND     oper_dav.version_id = operea.version_id) operassoc,
     (SELECT     operea.entity_id AS parent_entity_id,
          operea.dim_attribute_numeric_member AS child_entity_id
     FROM     FEM_ENTITIES_ATTR operea,
          FEM_DIM_ATTRIBUTES_B operda,
          FEM_DIM_ATTR_VERSIONS_B oper_dav
     WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
     AND     operda.attribute_id = operea.attribute_id
     AND     oper_dav.attribute_id = operda.attribute_id
     AND     oper_dav.default_version_flag = 'Y'
     AND     oper_dav.version_id = operea.version_id) childassoc,
     (SELECT     imageea.entity_id,
          imageea.varchar_assign_value AS entity_image
     FROM     FEM_ENTITIES_ATTR imageea,
          FEM_DIM_ATTRIBUTES_B imageda,
          FEM_DIM_ATTR_VERSIONS_B image_dav
     WHERE     imageda.attribute_varchar_label = 'IMAGE_NAME'
     AND     imageda.attribute_id = imageea.attribute_id
     AND     image_dav.attribute_id = imageda.attribute_id
     AND     image_dav.default_version_flag = 'Y'
     AND     image_dav.version_id = imageea.version_id) imageattr
WHERE     feb.entity_id = fetl.entity_id
AND     fetl.language = userenv('LANG')
AND     eca.entity_id (+)= feb.entity_id
AND     eca.hierarchy_id (+)= :1
AND     ccytl.currency_code (+)= eca.currency_code
AND     ccytl.language (+)= userenv('LANG')
AND     fetea.entity_id = feb.entity_id
AND     fetea.attribute_id = fetda.attribute_id
AND     fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
AND     fet_dav.attribute_id = fetda.attribute_id
AND     fet_dav.default_version_flag = 'Y'
AND     fet_dav.version_id = fetea.version_id
AND     fettl.entity_type_code = fetea.dim_attribute_varchar_member
AND     fettl.language = userenv('LANG')
AND     rel.child_entity_id (+)= feb.entity_id
AND     rel.hierarchy_id (+)= :2
AND rel.actual_ownership_flag (+)= 'Y'
AND     pfetl.entity_id (+)= rel.parent_entity_id
AND     pfetl.language (+)= userenv('LANG')
AND     ttl.treatment_id (+)= rel.treatment_id
AND     ttl.language (+)= userenv('LANG')
AND     cttl.curr_treatment_id (+)= rel.curr_treatment_id
AND     cttl.language (+)= userenv('LANG')
AND     operassoc.child_entity_id (+)= rel.child_entity_id
AND     operassoc.parent_entity_id (+)= rel.parent_entity_id
AND     childassoc.parent_entity_id (+)= feb.entity_id
AND     imageattr.entity_id (+)= feb.entity_id
AND     (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
AND     (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
ORDER BY     decode(     operassoc.parent_entity_id,
               '', decode(     entity_type_code,
                         'O', 2,
                         'C', 3,
                         'E', 4,
                         999),
               1),
          entity_name) QRSLT WHERE PARENT_ENTITY_ID = :6
     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896)
     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)
     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2845)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
     at OA.jspService(_OA.java:212)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:797)
## Detail 0 ##
java.sql.SQLException: ORA-01722: invalid number
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
     at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
     at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
     at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
     at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
     at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
     at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
     at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
     at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
     at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
     at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
     at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
     at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
     at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
     at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
     at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
     at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
     at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
     at oracle.jbo.server.Serializer.activate(Serializer.java:274)
     at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
     at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
     at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
     at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
     at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
     at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
     at OA.jspService(_OA.java:212)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:797)
java.sql.SQLException: ORA-01722: invalid number
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
     at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
     at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
     at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
     at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
     at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
     at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
     at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
     at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
     at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
     at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
     at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
     at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
     at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
     at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
     at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
     at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
     at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
     at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
     at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
     at oracle.jbo.server.Serializer.activate(Serializer.java:274)
     at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
     at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
     at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
     at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
     at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
     at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
     at OA.jspService(_OA.java:212)
     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:797)

Similar Messages

  • Error "The Query Returned no Objects" while exporting Universe in UDT?

    Hi,
    I have created a Universe on top of BEx Query using UDT in SAP BO 4.1 and tried to Export the Universe to Repository the following error is appearing.
    "The Query Returned no Objects" so "The Universe couldn't be exported".
    Could you please suggest me what could be the issue and how to resolve this.
    Thanks & Regards,
    Ramana,
    +91 8008665199.

    What version of Oracle 9i are you using? Do you have a standard 'NLS_LANG' environment variable set on client's machines? Or do you set it to different values on different machines?
    Here is one of way you could get around it.
    Could you specify the export parameter 'STATISTICS=NONE' while exporting the table data?
    Try this and see.
    If this is successful, you could use the import utility as usual. You could always compute or estimate statistics on the table after import.

  • Is the query analyzer part of SQL Server?

    Hey all,
    I have installed SQL Server 2005 on windows 2003 server. It did not install the query analyzer.
    Is the query analyzer part of SQL Server or do we need to install it separately?
    Thank you,
    Bye.

    Is there something about this question that is related to Oracle? It would appear that you'd want to ask this over in an appropriate Microsoft SQL Server forum...
    Justin

  • Is the query analyzer part of sql server database?

    Hey all,
    I have installed SQL Server 2005 on windows 2003 server. It did not install the query analyzer.
    Is the query analyzer part of SQL Server or do we need to install it separately?
    Thank you,
    Bye.

    Why not ask it in a Microsoft forum ?
    Nicolas.

  • Please advise what is the query to identify a SQL executed time

    Hi all
    Please advise what is the query to identify a SQL executed time.
    eg, a DML executed at 16-Apr-2013 11:45hrs

    Try like..
    select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql order by LAST_LOAD_TIME desc

  • I have one contact that I can call but cannot text. A return text states it is an invalid number. How can I fix it?

    I have one contact that I can call but cannot text. A return text states it is an invalid number. I have erased and re-entered the contact, changed phone identification and tried resetting the network - none have worked. What else can I try?

    What kind of phone is this person using? If this is an iPhone, are you logged into iMessage. If this is not an iMessage, then I suggest you both contact AT&T. SMS which is what is used between non-iPhone devices or between an iPhone and non-iPhone device are a carrier function. There is no setting in iOS or on the iPhone that deals with SMS. If you are able to send iMessage and/or SMS to other people, then AT&T needs to either look into your account to ensure SMS is configured, or they need to look at this other person's phone to see what it is reporting as its number since it is coming back invalid for you.

  • How can I show all the results returned by a sql query?

    Hi guys,
    I need your help.
    Let's say I have one table: TableA. Fields of TableA are aleg, anon, apes. The following sentence can return, in general, several rows: select anon from TableA where aleg = somevalue. I'd like to show the result of column anon but no luck. If I try to show the results in a TextArea and the origin is an sql query only shows the first row value. I tried Show as: show as text (based in PLSQL) and coding an anonymous plsql block as
    DECLARE
    v_anon TableA.anon%TYPE;
    CURSOR v_cur IS
         select anon from TableA where aleg = somevalue;
    BEGIN
    OPEN v_cur;
    LOOP
    FETCH v_cur INTO v_anon;
    EXIT WHEN v_cur%NOTFOUND;
    :FIELD_IN_FORM := v_anon;
    END LOOP;
    CLOSE v_cur;
    END;
    but in this case it's not shown any result.
    So the first question is what kind of field should I use to show the result. And the second one is what can I do to being able to show all the results returned by the query (provided that is more than one single row).
    regards

    Hi Denes,
    Just starting with apex. I think I know how to show the results in a report region. I've simplified the posted question.
    A more detailed question would be: Suppose you have a region where you have put several text areas to accommodate the result of a multi-column query (lets say for TableA) that only returns one row, each column value returned put in a different text area. Also you want to show the values of other fields in TableB that depends on some value just retrieved from TableA and that you want all values retrieved (from TableA and the linked TableB) to be show in the same region. Is that possible? If yes, how?
    Thank you in advance

  • Can users see the query plan of a SQL query in Oracle?

    Hi,
    I wonder for a given sql query, after the system optimization, can I see the query plan in oracle? If yes, how to do that? thank you.
    Xing

    You can use explain plan in SQLPlus
    SQL>  explain plan for select * from user_tables;
    Explained.
    Elapsed: 00:00:01.63
    SQL> select * from table(dbms_xplan.display());
    PLAN_TABLE_OUTPUT
    Plan hash value: 806004009
    | Id  | Operation                       | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |          |  2014 |  1123K|   507   (6)| 00:00:07 |
    |*  1 |  HASH JOIN RIGHT OUTER          |          |  2014 |  1123K|   507   (6)| 00:00:07 |
    |   2 |   TABLE ACCESS FULL             | SEG$     |  4809 |   206K|    34   (3)| 00:00:01 |
    |*  3 |   HASH JOIN RIGHT OUTER         |          |  1697 |   873K|   472   (6)| 00:00:06 |
    |   4 |    TABLE ACCESS FULL            | USER$    |    74 |  1036 |     3   (0)| 00:00:01 |
    |*  5 |    HASH JOIN OUTER              |          |  1697 |   850K|   468   (6)| 00:00:06 |
    |   6 |     NESTED LOOPS OUTER          |          |  1697 |   836K|   315   (6)| 00:00:04 |
    |*  7 |      HASH JOIN                  |          |  1697 |   787K|   226   (8)| 00:00:03 |
    |   8 |       TABLE ACCESS FULL         | TS$      |    13 |   221 |     5   (0)| 00:00:01 |
    |   9 |       NESTED LOOPS              |          |  1697 |   759K|   221   (8)| 00:00:03 |
    |  10 |        MERGE JOIN CARTESIAN     |          |  1697 |   599K|   162  (10)| 00:00:02 |
    |* 11 |         HASH JOIN               |          |     1 |   326 |     1 (100)| 00:00:01 |
    |* 12 |          FIXED TABLE FULL       | X$KSPPI  |     1 |    55 |     0   (0)| 00:00:01 |
    |  13 |          FIXED TABLE FULL       | X$KSPPCV |   100 | 27100 |     0   (0)| 00:00:01 |
    |  14 |         BUFFER SORT             |          |  1697 | 61092 |   162  (10)| 00:00:02 |
    |* 15 |          TABLE ACCESS FULL      | OBJ$     |  1697 | 61092 |   161  (10)| 00:00:02 |
    |* 16 |        TABLE ACCESS CLUSTER     | TAB$     |     1 |    96 |     1   (0)| 00:00:01 |
    |* 17 |         INDEX UNIQUE SCAN       | I_OBJ#   |     1 |       |     0   (0)| 00:00:01 |
    |  18 |      TABLE ACCESS BY INDEX ROWID| OBJ$     |     1 |    30 |     1   (0)| 00:00:01 |
    |* 19 |       INDEX UNIQUE SCAN         | I_OBJ1   |     1 |       |     0   (0)| 00:00:01 |
    |  20 |     TABLE ACCESS FULL           | OBJ$     | 52728 |   411K|   151   (4)| 00:00:02 |
    Predicate Information (identified by operation id):
       1 - access("T"."FILE#"="S"."FILE#"(+) AND "T"."BLOCK#"="S"."BLOCK#"(+) AND
                  "T"."TS#"="S"."TS#"(+))
       3 - access("CX"."OWNER#"="CU"."USER#"(+))
       5 - access("T"."DATAOBJ#"="CX"."OBJ#"(+))
       7 - access("T"."TS#"="TS"."TS#")
      11 - access("KSPPI"."INDX"="KSPPCV"."INDX")
      12 - filter("KSPPI"."KSPPINM"='_dml_monitoring_enabled')
      15 - filter("O"."OWNER#"=USERENV('SCHEMAID') AND BITAND("O"."FLAGS",128)=0)
      16 - filter(BITAND("T"."PROPERTY",1)=0)
      17 - access("O"."OBJ#"="T"."OBJ#")
      19 - access("T"."BOBJ#"="CO"."OBJ#"(+))
    42 rows selected.
    Elapsed: 00:00:03.61
    SQL> If your plan table does not exist, execute the script $ORACLE_HOME/RDBMS/ADMIN/utlxplan.sql to create the table.

  • Repeating frame not visible when the query returns no rows

    I've developed a report whose output looks like this:
    Subinventory | Part Code |Part Description |Ordered Qty | Received Qty
    Mentone St | BATT | non serialised item | |
    Mentone St | SONY | spare parts MIN MAX | 30| 0
    In the above report
    subinventory, Part Code, Part description are in one repeating frame and Ordered and received qty are in other repeating frame.
    for a perticular part code there may not be ordered or received quantities. Means the seond query fetches no rows for the perticulat partcode. In that case report is showing null(blank) but I want to print ZERO there.
    If I use NVL in the query it'll effect only when the query fetches some rows.
    I've tried with formula columns. for example in the formula column
    IF :ordered_qty IS NULL THEN
    v_ordered_qty :=0;
    ELSE
    v_ordered_qty := :ordered_qty;
    END IF;
    return(v_ordered_qty);
    I've assigned this formula column as source to the Ordered Qty Filed. Then also its not working.
    Any help in this regards is highly apprecialted
    regards,
    Vij

    may be you can modify your code like below:
    SELECT i.subinventory, i.part_code, i.part_description, i.min_qty, i.max_qty,
           NVL (j.quantity, 0) ordered_qty,
           NVL (j.quantity_delivered, 0) received_qty
      FROM (SELECT DISTINCT c.secondary_inventory subinventory,
                            b.segment1 part_code, b.description part_description,
                            c.min_minmax_quantity min_qty,
                            c.max_minmax_quantity max_qty, b.inventory_item_id,
                            b.organization_id
                       FROM mtl_system_items_b b,
                            mtl_item_sub_inventories_all_v c
                      WHERE b.inventory_item_id = c.inventory_item_id
                        AND b.organization_id = c.organization_id
                        AND UPPER (c.secondary_inventory) =
                               NVL (UPPER (DECODE (:p_sub_inv,
                                                   'ALL', '',
                                                   :p_sub_inv
                                    UPPER (c.secondary_inventory)
                                   )) i,
           (SELECT   mtrl.inventory_item_id, mtrl.organization_id,
                     mtrl.to_subinventory_code,
                     NVL (SUM (mtrl.quantity), 0) quantity,
                     NVL (SUM (mtrl.quantity_delivered), 0) quantity_delivered
                FROM mtl_txn_request_lines mtrl, mtl_system_items_b msi
               WHERE mtrl.inventory_item_id = msi.inventory_item_id
                 AND mtrl.organization_id = msi.organization_id
                 AND mtrl.reference_type_code = 2
                 AND UPPER (mtrl.to_subinventory_code) =
                        NVL (UPPER (DECODE (:p_sub_inv, 'ALL', '', :p_sub_inv)),
                             UPPER (mtrl.to_subinventory_code)
                 AND TRUNC (mtrl.creation_date)
                        BETWEEN NVL (TRUNC (TO_DATE (:p_from_date,
                                                     'yyyy/mm/dd hh24:mi:ss'
                                     TRUNC (mtrl.creation_date)
                            AND NVL (TRUNC (TO_DATE (:p_to_date,
                                                     'yyyy/mm/dd hh24:mi:ss'
                                     TRUNC (mtrl.creation_date)
            GROUP BY mtrl.inventory_item_id,
                     mtrl.organization_id,
                     mtrl.to_subinventory_code) j
    WHERE i.inventory_item_id = j.inventory_item_id(+)
           AND i.organization_id = j.organization_id(+)

  • Pl/SQL is prompting "invalid number" error

    Hello Sir/Madam,
    I'm not very clear why pl/sql cursor is prompting "invalid number" error.
    I need to load single as well as multi Gas meter data for an automation process.  The procedure is loading single meter data fine, but when I add multi meter data to that table it is halting and prompting "invalid number".  I made sure that each record is unique. Define primary key based on three field ( they are: SERVICEPOINTID, METERID, and ENDDATE )
    in the sample file, they are in that order
    I would appricaite your help & explantions on this issue
    sample procedure code:
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v2 is
    rct_cnt number := 0;
        header_key gso_hourlylog_header.hrly_log_hdr_ky%TYPE;
        dailyorder_key gso_hourlylog_header.DLY_ORDER_KY%TYPE;
        customer_key gso_customer_log.CUST_KY%TYPE;
        channel_key gso_cust_channel_privs.CHNNL_KY%TYPE;
        custlog_key gso_customer_log.CUST_LOG_KY%TYPE;
        hourly_custlog_detail_key gso_hourly_cust_log_detail.HRLY_CUST_LOG_DTL_KY%TYPE;
        customer_name GSO_CUSTOMER_LOOKUP.CUST_NM%TYPE;
        row_processing_status VARCHAR2(100) := '';
        other_customerlog_issue VARCHAR2(5) := 'FALSE';
        ls_curr_user VARCHAR2(30) := 'GSO_PROCESS_IEE_INTO_GSO';
        record_processable VARCHAR2(5) := '';
        rec_processing_timestamp TIMESTAMP;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
        VALUES
              rec_processing_timestamp,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID,
              customer_name,
              customer_key,
              channel_key,   
              dailyorder_key,
              header_key,
              custlog_key,
              hourly_custlog_detail_key,
              row_processing_status,
              SYSDATE
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    sample data:
    32096040001 11048610FGI 5/25/2013 10 AM 10 Tower Hill School 1104861000217112 257808404 32096110001 6/21/2013 10:40:18 AM
    26107010002 11086348FGI 5/25/2013 10 AM 10 Emily Bissell Hospital 1108634800050877 261070100 26107010002 6/21/2013 10:40:18 AM
    32101140001 11086356FGI 5/25/2013 10 AM 10 Delaware River Bay Authority 1108635600413231 321011400 32101140001 6/21/2013 10:40:18 AM
    31875230004 110680FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068000021253 318752300 31875230004 6/21/2013 11:04:58 AM
    31875230003 110681FGI 5/25/2013 10 AM 10 Arlon Inc. Gas 11068100022092 318752300 31875230003 6/21/2013 11:04:58 AM
    Regards,
    Vani Sonti

    Hello,
    I've commented out or removed the fields that are not listed.. here is the modified code.. I just added the part where is was prompting errors..
    Yes, I tested just now and it is looping and printing all five record counters..
    CREATE OR REPLACE procedure GSO_SBX_ADMIN.row_add_v3 is
    rct_cnt number := 0;
    begin
    for daily_gis_add in
            SELECT '', METERID, ENDDATE, HOURENDING, VOLUMEVALUE, CUSTOMERNAME, DEVICEID, CUSTOMERID, SERVICEPOINTID
            FROM GSO_IEE_STAGE gis where  trunc(gis.loaded_dt) = trunc(sysdate)
    loop
    insert into gso_iee_process_log
       TIMESTAMP_ID,  PREMISEID,METERID,ENDDATE ,HOURENDING,VOLUMEVALUE ,
       CUSTOMERNAME,DEVICEID,CUSTOMERID,SERVICEPOINTID
        VALUES
              SYSDATE,
              daily_gis_add.METERID,
              daily_gis_add.ENDDATE,
              daily_gis_add.HOURENDING,
              daily_gis_add.VOLUMEVALUE,
              daily_gis_add.CUSTOMERNAME,
              daily_gis_add.DEVICEID,
              daily_gis_add.CUSTOMERID,
              daily_gis_add.SERVICEPOINTID
            commit;
          rct_cnt := rct_cnt + 1;
      dbms_output.put_line(' rowadded '|| rct_cnt);
    end loop;
    end;
    Vani

  • How to capture all the rows returned from a sql select query in CPO

    Hi,
      I am executing an sql select query which returns multiple rows. I need to capture the values of each row to specific variables. How do I proceed.
    Thanks,
    Swati

    The select activities  ("Select from Oracle," Select from SQL Server," etc.) against database already return tables.  Use one of the database adapters to do your select, and it will already be in a table form.  Just put your query in the select and identify the columns in your result table. The online help or the database adapter guides in the product documentation can help.

  • Query returns record in SQL Developer but not in iSQLPlus

    ... back in a minute, I may not have done a commit at the end of the insert.
    The problem I was having was I hadnt commited the record in SQL Developer but the queries where returning records in this environment but not in iSQLPlus or Apex and it was confusing me.
    Message was edited by:
    Benton
    Message was edited by:
    Benton

    Finally got to know the reason why Timezone Abbr woudn't show up in SQL Plus.
    I ran below query in SQL PLUS
    SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP, systimestamp, LOCALTIMESTAMP FROM DUAL;
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    -05:00 08-SEP-12 12.00.31.575228 AM -05:00 08-SEP-12 12.00.31.575223 AM -05:00 08-SEP-12 12.00.31.575228 AM
    Now executed the same query in SQL Developer:
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    America/Chicago     08-SEP-12 12.08.32.072424000 AM AMERICA/CHICAGO     08-SEP-12 12.08.32.072420000 AM -05:00     08-SEP-12 12.08.32.072424000 AM
    The difference between the 2 outputs is the way in which time_zones were respresented. In SQL PLUS, it is shown as an offset whereas in SQL Developer as a time zone region name. Now there are many "time sone regions" that follow an offset of -5:00. This confuses Oracle and a "UNK"(Unknown) for a query like the one below when trying to execute in SQL PLUS:
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    UNK
    Therefore we need to specify the exact Time Zone Region(TZR) in order to obtain the corresponding TZD(Daylight Savings Format i.e. CDT or CST). This we do by altering the session environment vaiable time_zone
    alter session set time_zone='America/Chicago';
    Now executing the queries to find the abbreviated time zone( in TZD format) will finally work to return a non-null char value.
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    CDT
    select to_char(CURRENT_TIMESTAMP, 'TZD') from dual;
    TO_CHA
    CDT

  • Why doesn't the query return rows?

    select count(*)
    from queue_table q
    where q.emp_id IN (select emp_id
    from employee);
    -- 0 rows
    select emp_id
    from employee
    where emp_id = 12;
    --1 rows
    emp_id 12 is in queue table.
    What gives?
    thank u

    what are the table definitions for queue_table and employee?
    Is emp_id a NUMBER in both?

  • Pl/sql function replying invalid number error

    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;

    869206 wrote:
    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;eliminate EXCEPTION handler!
    do NOT rely on implicit datatype conversion
    use TO_CHAR or TO_NUMBER as needed.
    HOME & HOME_GOALS are different datatype

  • [Forum FAQ] How do I send multiple rows returned by Execute SQL Task as Email content in SQL Server Integration Services?

    Question:
    There is a scenario that users want to send multiple rows returned by Execute SQL Task as Email content to send to someone. With Execute SQL Task, the Full result set is used when the query returns multiple rows, it must map to a variable of the Object data
    type, then the return result is a rowset object, so we cannot directly send the result variable as Email content. Is there a way that we can extract the table row values that are stored in the Object variable as Email content to send to someone?
    Answer:
    To achieve this requirement, we can use a Foreach Loop container to extract the table row values that are stored in the Object variable into package variables, then use a Script Task to write the data stored in packages variables to a variable, and then set
    the variable as MessageSource in the Send Mail Task. 
    Add four variables in the package as below:
    Double-click the Execute SQL Task to open the Execute SQL Task Editor, then change the ResultSet property to “Full result set”. Assuming that the SQL Statement like below:
    SELECT   Category, CntRecords
    FROM         [table_name]
    In the Result Set pane, add a result like below (please note that we must use 0 as the result set name when the result set type is Full result set):
    Drag a Foreach Loop Container connects to the Execute SQL Task. 
    Double-click the Foreach Loop Container to open the Foreach Loop Editor, in the Collection tab, change the Enumerator to Foreach ADO Enumerator, then select User:result as ADO object source variable.
    Click the Variable Mappings pane, add two Variables as below:
    Drag a Script Task within the Foreach Loop Container.
    The C# code that can be used only in SSIS 2008 and above in Script Task as below:
    public void Main()
       // TODO: Add your code here
                Variables varCollection = null;
                string message = string.Empty;
                Dts.VariableDispenser.LockForWrite("User::Message");
                Dts.VariableDispenser.LockForWrite("User::Category");
                Dts.VariableDispenser.LockForWrite("User::CntRecords");     
                Dts.VariableDispenser.GetVariables(ref varCollection);
                //Format the query result with tab delimiters
                message = string.Format("{0}\t{1}\n",
                                            varCollection["User::Category"].Value,
                                            varCollection["User::CntRecords"].Value
               varCollection["User::Message"].Value = varCollection["User::Message"].Value + message;   
               Dts.TaskResult = (int)ScriptResults.Success;
    The VB code that can be used only in SSIS 2005 and above in Script Task as below, please note that in SSIS 2005, we should
    change PrecompileScriptIntoBinaryCode property to False and Run64BitRuntime property to False
    Public Sub Main()
            ' Add your code here
            Dim varCollection As Variables = Nothing
            Dim message As String = String.Empty
            Dts.VariableDispenser.LockForWrite("User::Message")
            Dts.VariableDispenser.LockForWrite("User::Category")
            Dts.VariableDispenser.LockForWrite("User::CntRecords")
            Dts.VariableDispenser.GetVariables(varCollection)
            'Format the query result with tab delimiters
            message = String.Format("{0}" & vbTab & "{1}" & vbLf, varCollection("User::Category").Value, varCollection("User::CntRecords").Value)
            varCollection("User::Message").Value = DirectCast(varCollection("User::Message").Value,String) + message
            Dts.TaskResult = ScriptResults.Success
    End Sub
    Drag Send Mail Task to Control Flow pane and connect it to Foreach Loop Container.
    Double-click the Send Mail Task to specify the appropriate settings, then in the Expressions tab, use the Message variable as the MessageSource Property as below:
    The final design surface like below:
    References:
    Result Sets in the Execute SQL Task
    Applies to:
    Integration Services 2005
    Integration Services 2008
    Integration Services 2008 R2
    Integration Services 2012
    Integration Services 2014
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

Maybe you are looking for

  • ITunes has stopped working

    Tried anew to install iTunes (9.1.1.12) again (I uninstalled after having upgraded to 9.X which was a very buggy release on the Windows side). But after having performed a very l o n g backup of my iPhone 3GS, it starts to do things with my songs and

  • Indesign CSS crashes when placing a Word document

    I can place images and other file types fine. but have been unable to place word documents, I save, save as, save as an older version of word. It is just appears to be loading, but becomes 'not responding' and I have to shut it down through task mana

  • Unable to connect via "Data Transfer" Mode On N95 ...

    Its been happening for a little while now. When i plug the USB cable in, it asks if i wanna connect via PC Suite, Data Transfer etc When i click Data Transfer it says the following: "Unable to activate Data Transfer Mode. Mass Memory is in use by ano

  • Issue accessing MSN from Safari

    All of a sudden I can't access MSN via Safari on my iPad.  Updated to ios 8 but the issue started before I updated. 

  • BPC 7.5 Upgrade - Unary Operator Issue

    We have been performing a large upgrade from a previous version of the software and are looking for some help on some of the issues with the upgrade. One of the issues we have been having is that some of our dimensions were using the property "Unary