Mixing SQL Command parameters and UI created parameters

Post Author: shecter
CA Forum: Data Connectivity and SQL
I'm using Crystal Reports XI.  I've created a report with an SQL Command - no other tables or views. I want to allow my users to be able to choose data from a dynamic parameter and have the SQL read that and spit out the results. I was able to add a parameter to the SQL using the Parameter column in the Command window. This allows my user to type in a parameter. However, when I run the report after creating a parameter using the UI (i.e. Field Explorer/Parameters/right clicking and selecting "new" and then adding the parameter to a field using the selection wizard), i first get a screen that shows me the parameter that I created in the SQL Command window, then I get a screen that shows me the UI created parameters. How can I make it show only one screen with all the parameters?  -Marc 

Post Author: jenxia
CA Forum: General
SQL Command is :
SELECT UNIQUE ContactID,  incomingAddress,applicationid,
MediaStatus, MediaDirection, EndDateTime, StartDateTime
FROM MMCAContactMediaViewwhere EndDateTime>= {?1-reportstarttime}  and  EndDateTime <= {?2-reportendtime}
Order by ContactID
Select formula using dynamic prompts as
{Command.contactid} = {?ContactID} and{Command.applicationid} = {?ApplicationID} and{Command.incomingaddress} = {?IncomingAddress}

Similar Messages

  • SQLJ calling PL/SQL with records and tables as parameters

    Has anyone used sqlj to to call procedures with records and
    tables as IN, OUT, or INOUT as parameters? If so how do you
    assign values to the IN parameter in the record/tables, and get
    values out of the record/table when it is passed back? Might
    anyone have any syntax?
    null

    One thing I forgot to mention: If you're an 8i client, then in
    8.1.6 you'll be able to use JPublisher to solve this problem,
    since it'll generate these wrappers for you.
    Pierre
    Oracle Product Development Team wrote:
    : Hi,
    : The key issue is that no part of Oracle code except PL/SQL is
    : aware of the PL/SQL Record types and PL/SQL "index-by" table
    : types.
    : So the only way to call a PL/SQL procedure with args of a
    RECORD
    : or "index-by" table types is from another PL/SQL routine.
    : In most cases, it's possible to work-around this by wrappering
    : your PL/SQL method with another which doesn't have this issue.
    : For example, if you're trying to call procedure proc01 in:
    : package pack01 is
    : type rec01 is record(n1 number, d1 date);
    : procedure proc01 (r rec01);
    : end;
    : you can create a wrapper method:
    : package pack01_wrapper is
    : procedure proc01_wrapper (n1 number, d1 date);
    : end;
    : package body pack01_wrapper is
    : procedure proc01_wrapper (n1 number, d1 date) is
    : r pack01.rec01;
    : begin
    : r.n1 := n1;
    : r.d1 := d1;
    : pack01.proc01;
    : end;
    : end;
    : If you're a 7.3 client, that's about all you can do. The Fix
    was
    : introduced in 8.0, where new structured types (ADT's) and new
    : table types (VARRAY's and Nested tables) were introduced. So
    if
    : you're an 8.0 client, your 'wrapper' package could use an ADT
    : which has the same attributes as the record, rather than
    : 'exploding' the record into its individual components as I
    showed
    : above.
    : Hope this helps!
    : Pierre
    : Thomas Richardson (guest) wrote:
    : : Has anyone used sqlj to to call procedures with records and
    : : tables as IN, OUT, or INOUT as parameters? If so how do you
    : : assign values to the IN parameter in the record/tables, and
    get
    : : values out of the record/table when it is passed back? Might
    : : anyone have any syntax?
    : Oracle Technology Network
    : http://technet.oracle.com
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Problem creating a SQL command object and adding it to a Crystal report

    Hi,
    I'm trying to add the following SQL command object with the following sql for MYSQL 5.1
    SELECT lic.id, lic.productionname, comp.companyname, lic.paymentreceiveddate, lic.licenseissuedate,
    IFNULL((SELECT sum(licsong.feequoted) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfeequoted,
    IFNULL((SELECT sum(licsong.feetax) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfeetax,
    IFNULL((SELECT sum(licsong.feequoted + licsong.feetax) from licensesong licsong where licsong.licenseid = lic.id), 0) as totalfee,
    IFNULL((SELECT sum(pay.fullamount) from payment pay where pay.licenseid = lic.id),0) as totalpaid
    FROM license lic
    INNER JOIN company comp on lic.licensecompanyid= comp.id;
    This sql runs fine in the Query Browser of mysql and returns what I want.
    When I try to add this SQL command to a new Crystal Report, (by right clicking in the sql editor and selecting Crystal Reports - Add to new Crystal Report), it locks up my Eclipses and it ends up not responding. If I just do a simple SELECT * FROM license it works fine.
    The Eclipse I'm using is from the CR4E download page with the crystal plugin already installed.
    Any help with this would be greatful, as I am not having much joy with this CR4E 2.0 with MySQL and may have to scrap it and go back creating reports in Apache POI.
    Any help greatly received.
    Kind regards

    Hi,
    Try to select a particular columns instead of doing SELECT * FROM license.
    Thanks,
    Saravanakumar

  • Command level parameters and report level parameters

    Hi All,
    I know it is a basic question.But please guide me.

    Hi Divya,
    Please be specific about what you're looking for help on. Are you trying to understand the difference between the two?
    - Command Level promps are created in the 'Add Command' option and are usually added in the where clause to filter records on the database based on the value/s entered by the user
    - Report Level prompts are created in the report via the Field Explorer and serve the same purpose as the Command Level prompts however offer greater functionality and options for the prompts - e.g creating a date range prompt
    P.S: There are of course many other differences too.
    -Abhilash

  • SQL Command - Paramater and wildcard

    Post Author: edy80y
    CA Forum: Crystal Reports
    Hi All,
    I have successfully dumped an SQL into a 'Add Command' function and it returns the data exactly how i want it.  But now i want to add a parameter so that i dont have to manually update the date which is referenced 8 times.
    The TIME_KEY field is in this format YYYYMMDDHHMMWST (for 20/12/2007 2:30PM) = 200712201430WST
    I have used LIKE '20071220%' so it returns all rows within that one date.
    Now, i created a string parameter {?date) so i can enter '20071220' and i want to attach the wildcard (%) to the parameter.
    If i do any of the following it doesn't work:
    LIKE {?date} + '%'
    LIKE {?date} || '%'
    LIKE {?date} & '%'
    Here is the code:
    SELECT    "T1"."OBJECT_ID", "T1"."TIME_KEY",                          (SELECT     SUM("N_ANSWERED") AS "ANSWERED_ROLLING"                            FROM      "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"             WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ABANDONED_RING") AS "ABANDONED_RING_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ABANDONED_QUEUE") AS "ABANDONED_QUEUE_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ENTERED") AS "ENTERED_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ABANDONED_SHORT") AS "ABANDONED_SHORT_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ANS_IN_THRESH") AS "ANS_IN_THRESH_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%'),                           (SELECT     SUM("N_ABANDONED") AS "ABANDONED_ROLLING"                            FROM          "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T2"                            WHERE      "T1"."OBJECT_ID" = "T2"."OBJECT_ID" AND "T2"."TIME_KEY" <= "T1"."TIME_KEY" AND "T2"."TIME_KEY" LIKE '20071220%')FROM        "GENESYSIINET"."R_WFM_GRO_Q_NO_AGG" "T1"WHERE  "T1"."TIME_KEY" LIKE '20071220%'GROUP BY "T1"."OBJECT_ID", "T1"."TIME_KEY"ORDER BY "T1"."OBJECT_ID", "T1"."TIME_KEY"

    Post Author: yangster
    CA Forum: Crystal Reports
    putting the parameter within a single quote is incorrect if it is a string as it will look for a litteral reference to {?date} instead of the valueLIKE {?date} || '%'that should work np as you are con catting a string to another string with 0 to infinite number of characters followingwhat db are you using?

  • Basic Deployment problem, SQL Server 2000 and wanna create setup

    I have just finished making a small app using Java and using JDBC driver to connect to an SQL Server 2000 that is installed on my PC.
    I now want to create a setup (using NSIS) of this app and distribute among friends. But my problem is that I have created the database on my PC on the SQL Server 2000. Do all the people who want to use my app have to have Sql Server 2000 installed ?? How do they get the data from the database if they dont have Sql Server installed??
    I really havent tried much of apps that use databases...soo dont know much, but then any help would be appreciated!!

    They have to connect to an instance of SQL Server 2000 that has the database and schema that your app requires, so the host machine has to be visible in their network, with SQL Server installed, listening on the port in your URL connection string (default is 1433), with a username and password that you've set up for a user with the appropriate permissions GRANTed.
    As you can see, it's not trivial.
    If all the people you're distributing the program to can see your machine's IP address, they can simply connect to your database.
    If not, you should provide all the scripts necessary to create the database and create the tables, set up the permissions, and populate the data.
    %

  • Passing Params & Formulas to SQL Command & Strd Proc in CR 11.5 & 2008 - 1

    I am working with CR 11.5 and heavily use SQL Command rewrites and Stored Procedures (SPs)with the usual limitation that only single parameter values can be passed into SPs, and Parameters must be created within the SQL Command editor (and cannot be referenced to those generated in Field Explorer, or can they?)
    I understand from BE/CR's sales material for CR 2008 that multiple values can now be used under these conditions.  As I recall, Multivalue Parameters are actually arrays that can be made into comma delimited strings.
    Local StringVar StringExpression;
    Local NumberVar ArrayCount := Count({?Code});
    Local NumberVar i;
    if ArrayCount = 0
       then StringExpression := ""
    else
       StringExpression := {?Code}[1];
       i := 2; 
    While i <= ArrayCount Do
        StringExpression := StringExpression + ", " + {?Code}<i>;
        i := i + 1;
    See part 2 for continuation....

    Here is my use case (since most of my reports are against very large databases, running "tuned" SQL Commands is essential).
    SELECT
      PERSON.PatientName,
      PROBLEM.Code,
      PROBLEM.Description
      LASTLABS.HDID,
      RPTOBS.ObsDate,
      RPTOBS.ObsValue
    FROM
      ((PERSON INNER JOIN
        PROBLEM ON
            PERSON.PId = PROBLEM.PId) LEFT OUTER JOIN
         LASTLABS ON
         (PERSON.PId = LASTLABS.PId AND
          LASTLABS.HDID IN (28, 53, 67, 102) LEFT OUTER JOIN      -- Paramaterize
        RPTOBS ON
         (LASTLABS.HDID = C.HDID AND
          LASTLABS.MaxObsDate = RPTOBS.ObsDate AND
          LASTLABS.PId = RPTOBS.PId AND
          RPTOBS.Change IN (2, 5, 7))                             -- Paramaterize
    WHERE
        (PROBLEM.Code LIKE '249%' OR                              -- Paramaterize
         PROBLEM.Code LIKE '250%' OR                              -- Paramaterize
         PROBLEM.Code IN ('V77.1', 'V80')                         -- Paramaterize
    What I am looking for is a Parameterized form as follows....
    SELECT
      PERSON.PatientName,
      PROBLEM.Code,
      PROBLEM.Description
      PROBLEM.Qualifier,
      LASTLABS.HDID,
      RPTOBS.ObsDate,
      RPTOBS.ObsValue
    FROM
      ((PERSON INNER JOIN
        PROBLEM ON
            PERSON.PId = PROBLEM.PId) LEFT OUTER JOIN
        LASTLABS ON
         (PERSON.PId = LASTLABS.PId AND
          LASTLABS.HDID ({?HDID_In_Param}) LEFT OUTER JOIN          -- Paramaterize
        RPTOBS ON
         (LASTLABS.HDID = RPTOBS.HDID AND
          LASTLABS.MaxObsDate = RPTOBS.ObsDate AND
          LASTLABS.PID = RPTOBS.PID AND
          RPTOBS.Change ({?Change_In_Param}))                       -- Paramaterize
    WHERE
        (PROBLEM.Code {?Code_Like_Param} OR                         -- Paramaterize
         PROBLEM.Code {?Code_In_Param})                             -- Paramaterize
    Is this possible? Has it been thought of yet. Has passing in well-constructed @formulas been considered?

  • Possible to change the datasource from a business-view to a Sql Command ?

    Hello,
    When a business view contains a lot of elements it takes a while just to open the report.
    We'd like to keep the BV as the dictionnary, but,
    once the report design completed,
    we'd like to disconnect the business view and replace it by the Sql command which can be seen in the menu option 'show SQL query'.
    Is it possible via the RAS sdk ?
    Did somebody experience this ?
    How to proceed ?
    Thanks a lot
    Alain

    Hi Ted,
    I'm thinking opening a Case for this problem of opening reports based on a big BV.
    We can't really reduce the BV, since it is the dictionnary and we need the whole thing...
    I'm wondering why it is impossible to change the Datasource if the tables and fields underneath are identical.
    Is it impossible to change the fields' mapping ?
    The other solution, as you suggest, is to create a report from scratch, create a new Datasource with the Sql command format, and rebuild the report... I agree it looks like a big job...
    Do you know if it is possible to export the report in XML for instance, change the XML, and then re-import ?
    Thanks for your Help.
    Alain

  • In batch file i want to execute sql commands

    in x.bat file i write the following
    sqlplus user/pass@host @c:\a.sql
    @c:\b.sql
    when i execute this batch file it is connected to the databse
    and the table of a.sql is created in the database.
    but b.sql is not created.
    it is creating only one table
    i want ot create more no of tables with different .sql files
    like @c:b.sql
    @c:c.sql
    @c:d.sql
    please any body help

    The problem you are running into is that SQL Plus only recognizes the first command you have written in the batch file.
    sqlplus user/pass@host
    SPOOL c:\master.log
    @c:\a.sql
    @c:\b.sql
    SPOOL OFF
    SQLPlus will recognize the spool and first sql command, but the batch file gets command back after the first sql command executes and doesn't recognize @c:\b.sql or know what to do with it. To run multiple SQL commands you have to create an external SQL file with all the sql commands in it with the Spool files you want created, then in the batch file you only call the one SQL script.
    Create a master file like so:
    -- Script Name : AllFiles.sql
    SPOOL c:\master.log
    @c:\a.sql
    @c:\b.sql
    SPOOL OFF
    In x.bat
    CALL SQLPlus user/password@database @AllFiles.sql
    This should get you your required results.

  • Cannot change SQL command text in Data Flow Task

    I have an SSIS package that extracts data from Teradata into a SQL Server DB.
    I'm using SQL Server 2008 R2 EE x64, and Visual Studio 2008 PE (BIDS) supplied with it, accessing Teradata v13.
    In the Integration Services project, I have a Data Flow Task, it has an ADO .net source which has Data access mode set to “SQL Command”.
    This worked for a while when I initially entered a SQL statement to select data.
    But, when I change the existing SQL Command text and save the package, the changes are lost.
    It keeps going back to the original SQL Statement.
    It is currently “select col1, col2, … col10 from view1”.
    When I change it to anything else, like “select col5 from view1”, and save, and then double click the ADO NET source again, I find that the SQL command text is still the old one. It goes back to the previous statement.
    I’ve tried other statements like “exec macro” for Teradata, etc. but the same thing keeps happening - changes are not saved.
    Does anyone have any ideas on this, or have you seen this before?

    This is odd, but seems to be a component metadata corruption; so why don't you:
    delete the teradata connector and source component, then re add them back, see if it now accepts the new SQL statement, if this does not work
    abandon this package and create a new one replicating the functionality incorporating the new SQL.
    In case #1 and 2 both fail post here any errors observed and find out whether you are missing any updates to either Teradata provider or SQL Server
    Arthur My Blog

  • Does CTAS evaluate "order by" in APEX SQL Command window?

    I need to recreate my table in order to change the column order. When I use the SQL Commands window and run the SQL, it runs successfully, creates the new table, but doesn't reorder the columns.
    Is this expected behavior?

    user648567 wrote:
    Please update your forum profile with a real handle instead of "user648567".
    I need to recreate my table in order to change the column order. When I use the SQL Commands window and run the SQL, it runs successfully, creates the new table, but doesn't reorder the columns.
    What do you mean by "order by"?
    Using an "ORDER BY" clause in a CTAS (in APEX or anywhare else) will have no effect on column order, which is determined by the order in which columns appear in the projection. It will affect the order in which rows are returned by that query, and it will not determine the order in which rows will be returned by querying the new table in the future.
    To change the column order the columns in the SELECT clause of the CTAS would have to be in a different order from those in the original table,

  • COPY command not working SQL Commands editor

    Hi All,
    I want to have a simple 'one-button-solution' for copying few tables from an external DB into the database where my Apex application is running.
    When I issue the following from the sqlplus command line I get the following output:
    SQL> COPY FROM schema/password@tnsnames_sid TO schema/password@tnsnames_sid REPLACE TABLE_TEST USING select * from TABLE_FOREIGN;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table TABLE_TEST dropped.
    Table TABLE_TEST created.
    2 rows selected from schema@tnsnames_sid.
    2 rows inserted into TABLE_TEST.
    2 rows committed into TABLE_TEST at schema@tnsnames_sid.
    SQL>
    However, if I try exactly the same command from within the Apex 'SQL Commands' editor, I get the following error message:
    ORA-00900: invalid SQL statement
    NOTE that the reason I use COPY command is to overcome problems with LONG datatype which arise when doing simply CREATE TABLE AS.... with dblink.
    In anycase, how can I make this work from within the 'SQL Commands' editor (and therefore in a button process).
    Regards,
    Pawel.

    Hi Harman,
    yes, this is a known issue.
    It's fixed with NW04 SPS 13.
    Regards Matthias Röbig-Landau

  • Issuing SQL command through  Forms

    Hi
    How we can issue SQL command e.g. CREATE USER, through Forms.
    Regards!

    Issues dynamic SQL statements at runtime, including server-side PL/SQL and DDL.
    Note All DDL operations issues an implicit Commit
    Syntax
    Function FORMS_DDL(statement VARCHAR2);
    If you use FORMS_DDL to executed a valid PL/SQL Block:
    If you user FORM_DDL to executed a single DML or DDL stmt :
    Omit the trailing semicolon to avoid an invalid character error
    Thanks

  • How: multiple insert stmt's in Database Express edition SQL commands GUI?

    I have installed the Express 10g version today and played around with it for a while.
    If I go to the SQL commands GUI and enter one insert like this:
    INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (19, 17, 'Mango tree', 1)
    then it works nicely:
    But if I do this:
    INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (20, 17, 'Grape trees', 1);
    INSERT INTO pageit (PagID, PagParent, PagName, PagActive) VALUES (21, 16, 'Animals', 1);
    Then it says:
    ORA-00911: invalid character
    Looks like semicolon is not allowed,
    but if I remove the semicolon then it says;
    ORA-00905: missing keyword
    Is there a way to use multiple insert statements in one go in this GUI at all?
    If not, could someone please recommend how I do this.
    I have exported thousands of insert lines from MySql and I would like to get them into my newly created Oracle table without having to type one line at the time in this gui.
    Any suggestions?
    Then if there is a nice WEB GUI like phpmyadmin for Oracle then I would like to know about that to? (Preferably free)

    I've not done a lot with the express edition, so there may be tools I'm not aware of. There is a dedicated Express Edition forum that may be more helpful for some of these questions.
    I would normally use the command-line SQL*Plus to run a script with a large number of SQL statements. I'd generally prefer, though, to get a comma-separated data file from the other system and load that into Oracle using SQL*Loader for efficiency reasons.
    In Oracle, you would normally only want a single database on a single physical machine. I know in SQL Server that what they call a "database" is roughly equivalent to a "schema" in Oracle, which is created by creating a new user.
    Justin

  • Query help in sql commands

    using apex 4.1 i'm entering the following query in the sql command window and I keep getting a pop-up for Entering Bind Variable. I'm not using bind variables though, anyone else see this issue before?
    SELECT A.FIRST,A.LAST,A.COMPANY AS CNAME,
    J.TOT_MAN_HOURS,
    J.ACREAGE,
    W.NUM_WORKERS,
    W.START_DT
    FROM EW_ACCOUNTS A, EW_WORK_ORDER W, EW_JOBS J
    WHERE A.ID = J.ACCT_ID
    AND J.JOB_ID = W.JOB_ID
    AND W.START_DT >= SYSDATE
    AND W.START_DT < SYSDATE+1
    ORDER BY W.START_DT

    I tried that and it didn't seem to help either.
    Funny though, if I write a new query against just one of the tables and write out each column name. it works. If I use the * instead of writing each column name, I have the same issue.
    This is in apex.appshosting.com free demo environment. I sent them an email asking about it and they told me it was a code issue and they don't support the demo environment.

Maybe you are looking for

  • URGENT help needed in creating external xml video plalist. Please help!

    I was given an assignment to  create and external video playlist using an xml file.  I have never used  flash before, know nothing about encoding and all that was given to the  class in terms of instuctions was a short tutorial that has no  resources

  • Can i use my G5 drive in the Mac Pro?

    Hi. I have a 2005 G5 with a western digital serial ata drive with all my audio on it. I also have an airport card which id like to put in the mac pro. Can i put them in my new mac pro which i should get in the next few days? Im not sure if there is a

  • Resolution 1920x1080 pixelated

    I am using a Nvidia GeForce GTX 470 graphics card with the proprietary nvidia driver. When I set the resolution to something different than 1600x1200 pixels, all icons and fonts look pixelated. I would like to use the native resolution of 1920x1080 o

  • WD ABAP demoprog ios_test_simple_ms

    hi folks, does anyone has an idea why this demoprog - office integration - not works; active-x is enabled, word is installed. do we have to enable something???? i get a scrren with an frame and an red X in the upper left corner. kind regards, oliver

  • Workset opens in a new window??

    Hi, I have created 4 new worksets (Home, PCR, Reports, Status) and assigned pages to these worksets. The workset "PCR" has one page assigned to it and the page contains "Personnel Change Request" iView (this iView is delivered by MSS). If I navigate