User input prompt in CASE statement

I would like to obtain user input via a prompt and use what the user selects in my OBIEE Report case statement.
For example &START_DATE AND &END_DATE are user inputs:
CASE when SHIP_DATE BETWEEN &START_DATE AND &END_DATE THEN 1
Thanks

Use presentation variables for start and end_dates
In the criteria tab->SHIP_DATE->click on fx
on Edit Column Formula->Bin Tab->
Add Bin->Add button->Variable->Presentation
Use the presenation variables with with required condition
Okay then set 1 at Edit Bin Name
Mark if helps
Srini VEERAVALLI on Feb 7, 2013 5:23 PM
Any updates on this?
Edited by: Srini VEERAVALLI on Feb 20, 2013 4:10 PM

Similar Messages

  • Prompting for user input in nested select statements

    I recently rewrote a query to use a nested select statement instead of specifying every SELECT field on the GROUP BY line.  Here's the query which works perfectly with hard-coded values of '030', '01/01/11', and '12/31/11'.
    SELECT T0.[CardName] AS Customer, T0.[CardCode] as 'Cust ID', T0.[Phone1] as Phone, T0.[CntctPrsn] as 'Contact Person', T0.[Address], T0.[City], T0.[State1] as State, T0.[ZipCode] as 'Zip Code', T0.[Country],  T1.[TotalSales]
    FROM OCRD T0 
    INNER JOIN
       (SELECT I.[CardCode] AS CardCode, SUM(I.[DocTotal]) AS TotalSales
        FROM OINV I
        WHERE left (I.[CardCode], 3) = '030' AND (I.[DocDate] >= '01/01/11' AND I.[DocDate] <= '12/31/11')
        GROUP BY I.[CardCode]) T1
    ON T0.[CardCode] = T1.[CardCode]
    ORDER BY T0.[CardName]
    When I try to prompt for the left 3 characters of the CardCode (or the dates), ie.
        WHERE left (I.[CardCode], 3) = [%0] AND (I.[DocDate] >= '01/01/11' AND I.[DocDate] <= '12/31/11')
    I get an error "Column 'OCRD.CardName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause".
    It's like putting a user variable in the inner SELECT made it part of the outer SELECT which is exactly what I was trying to avoid by re-writing this query with the inner SELECT.
    Can anyone explain what SQL Server is doing here and how to fix it?

    Thanks Gordon.  That's how I originally wrote the query and it works fine.  But I was disturbed that I had to GROUP BY every field in my SELECT statement when I really only wanted to group by CardCode.  So I did some research and came up with this where the inner select still groups by only CardCode and still takes user input.  I don't really understand why you need the commented SELECT statements in the SET lines, but you do.  Something about using real table fields for variables.
    DECLARE @startDate datetime
    DECLARE @endDate datetime
    DECLARE @rep varchar(10)
    SET @rep /* SELECT T0.[CardCode] FROM ORDR T0 WHERE T0.[CardCode] */ = '[%0]'
    SET @startDate /* SELECT T0.[DocDate] FROM OINV T0 WHERE T0.[DocDate] */ = '[%1]'
    SET @endDate /* SELECT T0.[DocDate] FROM OINV T0 WHERE T0.[DocDate] */ = '[%2]'
    SELECT T0.[CardName] AS Customer, T0.[CardCode] as 'Cust ID', T0.[Phone1] as Phone, T0.[CntctPrsn] as 'Contact Person', T0.[Address], T0.[City], T0.[State1] as State, T0.[ZipCode] as 'Zip Code', T0.[Country],  T1.[TotalSales]
    FROM OCRD T0 
    INNER JOIN
       (SELECT I.[CardCode] AS CardCode, SUM(I.[DocTotal]) AS TotalSales
        FROM OINV I
        WHERE left (I.[CardCode], 3) = @rep AND (I.[DocDate] >= @startDate AND I.[DocDate] <= @endDate)
        GROUP BY I.[CardCode]) T1
    ON T0.[CardCode] = T1.[CardCode]
    ORDER BY T0.[CardName]
    FOR BROWSE

  • Prompts  in Case Statement

    Hello Friends,
    I am using Prompts in BI Publisher.
    My Query in data model is as below and I get an error
    SELECT
    CASE WHEN "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Year" in (:P_Year) THEN SUM("- Nx_PA Budget Actuals
    FROM "[Analytical] eDW_Projects"
    where "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Month" < (:P_Month)
    ERROR : java.io.IOException: prepare query failed[nQSError: 42032] Parameters are not supported in the select list.
    But when I do
    SELECT
    CASE WHEN "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Year" in ('2010') THEN SUM("- Nx_PA Budget Actuals
    FROM "[Analytical] eDW_Projects"
    where
    where "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Month" < (:P_Month)
    it works fine.
    Please help. Is there an option to sue prompts is Select/ Case Statement other than where statement.
    Thanks
    ------

    Thanks friend,
    I am trying to do the foll: and want to calculate M2M and Y2M ,, For example if the Month in Prompt is MAY and Year is 2010 , then I am expecting
    1) Budget Actuals from Jan till MAY 2010
    2) Budget Actuals for MAY 2010
    But My actual SQL is like
    SELECT
    CASE WHEN "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Year" in (:P_Year) THEN SUM("- Nx_PA Budget Actuals)
    CASE WHEN "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Year" in (:P_Month) THEN SUM("- Nx_PA Budget Actuals)
    SUM("- Nx_PA Budget Actuals)
    FROM "[Analytical] eDW_Projects"
    where "- Nx_Transaction Date Attributes (Nightly PA Budget Actuals Summary)"."Calendar Month" < (:P_Month)

  • How to change date format of user input prompt in infoview.

    Hi All,
    Every report webi or deski having date field as prompt when viewed in view mode in infoview shows date format as M/d/yyyy h:mm:ss a.
    Where this format is stored and how can we change it to dd/mm/yyyy.
    Any ideas.
    Regards,
    Gaurav

    Not sure id this helps...
    I was up against a similar issue of placing the user input dates, Starting & Ending, into one cell for a reference on each report header. After a few hours of diligence, I came up with a working model that finally worked:
    u_StartDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (Start):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    and
    u_EndDateAsTXT=FormatDate(ToDate(UserResponse("Enter Date/Time Shipped (END):");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    The report header has the following function:
    =u_StartDateAsTXT + u201C u2013 u201C + u_EndDateAsTXT

  • Capturing and displaying user input in Crystal Reports

    Hi all,
    Iu2019m creating a crystal report with SAP as data-source and want to capture user input and display it on the report.  I have defined parameters to capture the input and added them to the report header.   I have then created formula fields to capture user input using the JOIN statement to accommodate multiple values.   Everything works well when users enter values for all the parameters, but when they leave some blank I get an error message u201CParameter value is nullu201D.
    Has anyone encountered this type of problem;  Anyone knows how to resolve this?

    Hi
    In parameter window make the Optional prompt to True.  And change make change in your record selection formula like this :
    (not HasValue({?PrjMgr@SELECT Firstname,lastname FROM OHEM}) OR
    ISNULL({?PrjMgr@SELECT Firstname,lastname FROM OHEM}) OR
    ({?PrjMgr@SELECT Firstname,lastname FROM OHEM} = '') OR
    {OHEM.firstName} = {?PrjMgr@SELECT Firstname,lastname FROM OHEM})
    Regards

  • User Input in Dos Programs

    Hi, sorry for such as newbie type question but iv just started programming in Java (so im used to the simpleness of vb). I have a simple Java Dos program, and i understand the system. functions but was wondering how i could get the > user input prompt. any help would be greatly appreciated. thanks!
    WC

    See if this isn't what you want:
    import java.io.*;
    // This program displays the user's input
    public class GetInput {
         public static void main(String[] args) throws IOException {
              // This is how we set things up to read lines of text from the user.
              BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
              // Loop forever
              for(;;) {
                   // Display a prompt to the user
                   System.out.print("Type something> ");
                   // Read a line from the user
                   String line = in.readLine();
                   // If the input is null or if the user types �quit�, then quit
                   if (line.equals("") || line.equals("quit"))
                         break;
                   try {
                        System.out.println(line);
                   // If anything goes wrong, display a generic error message
                   catch(Exception e) {
                        System.out.println("Invalid Input");
    }

  • Is it possible to use a case statement when joining different tables based on input parameters?

    Hi,
    I have a scenario where my stored procedure takes 5 parameters and the users can pass NULL or some value to these parameters and based on the parameters, I need to pull data from various tables.
    Is it possible to use a case statement in the join, similar the one in the below example. I'm getting error when I use the below type of statement.
    select a.*
    from a
    case
    when parameter1=1 then
    inner join a on a.id = b.id
    when parameter1=2 then
    inner join a on a.id = c.id
    end;
    Please let me know, if this type of statement works, and if it works will it create any performance issues?. If the above doesn't work, could you please give me some alternate solutions?
    Thanks.

    Here's a technique for joining A to B or C depending on the input parameters. In theory, you are joining to both tables but the execution plan includes filters to skip whichever join is not appropriate. The drawback is that you have to do outer joins, not inner ones.
    CREATE TABLE A AS SELECT LEVEL ak FROM dual CONNECT BY LEVEL <= 100;
    CREATE TABLE b AS SELECT ak, bk
    FROM A, (SELECT LEVEL bk FROM dual CONNECT BY LEVEL <= 10);
    CREATE TABLE c(ak, ck) AS SELECT ak, bk*10 FROM b;
    variable p1 NUMBER;
    variable p2 NUMBER;
    exec :p1 := 1;
    exec :p2 := 20;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.01 |       7 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |
    |*  5 |     FILTER            |                 |      1 |        |      9 |00:00:00.01 |       4 |
    |*  6 |      TABLE ACCESS FULL| B               |      1 |      9 |      9 |00:00:00.01 |       4 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |
    |*  8 |    FILTER             |                 |      1 |        |      0 |00:00:00.01 |       0 |
    |*  9 |     TABLE ACCESS FULL | C               |      0 |      9 |      0 |00:00:00.01 |       0 |
    Predicate Information (identified by operation id):
       1 - access("A"."AK"="ITEM_0")
       2 - access("A"."AK"="ITEM_1")
       3 - filter("A"."AK"<=9)
      5 - filter(:P1 IS NOT NULL)
       6 - filter(("B"."AK"<=9 AND "B"."BK"=:P1))
       8 - filter((:P2 IS NOT NULL AND :P1 IS NULL))
       9 - filter(("C"."AK"<=9 AND "C"."CK"=:P2))
    You can see that table C was not really accessed: the buffer count is 0.
    exec :p1 := NULL;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    Now table B is not accessed.
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.02 |       7 |      2 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.02 |       7 |      2 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |*  5 |     FILTER            |                 |      1 |        |      0 |00:00:00.01 |       0 |      0 |
    |*  6 |      TABLE ACCESS FULL| B               |      0 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |
    |*  8 |    FILTER             |                 |      1 |        |      9 |00:00:00.01 |       4 |      2 |
    |*  9 |     TABLE ACCESS FULL | C               |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |

  • "catching" a prompt for user input and answering it through zenity?

    I'm trying to write a script (or multiple scripts) that will allow me to use command-line only applications via user defined actions in my file manager without having to open a terminal. Now I realize this basic functionality is already available, but as it stands I am unable to respond to command-line prompts for user input without opening a terminal. Is it possible to write a shell script that would act as a wrapper and allow me to use zenity (or another popup program) to respond to such queries?
    For example if I used a command-line program that prompted me for a password, could I "catch" that prompt with a shell script and answer it through another program, such as zenity?
    Last edited by falconheart (2011-01-16 22:37:25)

    The easier way to do this is to collect the info with zenity first, then pass it on the command line.  If the program insists on prompting, then you could try feeding it the info with redirection if it accepts it from stdin.  For example
    command < info.txt
    where info.txt is a temp file created by your script which contains whatever you want entered into the prompts.  This will work in some cases.

  • How to prompt for user input in Forms

    How do I prompt for user input in Forms?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?

    Desgordon,
    This can be accomplished by displaying your message to the user using an Alert. I use 3 different Alerts (Note, Caution and Stop) in my forms and they are inherited from a central source file (such as an Object Library or a Template Form) so they can be used by all of my Forms. You can set the text of the Alert using the SET_ALERT_PROPERTY() built-in and capture what button the user presses with the SHOW_ALERT() built-in. Additionally, if you need more than one button to be displayed in an alert, you use the SET_ALERT_BUTTON_PROPERTY() built-in to rename the default button or to add up to a total of three buttons in the alert. Here's an example:
    DECLARE
       Alert_ID       ALERT;
       v_AlertType    VARCHAR2(10) := 'CAUTION';
       v_AlertTitle     VARCHAR2(25);
       v_AlertText    VARCHAR2(150);
       n_AlertButton  NUMBER;
    BEGIN
       v_AlertTitle := 'Title of Alert';
       v_AlertText := 'This is message to the user.';
       /* Code leading up to the decision point. */
       alert_id := FIND_ALERT(v_AlertType);
       /* Note: I only set the Label of Button 2 because the default button 1 label is 'OK' */
       SET_ALERT_BUTTON_PROPERTY(v_AlertType, ALERT_BUTTON2, LABEL, 'Cancel');
       SET_ALERT_PROPERTY(Alert_ID, v_AlertTitle, v_AlertText);
       n_AlertButton := SHOW_ALERT(Alert_ID);
      /* Now I can test the value of n_AlertButton for 1 or 2 to find out what button the user selected. */
      IF ( n_AlertButton = 1 ) THEN
         /* Do something, because the user selected 'OK' */
      ELSE
         /* It is assumed at this point that the user selected 'CANCEL' */
         /* Stop processing any further. */
         RAISE form_trigger_error;
      END IF;
    END:Hope this helps.
    Craig...
    -- If my response or the response of another answers your question, please mark the response accordingly. Thanks!

  • How to prompt for user input in PL/SQL

    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
    Edited by: desgordon on Sep 3, 2008 10:33 AM

    desgordon wrote:
    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
    >
    If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
    >
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
    But if you call your procedure in that button then yes 'control will be passed back to the code'...
    Cheers!
    Edited by: Faust on Sep 3, 2008 7:57 PM
    Too slow...

  • Require User Input for either dashboard prompts not BOTH ! !

    Fellow Earthlings,
    How to make required for user input for either of dashboard prompts not BOTH. !!!!!!
    Like if they enter '123' on DashP1 they need not have to enter DashP2 value and vice versa on same dashboard prompt.
    I have some dashboard prompts and I am using presentation variables to pass these values to my analysis.
    DashP1 - Pvar1 - Default All columns - User can type in values
    DashP2 - Pvar2 - Default All columns - User can type in values
    In my report , I am using a SQL filter to do a table.column_name LIKE (concat('@Pvar1}{'%')) same for the other table.column_name LIKE (concat('@Pvar2}{'%')) [ This is because users want to do a partial match on the value.
    So when the user is typing the values like 123 on DashP1 they are able to search, which is good. However on DashP2 which defaulted to all column values, they just erase/delete that and pass no value to it. So it remains the prompt vlaue is looking like -Select Value state which is not good. :(
    Now when there report is run for that DashP1 -value as '123' obviously we get no results since erasing that is causing it not to pass any value and when i check the query log it passes '@Pvar2'. This is causing no results.
    So I thought making it Required user input would resolve the issue, however the new request is to have either DashP1 or DashP2 require user input.
    Please advice if there a way to solve this problem.
    If this any way possible with Action links or any other methods.
    Any help is greatly appreciated.
    Thanks,
    VidyaS

    Hi Vidya, Please post that Script it will be quite handy for other OTN users.
    Thanks
    NK

  • Naming the evaluated case statement field with concatenating input variable value

    Hi,
    I am trying to add the input variable value to case statement evaluated field like below query:
    declare @Year varchar(4)
    select ProductCode,datepart(mm,Date) MonthValue,
      case when datepart(mm,Date) = 1 then sum(Price) else 0 END AS Jan+@Year,
      case when datepart(mm,Date) = 2 then sum(Price) else 0 END AS Feb+@Year,
      case when datepart(mm,Date) = 3 then sum(Price) else 0 END AS Mar+@Year,
      case when datepart(mm,Date) = 4 then sum(Price) else 0 END AS Apr+@Year,
      case when datepart(mm,Date) = 5 then sum(Price) else 0 END AS May+@Year,
      case when datepart(mm,Date) = 6 then sum(Price) else 0 END AS Jun+@Year,
      case when datepart(mm,Date) = 7 then sum(Price) else 0 END AS Jul+@Year,
      case when datepart(mm,Date) = 8 then sum(Price) else 0 END AS Aug+@Year,
      case when datepart(mm,Date) = 9 then sum(Price) else 0 END AS Sep+@Year,
      case when datepart(mm,Date) = 10 then sum(Price) else 0 END AS Oct+@Year,
      case when datepart(mm,Date) = 11 then sum(Price) else 0 END AS Nov+@Year,
      case when datepart(mm,Date) = 12 then sum(Price) else 0 END AS Dec+@Year
    from Sales_Imports where datepart(yyyy,Date) = @Year
    group by  ProductCode, datepart(mm,Date)
    Please help me any other way as this is not working...
    Thanks,
    Srini

    create table Sales_Imports (ProductCode int, Price int, [date] date)
    insert into Sales_Imports values
    (1,10,'1/1/2014'),(1,109,'2/1/2014'),(1,10,'1/1/2014'),(1,109,'12/1/2014'),
    (2,10,'1/1/2014'),(2,109,'2/1/2014'),(2,10,'10/1/2014'),(2,109,'12/1/2014')
    declare @Year varchar(4)='2014'
    DECLARE @MaxCount INT, @SQL NVARCHAR(max) ,@i INT;
    Set @MaxCount = 12 
    SET @i = 0;
    SET @SQL = '';
    WHILE @i < @MaxCount
    BEGIN
        SET @i = @i + 1;
        SELECT @SQL = @Sql + ', SUM(CASE WHEN datepart(mm,[Date]) = ' + cast(@i AS NVARCHAR(10)) + ' THEN  Price Else 0 END) AS ' +Left(DateName(month,Dateadd(month,@i-1,0)) ,3)+@Year
    END
    SET @SQL = N' SELECT  ProductCode, datepart(mm,Date) MonthValue ' + @SQL 
    + N' FROM  Sales_Imports
     where datepart(yyyy,Date) ='+ @Year + N'group by  ProductCode, datepart(mm,Date)
     Order by ProductCode, datepart(mm,Date)';
    --PRINT @SQL;
    execute (@SQL);
    --Or your original one
    declare @Year varchar(4)
    Set @Year ='2014'
    declare @SQL  Nvarchar(4000)
    SET @SQL=
    N' select ProductCode,datepart(mm,Date) MonthValue,
      case when datepart(mm,Date) = 1 then sum(Price) else 0 END AS [jan' +@year+'],
      case when datepart(mm,Date) = 2 then sum(Price) else 0 END AS [feb' +@year+'],
      case when datepart(mm,Date) = 3 then sum(Price) else 0 END AS [Mar'+@year+'],
      case when datepart(mm,Date) = 4 then sum(Price) else 0 END AS [Apr'+@year+'],
      case when datepart(mm,Date) = 5 then sum(Price) else 0 END AS [May'+@year+'],
      case when datepart(mm,Date) = 6 then sum(Price) else 0 END AS [june'+@year+'],
      case when datepart(mm,Date) = 7 then sum(Price) else 0 END AS [july'+@year+'],
      case when datepart(mm,Date) = 8 then sum(Price) else 0 END AS [Aug'+@year+'],
      case when datepart(mm,Date) = 9 then sum(Price) else 0 END AS [Sep'+@year+'],
      case when datepart(mm,Date) = 10 then sum(Price) else 0 END AS [Oct'+@year+'],
      case when datepart(mm,Date) = 11 then sum(Price) else 0 END AS [Nov'+@year+'],
      case when datepart(mm,Date) = 12 then sum(Price) else 0 END AS [Dec'+@year+']
    from Sales_Imports where datepart(yyyy,Date) = ' + @Year +N' group by  ProductCode, datepart(mm,Date)'
    --print @Query
    Execute (@SQL)
    drop table Sales_Imports

  • How to force sql developer to prompt for user input for every execution ?

    Hi Folks,
    Environment: Oracle 11g (on Windows 7)
    SQL Developer: *3.1.07*
    I am executing a PL/SQL code off Sql Developer. The code uses substitution variables to prompt user for input. However,I am only prompted for the user input for the very first run of the code. For the subsequent executions, the code simply picks up the user input from the very first run. This behavior persists for all subsequent runs of the code.
    I have executed the same piece of code from SQL*PLUS and the behavior seems normal (i.e. I am prompted for fresh input for every execution)
    How can flush out the old user input so I can be prompted for new user input for every run of the code in sql developer?
    Thanks in advance
    rogers42

    Hi Rogers42,
    1/try
    undefine
    undefine fred
    select '&&fred' from dual;
    [run this multiple times]
    [prompts gere]
    old:select '&&fred' from dual
    new:select 'a' from dual
    'A'
    a
    [prompts here]
    old:select '&&fred' from dual
    new:select 'b' from dual
    'B'
    b
    2/try
    exit (requires recent version of sql developer: tools->preferences->Database->worksheet->Re-initialize on script exit command)
    select '&&fred' from dual;
    exit
    run this multiple times
    [prompts here]
    old:select '&&fred' from dual
    new:select 'x' from dual
    'X'
    x
    Commit
    [prompts here]
    old:select '&&fred' from dual
    new:select 'y' from dual
    'Y'
    y
    Commit
    3/use &fred instead of &&fred
    For background see
    http://totierne.blogspot.co.uk/2010/04/substitution-and-bind-variables.html
    -Turloch
    SQLDeveloper team

  • Set Assigned to in case from user input form

    Hi there
    Can anyone tell me if you can set the case Assigned to property from a user input field.
    Like you can set a category <input type="text" value="Client App id tag" maxlength="255" id="CAT_Category" name="CAT_Category" class="cat_textbox_small" />
    Maybe cat_assignedTo ?
    Cheers Daniel

    Hi Octopuse,
    Please check if you defined the object type in the form
        <action type="add">
          <form AutoManaged="1" ... ObjectType="NAMESPACE_UserMaster" ... uid="NAMESPACE_FORM">
            <datasources>
    Please keep in mind that table names and user objects should always be prefixed with the partner Namespace.
    Regards,
    Vítor Vieira

  • Creating Drop Down or Option selection for prompt user input.

    Hello,
    I wanted to know how can I create a drop down menu that has predefined values? I have the prompt user input vi. When it says enter voltage..i want the user should be able to select from a drop down menu values..also is it possible to have a predefined set of values from which a user can select...say 5 values are displayed and user selects one of them each time the vi is run...can this be realized..kindly help.
    Thanks.
    Ravi

    Hi Ravi,
    you can use a text ring  or a menu ring control located on the Ring and Enum on the control pallete.
    for a pre defined value you can edit that control to have what ever values you want from the user to input.
    You can change the menu option by right clicking on the ring control and choosing Edit items from the list and use the values you want.
    Regards,
    Nitin

Maybe you are looking for

  • How can I get my web cam to work in Adobe Connect ?

    This is actually an end user's question that I am having trouble answering to... We use Adobe Connect to give online language classes, the end user is one of the students. I cannot find the right Support answer to give him. Problem: My camera does no

  • I am in the UK. Can I use the iPad Mini when on holiday in Sri Lanka?

    I am in the UK. Can I use the iPad Mini when on holiday in Sri Lanka?

  • Viewing videos in full screen or at least 2x

    I watch a lot of streaming video on Safari (I don't have a TV). CNN, Jon Stewart, etc. On a Windows PC, I am able to right click an select a zooming choice (full screen. Do I need to download IE or Netscape for MAC? Another question, somewhat related

  • FX viewer not working.

    I created few SVG's using InkScape and some downloaded from internet. I am able to convert SVG(created using InkScape) to FX with converter, but when I try to view them using viewer it is giving "cannot find symbol" ERROR: ...../jfx/inks.fx from Stri

  • HFM: Delete Application

    Hi all, Product: HFM version 11.1.1.3.0 Database: Oracle 10GR2 HFM is 64 bit application (Classic) Purpose of action: To get more disk space by deleting some application on UAT environment? How I delete the application? Delete the application from Sh