SSRS Query Source

Hello Everyone,
We have a set of queries that are used for both ETL and Reports.  We would like to store these queries in a central location, such as a SQL Server table, so we can maintain them easier.  Pulling queries out of a table field and storing that query
in a variable so it can be executed is easy enough in SSIS.  How would we pull a query from a table field and use it in SSRS?
Thank you all for your help.
JamesNT
"If you have to ask about various operating system limits, you're probably doing something wrong." -Raymond Chen

You'd be best off creating a stored procedure to do this.
myStorecProc 'queryName'
But, to be honest, you might well be better served creating a stored procedure for each query, and then executing it from where ever it needs to be run. The queries will still be stored centrally in the database, but there's less moving parts. From SSRS
you can just call the relevant procedure.
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

Similar Messages

  • Oracle.apps.xdo.XDOException: Group G_EMP has incorrect  Query Source : Q1

    All,
    I am trying to create some reports using XML data Template in BI publisher. But when I just create a simple data template, I keep getting the error message as mentioned below.
    [111907_101025922][][STATEMENT] Template parsing completed...
    [111907_101026625][][STATEMENT] Start process Data
    [111907_101026625][][STATEMENT] Process Data ...
    [111907_101026625][][STATEMENT] Writing Data ...
    [111907_101026625][][EVENT] Data Generation Completed...
    [111907_101026625][][EVENT] Total Data Generation Time 1.0 seconds
    [111907_102628031][][STATEMENT] Setting data definition:Sample_Data_Template type:oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11
    [111907_102629516][][STATEMENT] Logger.init(): *** DEBUG MODE IS ON. ***
    [111907_102629516][][STATEMENT] Logger.init(): LogDir=C:\Program Files\Java\jdk1.5.0_13\xmldebug
    [111907_102629516][][STATEMENT] Template parsing started...
    [111907_102629516][][STATEMENT] Data Template ......
    [111907_102629516][][STATEMENT] oracle.xml.parser.v2.XMLDocument@1ab4586
    [111907_102629516][][STATEMENT] Inside dataQueryParser...
    [111907_102629516][][STATEMENT] Inside dataStructureParser...
    [111907_102629516][][STATEMENT] Group ...report
    [111907_102629516][][EXCEPTION] oracle.apps.xdo.XDOException: Group G_EMP has incorrect Query Source : Q1
         at oracle.apps.xdo.dataengine.DataTemplateParser.groupParser(Unknown Source)
         at oracle.apps.xdo.dataengine.DataTemplateParser.groupParser(Unknown Source)
         at oracle.apps.xdo.dataengine.DataTemplateParser.dataStructureParser(Unknown Source)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(Unknown Source)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(Unknown Source)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(Unknown Source)
         at oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11.callDataProcessor(AdvancedQueryBoundValue11.java:117)
         at oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11.getValue(AdvancedQueryBoundValue11.java:101)
         at oracle.apps.xdo.servlet.ReportContextImplV11.getReportXMLData(ReportContextImplV11.java:389)
         at oracle.apps.xdo.servlet.CoreProcessor.process(CoreProcessor.java:132)
         at oracle.apps.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:62)
         at oracle.apps.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:638)
         at oracle.apps.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:237)
         at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:279)
         at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:266)
         at oracle.apps.xdo.servlet.XDOServlet.doGet(XDOServlet.java:199)
         at oracle.apps.xdo.servlet.XDOServlet.doPost(XDOServlet.java:222)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:65)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         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:595)
    Could any one of you please help me out :)
    Thanks,

    Hi King,
    Find below the data template I am using. I have defined a Q1 in my data template. Let me know where I am going wrong.
    Thanks,
    Ram
    <dataTemplate name="Emp" dataSourceRef="EBS">
         <dataQuery>
              <sqlstatment name="Q1" dataSourceRef="EBS">
                   <![CDATA[ SELECT empno, empname FROM APPS.EMP ]]>
              </sqlstatment>
         </dataQuery>
         <dataStructure>
              <group name="G_EMP" source="Q1">
                   <element name="empno" value="empno"/>
                   <element name="empname" value="empname"/>
              </group>
         </dataStructure>
    </dataTemplate>

  • External Query Source in reports...

    Dear Oracle Friends
    Description: I have a report on master table with 5 columns. I prepared an interface to call the report using Forms 6.0. User is allowed to set the WHERE clause, ORDER BY clause and sorting order (ascending/descending). In order to give this flexibility I specified external query source in my report. Whenever the user selects the criteria I just update that query file.
    Problem: When I set the EXTERNAL QUERY SOURCE FILE property by selecting the path using dialogue box, this path is hard coded in the report. At the time of development the location of SQL file is say C:\ORAWIN95\FORMS60\XXX SYSTEM\REPORTS\SQLS\ but when I install the application at User machine the location of SQL file will be say D:\ORAWIN95\XXX_SYS\REPORTS\SQLS\. When I run the report at User machine is generates the error 'External Query source not found...'
    What I want to do: Dyanmically get the path of SQL file. I tried to give only the external query file name but it didn't worked.
    Any suggestions are most welcome.

    You should be able to use REPORTS60_PATH for this. Just specify the filename (<x>.sql) inside the Builder, and ensure that the file is in one of the directories specified in the REPORTS60_PATH registry entry (which you can, of course, edit).

  • Using WCF Odata service as SSRS data source

    Hi,
    We are evaluating Odata service as data source for SSRS, Idea is to use these reports in sharepoint 2010. I am not sure how to do it.
    Now, I am getting a basic doubt that whether Odata can be used as SSRS data source. Please clarify my doubt. If this is possible please help me with some samples.
    Thanks in advance.
    Santosh

    Hi Santosh,
    Thanks for your post.
    I am not familiar with WCF Odata service, so I would suggest you to refer to the article
    Data Sources Supported by Reporting Services (SSRS),
    to verify whether the predefine data sources could fit your needs, if there is no one available to use for you,
     I would suggest you to implement a custom data processing extensions according to your own needs, you can refer to
    Implementing a Data Processing Extension
    to learn how to implement a data processing extensions.
    Thanks,
    Bill Lu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Using AD EmployeeID in a SSRS query in SharePoint 2013

    I have successfully installed SSRS 2012 in SharePoint 2013 and have used it to query a SQL database and build a report. Now, I'd like to query only for the data associated only with to the currently logged-in SharePoint user's EmployeeID. The database
    holds a field called EmpID, which I have exported into the EmployeeID field in Active Directory, and sync'd into SharePoint through the User Profile service. The SQL database being queried has no other connections to Active Directory.
    If the query is simple, i.e., Select * from Emp where EmpID=<user's EmployeeID> , how do I pass EmployeeID into the query from the SharePoint User Profile?
    This is my first SSRS project, so please be descriptive!

    Hi AltonBay, Not sure, I understood your query. If your empid is the logon is to windows login, I think samAccountName should be the one you need to map.
    Please refer the below link for mapping:
    http://social.msdn.microsoft.com/Forums/en-US/10815275-28b9-4075-a707-6896e9b54eae/select-first-row-from-multivalued-field-in-active-directory?forum=transactsql

  • Power Query Source doesn't display

    I'm currently using PQ 2.16.3822.242, but updating to the latest version on another PC doesn't address my issue.
    I've created many Excel spreadsheets where I use PQ to connect to an internal SQL server. I create a query and enter it as the source in PQ.
    I've recently discovered that PQ no longer displays the Source when I try and edit spreadsheets that were originally created in March, 2014 or earlier. Here are 2 screenshots that demonstrate my issue. 
    In screenshot 1, you see the Source as it should be listed.
    Screenshot 2 is what I see in PQ for older spreadsheets. Notice that there's not text in the SQL Statement field and there's an extra item under the Applied Steps section entitled "Navigation".

    But when you go to "Advanced Editor", you see a call to Sql.Databases that contains an explicit SQL query? To me, this just looks like the older queries went directly against a table and didn't include any SQL text -- what we call "native
    query" -- while the newer ones do contain explicit SQL text.

  • Post Calculation Computation example for query source

    Hello,
    It's my understanding that the Format Mask filed in the Source section of the Edit Page Item is for database columns. I've been trying to find sample code on how to use a format mask for a field that uses a SQL Query as it's Source.
    Here is my query:
    SELECT :P3_CONSTR_COST + :P3_AQUISIT_COST + :P3_SECURITY_COST + :P3_HOUSING_COST + :P3_DESIGN_COST + :P3_AWFEE_COST
    FROM DUAL
    Can you please let me know how I can format it to display like: 999,999,990
    Thank you for your assistance....

    Just a hunch, but you might be having a problem because of the double quotes. Oracle likes single quotes. You also might want to forgo the quotes entirely.
    As for an invalid number, is it possible that one of the values that you are adding might be NULL. You can't add NULL to a number or you get an error. There are two solutions to that. One would be to do an NVL around each number you are adding (changing it to zero if the value is NULL). The second option (and easier option) is to use the SUM function. Mathematical functions like SUM and AVG ignore those values that are NULL.

  • Using Link DB to query Source DB and Insert results in Target DB

    Hi
    I have created a link between the source database and target database.
    I have a simple query that queries the dba_segments table in the source db
    Using a cursor, I'd like to insert those records into a table in the target database. I believe this has to be done with a cursor.
    Does anyone have the proper syntax for this type of operation that I could pick apart.
    This is what I have so far:
    DECLARE
    Cursor GetTableSizesEmr IS select owner,segment_name,bytes as Bytes, bytes/1024/1024 as Megs,(blocks*8192)/1024 as totsize_block
    from dba_segments@LINKNAME
    where owner='KEN'
    and tablespace_name ='MY_DATA';
    BEGIN
    open GetTableSizesEmr;
    LOOP
    FETCH GetTableSizesEmr Into TARGET_Table
    EXIT WHEN c_emp%NOTFOUND;
    END LOOP:
    CLOSE GetTableSizesEmr;
    END;
    Thanks for any help.

    Well, you think wrong.
    SQL> SELECT * FROM t;
            ID DESCR
             1 ONE
             2 TWO
             3 THREE
             4 FOUR
    SQL> SELECT * FROM t1;
            ID DESCR
             6 SIX
             7 SEVEN
             8 EIGHT
             9 NINE
    SQL> INSERT INTO t
      2  SELECT * FROM t1;
    4 rows created.
    SQL> SELECT * FROM t;
            ID DESCR
             1 ONE
             2 TWO
             3 THREE
             4 FOUR
             6 SIX
             7 SEVEN
             8 EIGHT
             9 NINEThe presence of a db_link makes no difference to the basic structure.
    John

  • Cant use dynamic constant for measure MDX SSRS query

    I am trying to write a dynamic MDX query in SSRS.  I was sucessful with the groups being dynamic,
    but the measures are not working as they do in SQL Mgmnt Studio.  For example,  this text
    is not working (the data set is invalid after when executed):
    ="WITH "
    +" member [Measures].[Measure1] AS "+iif(Instr(Join(Parameters!ColumnValues.Label,","),"01") > 0,Parameters!ColumnValues.Value(0),"0")
    So if ColumnValue "01" was not selected measure1 should just be "0". 
    It works ok if you just hard code : "member [Measures].[Measure1] AS 0", but fails when used in the IIF().
    Anyone see the problem with this?
    Thank You

    Hi billywinter,
    You issue can be caused by the Parameters!ColumnValues.Value(0) will return the integer value which missing the "", so it will cause the issue.
    Please modify the query like below  to have a test:
    ="WITH "
    +" member [Measures].[Measure1] AS "+iif(Instr(Join(Parameters!ColumnValues.Label,","),"01")
    > 0,CStr(Parameters!ColumnValues.Value(0)),"0")
    If you still got some issue, please try to provide the error message to help us better analysis about the issue.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Unable to open SSRS Data Sources

    I have exactly the same problem with SSRS 2012 and SP2010 having restarted the SSRS boxes - now I can't even open any of my Data Sources - any suggestions welcome!
    The value for UrlRoot in rsreportserver.config is not valid. The default value will be used instead. (Application: SSRS_2012_Service_App, CorrelationId: e80e2208-eb7d-4bc7-8a66-c31537d0c109)

    Are you using SSRS 2012 SP1 + CU8? If not, I'd recommend doing so, but it likely doesn't relate to the issue you're having. Note that the error message you put in your post can be ignored.
    What happens when you try to open a data source?
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • SSRS query shows error no columns

    this is the query command Text:
    ="select pallet_id, pallet_create_dm,pn_id from MATS_ITG.pwax_pen_link where pallet_id  in ("& Join(Parameters!pallet_id.Value,",") &")"
    when it querys it shows error
    An error has occurred during report processing. (rsProcessingAborted)
    Query execution failed for dataset 'DsPartial_lookup'. (rsErrorExecutingCommand)
    ERROR [42703] ERROR 2624: Column "SGAC2207H0" does not exist 
     pallet_id is a multiple value  ,SGAC2207H0 is just my data
    can not figure out why, Please help me

    Hi ,
      Pallet_ID parameter seems to passing string like 'SGAC2207H0' . Check and change the parameter to pass numbers by checking the assignment to the value column in the parameter. If still need the string to be passed , Try the below expression  
    ="select pallet_id, pallet_create_dm,pn_id from MATS_ITG.pwax_pen_link where pallet_id in ('"& Join(Parameters!pallet_id.Value,"','") &"')"
    Best Regards Sorna

  • Deltatype in SSRS Query

    I have a cube with several measures like cost (bound to a calender week hierarchy) and a calculated measure representing the value from the week before (it is a calculated measure navigating in the CW-hierarchy prevmember). Same for work (Containing an integer
    value, also prevmember for the previous week)
    A query can somehow look like this:
    Document Work PrevWeek Work week Delta Work Deltatype
    ABC123 5 10 5 3
    ABC124 10 10 2
    ABC125 5 5 0 1
    I have a calculated column called "Deltatype" with this expression:
    IIF
    (ISEMPTY([Measures].[Work PrevWeek]) AND ISEMPTY([Measures].[Work]),0,
    IIF
    (ISEMPTY([Measures].[Work PrevWeek]) AND NOT ISEMPTY([Measures].[Work]),2,
    IIF
    ([Measures].[Work PrevWeek] <> [Measures].[Work], 3,1
    So 1 is unchanged, 2 is new and 3 is changed. Works pretty neat, with only one glitch: Performance! It takes ages! (If it does finish at all...)
    Does anybody know an expression that needs less performance? I have a table in which i derive the type in the report, here it is pretty fast. But I can't really use it for charts and/or grouping etc.
    Thanks a lot in advance,
    Christof!
    (Disclaimer: I've also asked this question on StackOverflow but my experience getting an answer there is not soooo good, so please forgive me!)

    Hi Christof_S,
    According to your description, there is a calculated field called Deltatype in the report. If Work PrevWeek is null and Work is null, then Deltatype is 0. If Work PrevWeek in null and Work isn’t null, then Deltatype is 2. If Work PrevWeek is the same with
    Work, then Deltatype is 1, else 3. The iif function works but the performance is poor.
    According to my knowledge, the Iif function returns one of two values depending on whether the expression is true or not. When we have three or more conditions, nested IIF statements will make expression harder to read and extend, instead, we can use Switch
    function to get the same functionality. In this case, we can modify the expression like below:
    Switch
    (ISEMPTY([Measures].[Work PrevWeek]) AND ISEMPTY([Measures].[Work]),0,
    ISEMPTY([Measures].[Work PrevWeek]) AND NOT ISEMPTY([Measures].[Work]),2,
    [Measures].[Work PrevWeek] <> [Measures].[Work], 3, true, 1)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Query: Source of partner function

    Dear All,
    I have a basic question in partner determination.
    I have configured partner determination such that all the required partner functions
    appear when the customer master is created.
    But how does the system know the source?
    I mean, how does the system automatically populate the customer numbers for the partner functions?
    Thanks,
    nsp.

    By default when u select the account group 0001 - when using XD01 to create the customer , th emoment u create sold to party, automatically the system will assign the same number to SH, BP and PY. This depends on the mandatory check mark on sh bp and py in the partner determination.
    How the system does this - then you will have to look at the user exit/programs which gets triggered when saving the customer creation screen. By debugging the transaction XD01 during customer creation and when u save it/ if u assign break points to the specific customer creation user exit involved you can see that code.
    rgds
    Sai

  • Dashboard in SSRS Query

    Hi,
    I am new to SSRS, as I have to create on dasboard in ssrs which will cover 4-5 chart and other type of reports on single screen.
    I just want to know, is there any properties need to configure for 5 chart or i have to just drag 5 chart from tool.
    another question.
    every chart will show other data like sum of reveny by state, by country, by region like that.
    so do I have to create 5 dataset or 1 dataset is sufficient for all 5 chart.
    thanks & regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi Christof_S,
    According to your description, there is a calculated field called Deltatype in the report. If Work PrevWeek is null and Work is null, then Deltatype is 0. If Work PrevWeek in null and Work isn’t null, then Deltatype is 2. If Work PrevWeek is the same with
    Work, then Deltatype is 1, else 3. The iif function works but the performance is poor.
    According to my knowledge, the Iif function returns one of two values depending on whether the expression is true or not. When we have three or more conditions, nested IIF statements will make expression harder to read and extend, instead, we can use Switch
    function to get the same functionality. In this case, we can modify the expression like below:
    Switch
    (ISEMPTY([Measures].[Work PrevWeek]) AND ISEMPTY([Measures].[Work]),0,
    ISEMPTY([Measures].[Work PrevWeek]) AND NOT ISEMPTY([Measures].[Work]),2,
    [Measures].[Work PrevWeek] <> [Measures].[Work], 3, true, 1)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • How can I change the report query source on the fly

    I am new to Bi Publisher,
    I have a user that wants to select certain columns in the table then have bi publisher make a pdf on just those columns
    without making different reports for each of there choices, how can i make the report variable?
    Thanks,
    Doug

    Hi Doug,
    You can also use lexical parameters to determine the columns in a Data Template (or Oracle Report)... taking it to the extreme the major components of a BI Publisher data template could be dynamic.... something like:
    select &select_clause
    from &from_clause
    where &where_clause
    Regards,
    Gareth
    http://garethroberts.blogspot.com
    http://www.virtuate.com

Maybe you are looking for

  • Agent option in OBIEE 11g

    I have OBIEE 11g(11.1.1.7.1) in my machine as development environment.When i try to create an agent from analytics->New->agent But i am not able to find the agent option in NEW menu. What are all the required steps to make it enable. Thanks, prasanna

  • Fail to install E-Business Suite Diagnostics Installation Guide ID 167000.1

    I am following E-Business Suite Diagnostics Installation Guide [ID 167000.1] for the installation. Firstly, i have successfully adsplice Patch 3636980. then i try on Patch 7530017 and i hit this error during adpatch: About to update the current-view

  • URL_TO_CLIENT in webutil

    hi, world I am facing a problem with webutil_file_transfer.url_to_client in forms. am getting "WUC-18 Invalid server side file specification" error when i try the following code DECLARE FLAG BOOLEAN; BEGIN FLAG:=WEBUTIL_FILE_TRANSFER.URL_TO_CLIENT('h

  • Problem connecting DB to struts app

    Hi, I have made a struts app to get data from mysql DB i am getting follwoing erer java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool      at java.lang.Class.getDeclaredConstructors0(Native Method)      at java.lang.Class.

  • Connectivity and FCP

    Up to this point in my FCP experience, I have used nothing but Log and Capture with my Canon NTSC ZR60 mini cassette camcorder which has worked great with FCP.  I am on the verge of purchasing a new Canon HD camcorder and am worried about connectivit