Using unlinked sql command and table in a subreport

All,
Does CR allow using an unlinked sql command and a table in the same subreport?  I am passing the CurrentCEUserName from the main report to the sql command in the subreport (via linked parameter).  The sql command then executes a query to pass the parameter to the database (example: select myfunction('{?myparam}' from dual).  I need this to run before subreport's table query is executed. 
This all appears to work except that the parameter passed to the sql command isn't set when the command executes.  The value is always null when the sql command is executed.  If I add the parameter to the report output it shows the expected value. 
Also, if I have a subreport that just has a single sql command the parameter is set correctly prior to executing the command.
any help would be appreciated.
thanks!

If you are looking for Crystal to run the SQL Command, then the SQL it generates itself, I think the answer is no, it won't do that.  Crystal expects all of the data sources to be linked, I believe.  I'm not sure what you would expect to happen if they are not...  However, you can make your SQL Command something like (MS SQL; sorry, it's been too long since I've used Oracle...):
declare @result varchar(100);
set @result = ( select myfunction('{?myparam}') );
select * from table;
which would run the first select calling your function, basically throw away the result (or you can do with it as needed), then return the fields from your table.
HTH,
Carl

Similar Messages

  • Restrictions for using sql commands and operators in loader control file

    Hi ,
    It suppose that there is a lot of restrictions and limitations when using sql commands and operators in the loader control files, same as it seems I cannot use (or) when with case statement, also it seems there is certain length for the case,
    So guys, what are the common limitations and restrictions to be avoided in the loader control file ?
    Your efforts are highly appreciated
    Ash

    Hi Ash,
    if you need to do more complicated logic its better to define the file to be loaded as an external table. You can then use any sql function you like against the external table rather than messing around with what you can and can;t do in a sqlldr control file.
    You can use the external_table option of sqldr to generate the definition.
    Regards,
    Harry
    http://dbaharrison.blogspot.com/

  • How to find out the failed sql command and its data from DEFERROR

    Hi,
    has anybody a procedure or some other possibilities to read the content of column USER_DATA of the advanced replication view DEFERROR in order to find out the failed sql command and its column values?
    Thanks in advance.

    Hi Vishwa,
                 The control would be something like this for navigation in Get_p_xxx method u mention as link and u mention a event name which gets triggered on the click of this hyperlink. So your GET_P_XXX method would have the following code:
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
        WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'EXAMPLE'.
    Now you have to create a method as EH_ONEXAMPLE at your IMPL class and within which you would give an outbound plug method. Within the outbound plug the target data would be filled in the collection and window outbound plug would be triggered.
    This is a huge topic and  i have just mentioned you basic things.
    Regards,
    Bharathy.

  • How to insert BLOB datatype image using PL/SQL Procedure and SQL Loader

    Hi,
    How to insert an image into database using PL/SQL Procedure and also how to insert using SQL Loader. Please help by giving sample code and process description.
    Thanks,
    Vijay V

    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006

  • *when we use at user -command and give smaple code fro at user-command*

    Hi experts,
    i am new to abap can any body tell me when we use AT USER-COMMAND and give a sample code for that.
    point will be rewarded.
    thanks.

    Hi,
    AT USER-COMMAND  is a list Event.This Event is triggered when user make an action on the Application Toolber Or Menubar.
    Here is the Program.
    START-OF-SELECTION.
      SET PF-STATUS 'TEST'.
      WRITE:  'Basic list, SY-LSIND =', sy-lsind.
    AT LINE-SELECTION.
      WRITE:  'LINE-SELECTION, SY-LSIND =', sy-lsind.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'TEST'.
          WRITE:  'TEST, SY-LSIND =', sy-lsind.
      ENDCASE.
    This program uses a status TEST, defined in the Menu Painter.
    Function key F5 has the function code TEST and the text Test for demo.
    Function code TEST is entered in the List menu.
    The function codes PICK and TEST are assigned to pushbuttons.
    The user can trigger the AT USER-COMMAND event either by pressing F5 , or by choosing List -> Test for demo, or by choosing the pushbutton 'Test for demo'.The user can trigger the AT LINE-SELECTION event by selecting a line.
    Hopr This Will help You.
    Regards,
    Sujit

  • In CS5, you used to hold Command and scroll to scroll sideways. Now with CS6, it's Shift + scroll.

    In CS5, you used to hold Command and scroll to scroll sideways. Now with CS6, it's Shift + scroll. How do I change it back?

    No, you can't change the built in calendar. However, there are lots of other calendar apps that have that month view. Take a look at Week Cal, Tempo, Fantastical, Cal (by the same folks who make Any.do).

  • Crystal report SQL Command and using IN

    Post Author: geozuh
    CA Forum: Crystal Reports
    Does any one know how to get a multiple value prompts to work in Crystal report SQL Commands? I have an extremely large database and do not want to pull back all the records to the report. I know I can do the filtering in the report, but due to the size of the database, I am restricked from doing do.
    I would like to set the State as a multiple value parameter/prompt to be used in the SQL Command.
    Ex.
    Select CustID, FirstName, LastName
    from Customer
    where State in ('WI', 'IL', 'MN') --this would be turned into a parameter

    Post Author: yangster
    CA Forum: Crystal Reports
    you are over thinking the problemsimply create a parameter within crystal for your state and change it to allow multiple valuesthen in the select expert put in state = ?stateif you do show sql query you will see that the values are pushed down to the sql level thus no performance hit vs putting the parameter directly in the command itself

  • How to use my own DTD and table using the XML SQL utility.

    Hey,
    Here is my question. I have succesfully installed Oracle XML SQL utility and I had played around on that. Now I have my own DTD that too from Rosettanet(PIP). Tell me how can I use my own table, and my dtd using the existing utility. What are all the changes do I need to do. I am strugling it from past 4 days. I couldn't. Please help me!

    Hi chris,
    Yes, the SQL can be changed only by using Discoverer Administrator.
    Open the report/workbook that is based on the custom SQL that you want to change in Discoverer Plus. Look at the Folder that is being used to select the columns of the report.
    Open up the Discoverer Administrator with the id that has access to the tables referenced in the report. And the custom folder with the same name as in Disc Plus would be listed down in the Business Area (Which Business Area the custom folder belongs to can be determined with the help of disc plus).
    Just open up that folder, and change the SQL in it. You can pasted your new sql in there and click on Validate SQL to validate it for errors. If no errors, then the custom folder is successfully changed.
    In order to have it reflected, close your existing disc plus session and reopen it, and you can go about using the custom folder.
    Hope this helps!
    Thanks.

  • SQL Command and JOIN Types

    I'm using CR 10 and I am trying to write a SQL command.  Sadly I'm only able to pull one table.  When I try to link in a second table I get a FAILED TO OPEN ROWSET Error.  It also mentions an extra token: OUTER
    So It sounds like it doesn't like my JOIN statement
    I can't seem to figure out the correct syntax to use for the join type.  I tried using this format
    SELECT "Customers"."FirstName", Customers"."LastName", ."SalesOrder"."Sales"
    FROM "Customers" RIGHT OUTER JOIN "Sales"
    ON "Customers"."CustomerID" = "Sales"."CustomerID"
    I am going this route because I tried linking the tables by using the wizard and the report is unbelievably slow.
    Any ideas would be greatly appreciated!
    Thanks!

    The database it is querying is a ProvideX database. 
    I was able to get the SQL statement to work, however it didn't do any good at all.  The report still pulls the data just as slow.  The database table it is pulling from has a large amount of data.  When I do an INNER JOIN to the two tables, it queries it very quickly.  However when I perform the LEFT OUTER JOIN, it decreases the performance dramatically.  WO1 has all the work orders that have been entered, WO2 has all the materials for the work orders.  If there are no materials in the work order, I will not get all of my work orders entered, only work orders with materials on them.
    If I go to the LEFT OUTER JOIN I then get the results I need, it's just slow and most of the time the report will crash.
    Here is the actual syntax I am working with.  I was hoping a SQL statement would speed it up but that is not the case. 
    SELECT "WO1_WorkOrderMaster"."WorkOrder","WO1_WorkOrderMaster"."QtyComplete", "WO1_WorkOrderMaster"."ActualProdStartDate", "WO1_WorkOrderMaster"."QtyOrdered", "WO2_WorkOrderMaterialDetail"."ComponentItemNumber"
    FROM   {oj "WO1_WorkOrderMaster" "WO1_WorkOrderMaster" LEFT OUTER JOIN "WO2_WorkOrderMaterialDetail" "WO2_WorkOrderMaterialDetail" ON "WO2_WorkOrderMaterialDetail"."WorkOrder"="WO1_WorkOrderMaster"."WorkOrder"}

  • SQL Command and Datetime Parameters

    <p>Hi, </p><p>I am having problems  adding datetime parameters to a SQL command.</p><p>The code is AND table.startdatetime >= &#39;{?start}&#39; </p><p>I enter the time and date in the parameter and get the following error.<br /><br /><strong>Incorrect syntax near 2006</strong></p><p>Any clues</p><p>Thanks</p>

    Hi,
    What database you are using?
    Regards
    Sarobinyal

  • Read data from SharePoint using ABAP sql command

    We need to read data from a SharePoint site and update the sap object services with the information. There is a lot of information on how to put data into Sharepoint from SAP, but we need to get data from SharePoint and put it into SAP. Is it possible to retrieve data from SharePoint using sql command in ABAP program? If it is possible, what do we need to do to have SAP recognize where to get the SharePoint data?
    Richard Newman

    Hi Newman,
    You can use native sql in your abap code to read data from SharePoint's database. But I would suggest you to generate a SharePoint webservice which can provide you the neccessary data so that you can consume this webservice in ABAP
    (Will be quite faster than native sql).
    Regards,
    Ozcan.

  • Can I use multiline SQL commands in a query (within a component)?

    I would like to modify the following query:
    <td>ItranslationString</td>
         <td>
         INSERT INTO TRANSLATIONSTRINGS (daKey, daLanguage, daTranslation, daStringFlag, daSourceFile) VALUES (?, ?, ?, 'N', ?)
         </td>
         <td>daKeyField varchar
         daLanguageField varchar
         daTranslationField varchar
         StringTranslationFilename varchar
         </td>
    so that the daSourceFile a) is selected from another record, if it exists b) uses the constant, if not.
    In SQL Command the commands (without placeholders) look:
    declare c integer;
    res varchar(30);
    key_var varchar(100);
    def_lang_var varchar(5);
    begin
    key_var := 'newString';
    def_lang_var := 'en';
    res := 'ap_string.htm';
    select count(*) into c FROM TRANSLATIONSTRINGS WHERE daKey = key_var AND daLanguage = def_lang_var;
    if c > 0 then
    select daSourceFile into res FROM TRANSLATIONSTRINGS WHERE daKey = key_var AND daLanguage = def_lang_var;
    end if;
    INSERT INTO TRANSLATIONSTRINGS (daKey, daLanguage, daTranslation, daStringFlag, daSourceFile) VALUES (key_var, 'cs', 'translation', 'N', res);
    end;
    However, such a query does not work in the query resource (multiline commands cannot be used?).
    Neither can I think of one line query that would provide the same functionality (tried to test with COALESCE).

    Yes, I got the point. The query looks like:
    INSERT INTO TRANSLATIONSTRINGS (daKey, daLanguage, daTranslation, daStringFlag, daSourceFile)
    SELECT daKey, daLanguage, daTranslation, daStringFlag, daSourceFile FROM (
    select 'newString1' daKey, 'en' daLanguage, 'transl' daTranslation, 'N' daStringFlag, daSourceFile FROM TRANSLATIONSTRINGS WHERE daKey = 'newString1' AND daLanguage = 'cs' UNION ALL SELECT 'newString1' daKey, 'en' daLanguage, 'transl' daTranslation, 'N' daStringFlag, 'default' daSourceFile FROM DUAL)
    WHERE rownum<=1;
    so that's the way how to solve it via SQL.
    (Since I can't use DECLARE, I need to bind entry parameters as many times as they appear in the query - not a very nice way, but it works).
    The question still is, whether there is a way how to use a multiline query in Component Queries. Even though it is not mentioned specifically in the documentation, it seems it is NOT to be possible by design. So the real question is really WHY - I guess it would be a little bit more convenient to begin/commit transactions, use variables, etc. in a multiline query.
    Yet, Sam, thanks!

  • BI UDI data load conflict using MS SQL Server and date fields

    Hi BW Experts!
    We have found some unexpected problems when we are trying to perform a data extraction process from an SQL database (non-SAP application).
    We are using the BI UDI tool (JDBC Driver/Connector).    The basic data extraction works properly, however we have some specific problems to work with SQL Server fields defined as “Date Time”.
    The JDBC driver automatically intermediate the communication and translate these fields splitting the original SQL date time field into two separated fields with suffix “_D” (for date) and “_T” (for time).
    It works perfect for extraction, but it doesn’t work well when we try to restrict the data selection based on these fields.    
    When we put a date selection into the infopackage data selection area (we already have tried several date formats), the system simply ignores these selection parameters and send a SQL statement without “WHERE” clause to DBMS.   
    Please, anybody has experienced anything like this or know somethings that could help us? 
    This is a standard limitation from SAP BI UDI?
    Thanks in advance and best regards,

    Hi Matt and Thomas
    Many thanks for your replies.
    Yes I have to do the join. Even worse I have to write an Aggregate query like this!
    Select o.F1,o.F2, m.F1,m.F2, count(*)
    from
    table@oracleServer o,
    table@microsoftSQLServer m
    where o.F1=m.F1
    group by o.F1,o.F2, m.F1,m.F2;
    These are 2 different systems (hardware & software) which actually do the same job, they produce transactions for a common business entity. Kind of, both sell tickets for the same ABC ferry company.
    I can not put them side by side on the dashboard, as I need to aggregate the data and present it maybe in a Oracle BI Report for Accounting and Financial reconciliation purposes.
    The truth is, as it is. I can't change it, is too late.
    I have to device a way to harvest both systems as they are. I don't want to move around data. I thought looking at Oracle BI I could write SQL against multiple Data Sources. I am struggling to find a way. As it seems that it can "SQL query" 1 data source at a time.
    I have been hinted on another forum (OracleTURK) to use Oracle Transparent Gateways and Generic Connectivity. http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
    Shame, I have to pay licenses for OWB and Oracle Transparent Gateways. I thought DB vendors can do better. Why do I have to pay to access the other 50% of the market.
    I can understand the performance implications this might have. Because of it I might even be forced at the end to move data (ETL) into a separate database, slice it into partitions and manage it that way. Pitty because currenlty I only need one report out of these systems but seems like will be dear to get.
    Thank you for all your help.
    Kubilay

  • Can we join SQL Command and Stored procedure in CR ?

    Hi friends,
    i have one already developed reports.
    now based on some requirments changes, i need to add YTD sales in reports.
    i have already built Command for this reports.
    Command also used one of tables which contain each month sales data.
    Now, i need to add YTD calculation in reports.
    so how can i handle this YTD in existing Command or do i need to develoed anohter stored procedure ?
    Thanks.

    You can try editing the existing command and add the new columns that you want. If you are unable to see the new columns added then try to use verify database option under database menu option. After clicking on verify database you can see the new fields added in the report.
    regards,
    Raghavendra.G

  • Use of SQL Server and Oracle Simultaneously

    Hello,
    Is it possible to have Oracle and SQL Server used simultaneously? Here, developers will be accessing both databases at the same time, whereas they are some ease of implementations at one Database, which can't be found in another database.
    Regards,

    user650358 wrote:
    I am able to retrieve with simple OUT Parameters from the stored procedure in the application without having to use refcursor. Is this a bad thing in the use of other data types instead of refcursors?
    I was able to have only a varchar and this worked fine.PL/SQL is a formal procedural language with a number of object orientated programming features. Of course functions can return all kinds of data types - even objects and arrays and collections and pointers (called LOB locators).
    All SQL in Oracle are parsed and stored in the server as cursors. The ref cursor data type in PL/SQL is a variable type that contains the handle of a cursor in the server - its "special ability" is passing this PL/SQL variable structure to a client (like Java or .Net) and have the client consume the output of the cursor.
    Ref cursors allow you to move a lot of business logic and validation and processing into PL/SQL - and have PL/SQL do the complex stuff and create the SQL cursor and then simply pass the cursor handle to the client as a ref cursor data type. You can easily maintain this code, introduces changes, tune for performance, without having to touch a single byte of client code.
    But functions are not there simply to pass ref cursor handles to a client. They can do various other stuff and return all kinds of data types and structures.

Maybe you are looking for

  • Error when scheduling a report

    Hi, I am running XML Publisher 5.6.2 standalone. I am having the following issue: I am trying to schedule a report to run sun - mon at 06:30am and email and excel file to the user. The job is failing. This is the error that we are receiving in the sc

  • Hp officejet pro 8500 a910 software will not open

    I have had my printer installed for over 2 years on my laptop via the network (Dell with OS Win 8.1).  Recently, as in I have no idea why or what happened, I have an issue where I cannot open the software on my computer to scan a document.   The icon

  • How to compare 2 dates in a JPA QL query

    hello all, how can i compare 2 dates in JPA QL ,? my idea was to convert the dates to String, and i used 'to_char', but i think it doesn't work in JPA QL; this is my query(it works in oracle but not in java) : Query q=em.createQuery("select sum(o.mon

  • Media Manager and Subclips

    Hello, Seem to be having a slight issue with media manager. I broke a master clip up into 5 subclips. I tried to use media manager to create 5 new media files from these subclips (which should result in the subclips becoming their own master clips),

  • Livecycle button with an action bypassed if 'enable additional featues' actioned

    I have created a form in Livecycle that has a button with an action that when clicked repeats several rows of a table.  (ie if someone needs to see more rows they click the button) This works fine in the Preview PDF and works fine once saved  if I th