Error using variable presentation of Expression SQL

Hi all

I get an error - '... Error to break information... "due to a variable used in a SQL Expression. It probably has something to do with a problem of data type. I have reduced the use of the presentation of the error variable.

I'll put a variable pres_mth_nme_to, presentation, from a prompt of dashboard. The line contains a month name.
I use the variable of presentation as part of a SQL Expression in a filter. Most of the SQL Expression is to use the
presentation in ONE variable and assign a value accordingly. For example:

Column: kind of month value
Operator: between
Value: * 10 *.
SQL expression: * case @{pres_mth_nme_to} {a few default} WHEN "NOV" THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN... END *.

The name of the month is in character. If I was in this hard-coding, I don't get the error. For example:
CASE 'SEP' WHEN 'NOV' THEN '10' WHEN 'DEC '... END

It is something to do with the data type of the command prompt and to be used in the comparison. If I use a CAST, the problem persists.

CASE DROPS (@{pres_mth_nme_to} as char (3)) WHEN 'NOV' THEN... END

If I'm in the responses, the problem does not exist, I guess because of default values. If I'm on the dashboard, there is not, I guess because of the reception of the prompt value.

I don't know what I'm missing. Any suggestions?

Thank you.

DJ,

If the formula presented by you is exactly true, I mean that it was not made to present as an example in the forum, you must include the variable presentation between apostrophes.
either your formula should look something like
Case ' @{pres_mth_nme_to} {a few default}' WHEN 'NOV' THEN '10' WHEN 'DEC' THEN '11' WHEN 'JAN' THEN '12' WHEN 'FEB' THEN '13' WHEN... END

Let me know if it solved the problem...

-bifacts
http://www.obinotes.com

Published by: bifacts on October 25, 2010 13:50

Tags: Business Intelligence

Similar Questions

  • How can I use variable presentation logic SQL

    Hi Experts,

    How can I use variable SQL logical presentation. I need the exact syntax. Kindly help me to achieve this goal.

    "Time". "" Date "between the Date of 2014 '-1-17 'and Date' ' 2014-2-16

    Thanks in advance

    Asim

    It's done... We can use it in the logical query with the same syntax where we use in converting this filter as SQL...

  • How to filter values using variable presentation if it uses a multiselec

    Hi gurus,

    Could you pls suggest me here.
    I have a requirement like my version 10G OBIEE isn't filtering report values when we choose a value any in dash prompt.
    I tried to create a variable presentation in the prompt for filtering, but invites under control, he is given a MULTI SELECT.
    I need to filter the values today if select us any value from the command prompt, it does not choose any value.
    How to filter values using MULTI SELECT Here.Please suggest me here.

    Kind regards
    SK

    Functions applied on the columns must be the two places (in report and guest) and must affect is fast after the function applied in the report.

    In your case is prompt value before cast, it seems that it is the reason why it does not work.

    Mark correct/good so pls help.

  • Using Variables in a system SQL query

    Hello!

    I m new on Oracle and SQL so I Don t know not big thing about it.

    There is problem of customization:

    Is it possible to use the System Variable % username % in a SQL query?

    I tried... where table.shorttag = "% username %";
    but it does not work.

    Oracle is able to manage Systemvariables? Or y at - it another way to use the current Windows user in a SQL query.
    It is very Important to use the current Windows user and not the Oracle user.

    Thank you

    MFG
    SELECT OSUSER FROM V$SESSION WHERE audsid = USERENV('sessionid')
    

    URS

  • variable presentation in the SQL for the scale marker

    ! http://img101.imageshack.us/img101/3476/sqlscalemarket.PNG!

    Hi, experts,

    I want to know if variable presentation is supported in the "sql query" "scale marker.

    I want to move the selected value from the prompt for the sql query!

    Thank you!

    I want to know if variable presentation is supported in the "sql query" "scale marker.

    Scale marker made reference here to the axis scale to increase the width and height or the zoom layout data is dedicated to the see, it has nothing to do with the variable presentation as such. If you can not pass any value for the variable.

  • Using variable in a PL/SQL block

    Here's my query.

    OVER the years LIKE)

    SELECT ROWNUM rn

    OF the double

    CONNECTION OF LEVEL < = (select round (SYSDATE-to_date('2010-01-01','YYYY-MM-DD')) double))

    Select

    TO_CHAR (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'yyyy') * 10000 + (to_date('2010-01-01','YYYY-MM-DD')-1 to_char + rn, "mm") * 100 + (to_date('2010-01-01','YYYY-MM-DD')-1 to_char + rn, 'dd') As Date_ID

    , to_date('2010-01-01','YYYY-MM-DD')-1 + rn as 'Date '.

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'yyyy') as the year

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'MM') As Month_Number

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'Months') as month

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'dd') as DayOfMonth

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'Day') As DayOfWeek

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'd.') As DayOfWeekNo

    (, to_char (to_date('2010-01-01','YYYY-MM-DD')-1 + rn, 'Q') in the quarter

    Years;

    If you run this query, you will see my results.

    Now my concern is that I don't want to hardcode so far. In above query I've hard-coded date ' 2010-01-01'.

    Can use us somehow this variable?

    Like this:

    var start_date varchar2 (10)

    exec: start_date: = ' 2010-01-01'

    OVER the years LIKE)
    SELECT to_date(:start_date,'YYYY-MM-DD') - level dt + 1
    OF the double
    CONNECT BY LEVEL<= (select="" round(="" sysdate-to_date(:start_date,'yyyy-mm-dd'))="" from="">

    )
    Select
    TO_CHAR (dt, 'yyyy') * 10000 + to_char (dt, 'mm') * 100 + to_char (dt, 'dd') as Date_ID
    , dt as 'Date '.
    to_char (dt, 'yyyy') As an
    to_char(dt,'MM') as Month_Number
    to_char(dt,'Month') in the month
    to_char (dt, 'dd') As DayOfMonth
    to_char(dt,'Day') As DayOfWeek
    to_char(dt,'D') as DayOfWeekNo
    to_char(dt,'Q') in the quarter
    Years;

    for example to generate the date you common table expression and then use it in your application?

  • OBIEE 11 g - Can we use variable presentation for results not

    Hi all

    I have a prompt on the dashboard called Department, and there only 3 values

    HUMAN RESOURCES
    Finance
    Marketing

    What I want to do, is that if users select HR to the guest and if the report is not all data for HR, I want to show a message

    There is no data for HR in the report and even there is no data for finance in this report

    I thought I'd take the HR in the presentation variable and using them in the results display no. Is this possible? Is there another way to do this?

    Thank you
    Ronny

    Ronny says:
    Thanks David, that was helpful. But guess that's not possible when I have 100 values for the Department.
    No other way to do this?

    -Ronny

    Hey, Ronny.

    The solution I gave you was based on the command prompt "only has 3 values." Of course, with values of 100, this method becomes impracticable. Can not think of anything that will give you exactly what you want. I'm sorry.

  • Variable presentation doesn't work is not in the filter using expr

    Hi friends,

    I have a quick period with a variable presentation of the v_period used. Inturn, so I applied formula below one of my measure column in the analyses below the means, it does not work when I select the name of period of command prompt. How can I place the presentation variable from the prompt for the filter with expression.

    FILTER ("Fact_GL_balances". "Actual_ending_bal" for HELP ("Dim2_GL_periods" ".") " Period_name' IN ('v_period')))

    Kind regards

    Saro

    Hi, Saro,

    I think the correct syntax when you use variable presentation would be:

    FILTER ("Fact_GL_balances". "Actual_ending_bal" for HELP ("Dim2_GL_periods" ".") " ((IN Period_name' (@{v_period})))

    OBIIE does not generate the correct syntax when you use the expression builder

    And if v_period can have multiple values, you should use this:

    FILTER ("Fact_GL_balances". "Actual_ending_bal" for HELP ("Dim2_GL_periods" ".") " ((Period_name' IN (@{v_period} [' @'])))

    I have not tried in my OBIEE because I need to filter a Dimension column, so I have to use CASES instead of FILTER, but this is my reference:

    Q & A: OBIEE OBIEE 11 g: presentation Variable initialization in a multiple selection prompt

    Concerning

    Ana GH

  • Multiple selection with Variable presentation

    Hello gurus:

    I currently have a dashboard where the user selects a Promotion ID and all other reports are based on this promo-id.

    Now, I use variable presentation for the promo-id.

    Now obligation if, for another page of dashboad, where a user can select up to 4 different promo-ID and compare them from the same measures.

    I was thinking about using PivotTable dynamic to compare and multiselect selection of promotions up to 4 guest.

    However I do not think that variable presentation works with multiple selection prompt.
    So, what should I do about it?

    I can do 4 different guests, but then it will force the user to select 4 promotions every time. I want to do something where the user can select 2,3 or 4 promotions.

    Please help me.
    Thank you.

    ~ Vinay.

    Yes, if you use the same column to create the dashboard and to create the filter.

  • Using a Variable to create the SQL query

    I need to create a "dynamic" update query I want to hold the meeting of the command in a variable and then refer to the query variable.

    Example:

    < cfquery name = "fred" datasource = "mydb" >
    Update db_table_name set
    PBname = "Fred Flintstone",
    pbnumber = ' 555-555-1234. '
    pbage = 25
    where recnum = 24
    < / cfquery >

    I would like use this code:
    < cfset upst = "pbname ="Fred Flintstone", pbnumber =' 555-555-1234, pbage = 25" > ".
    < cfquery name = "fred" datasource = "mydb" >
    Update db_table_name set
    #upst #.
    where recnum = 24
    < / cfquery >

    When I run the present, I get the following error message:
    Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] syntax error (missing operator) in query expression "Fred Flintstone".

    The SQL is:
    Update db_table_name set pbname = "Fred Flintstone", pbnumber = "555-555-1234", pbage = 25 where recnum = 24

    I know it's hard to see, but the "are 2' No 1". I have no idea why Coldfusion (or perhaps the ODBC driver?) puts the 2nd "in the command that causes the errors.

    Anyone can shed some light on this subject?

    While it is a simple example, my application is much more complex. I have over 50 fields in the update and based on changes to the values of the form, I may need to update all fields, some fields or NO fields.

    Can I use < cfif > test if all the fields have changed and if so, include them in the update command, but if NONE of the fields have changed, I update the command vacuum and therefore get an error. I want to avoid having to test changes twice (once to determine if I do the update and twice to perform the update).

    Thank you
    Mike.

    CF automatically escapes single quotes, he must preserve them


    Update db_table_name set
    #PreserveSingleQuotes (upst) #.
    where recnum = 24

    Ken

  • OBI, variable presentation using results

    Hello!

    I have the text field with long text strings.

    I want to get results, using the filter "contains all" by this field

    Example:

    Values
    aaaa000
    aa000aa
    bbbaa

    I have entry to filter "a0" and I want to get results according to:

    Values
    aaaa000
    aa000aa

    If the filter field will be empty, I get the error, but I want to get all the rows in the result.

    How can I do?

    I did the following:

    1. in the analysis I marked new filter, type "CONSTAINS ALL". ": number" used as a variable presentation

    1 new analysis.jpg

    2. I did new dashboard prompr, where I did prompt variable, named ": number", type "Variable presentation."

    2 parameter.jpg

    3. I did the new dashboard, where I dragged my dashboard prompr and analysis

    Now, when the filter-field 'number' is empty, I get the error (and I agree with OLIVIER, because I did not specify the terms of null value):

    3 bad with empty.jpg

    And when I write all values in the filter field, everything works

    4 good when not empty.jpg

    I tried to fix it in the analysis, used 'Convert this SQL filter' and wrote the following sql text:

    "presentation_tmp"."WB_NUMBER" LIKE
    CASE
      WHEN @{:number} IS NULL THEN "presentation_tmp"."WB_NUMBER"
      ELSE concat(concat('%',@{:number}),'%')
    END
    

    But it did not help me

    How can I get all the lines, when the filter-field 'number' is empty?

    Hello

    Not really sure how you get this error when the field is empty (you should only get no result) but if you change your filter in the report to:

    WB_NUMBER contains all @{: number}

    TO

    WB_NUMBER contains all @{: number} {%}

    You should get all the values when you do not have any value in the dashboard line. Basically, put '%' in the default value of your filter.

  • 65 b error code trying to upgrade Microsoft SQL Server 2005 Express Edition Service Pack 4 (KB2463332)

    65 b error code trying to upgrade Microsoft SQL Server 2005 Express Edition Service Pack 4 (KB2463332)

    Hi Auckland_White,

    ·         Did you the latest changes on the computer?

    ·         You are able to install some other updates on the computer?

    ·         You have security software installed on the computer?

    I suggest you try the steps below and check if it helps

    Method 1: If the problem persists, download and save the installation package' Microsoft SQL Server 2005 Service Pack 4 "on your desktop and try to install the same audit and clean boot.

    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: Make sure that return you the computer to a normal startup mode once it's done.

    Microsoft SQL Server 2005 Service Pack 4: http://www.Microsoft.com/downloads/en/details.aspx?FamilyId=b953e84f-9307-405e-bceb-47bd345baece

    Method 2: I suggest that reset you the default Windows Update components and check if you can install the update.

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Hope this information is useful.

  • Use variables in PL/SQL update table statement

    Hi all, I'm having trouble trying to do something very specific in PL/SQL. I am currently working on a screen of editable interactive report based on a table. As part of this Setup, I created a stored process. I go through some values of the screen in the process as follows and put them to variables as follows:

    IDVALUE (number) - identification number transmitted to the line being edited

    Name FIELDNAME (Varchar2) - from the field being changed

    FIELDVALUE (Varchar2) - field value passed


    I need to execute a PL/SQL statement to update the relevant column of the relevant line in the table with the value passed. After reading online, I gathered that to use a variable in a PL/SQL statement, you need to put ' | || "around it. Here is the declaration of Dashboard update at the beginning, I tried to run:

    UPDATE HEADCOUNT_VACANCIES SET ' | FIELDNAME. ' = ' || FIELDVALUE | ' WHERE ID = | IDVALUE;

    However, it is back with a specification user.table.column, table.column or invalid column error. I read on a different page than if we use past education variables must be stored as a varchar and then executed. So, I tried to set up the statement as a varchar variable and then execute it as follows:

    SQLBLOCK: = "UPDATE HEADCOUNT_VACANCIES SET | FIELDNAME. ' = ' || FIELDVALUE | ' WHERE ID = '. IDVALUE';

    RUN IMMEDIATELY SQLBLOCK;

    It comes back with an error "has met the following when waiting in the following way. All those used last before PL/SQL variables? If Yes please can you inform me where I'm wrong? To try to fix the problem, I cut down the process code to the below, but it still does not work:

    DECLARE

    FIELDNAME VARCHAR (100);
    FIELDVALUE VARCHAR (100);

    NUMBER OF IDVALUE;
    SQLBLOCK VARCHAR (2000);

    BEGIN

    FIELDNAME: = "IN_OUT_STATUS";

    FIELDVALUE: = "IN";

    IDVALUE: = 1;

    SQLBLOCK: = "UPDATE HEADCOUNT_VACANCIES SET | FIELDNAME. ' = ' || FIELDVALUE | ' WHERE ID = '. IDVALUE';
    RUN IMMEDIATELY SQLBLOCK;

    END;

    Any help much appreciated.

    HI 2740884,

    declare

    FIELDNAME varchar2 (1000): = "IN_OUT_STATUS";

    IDVALUE varchar2 (100): = '1';

    FIELDVALUE varchar2 (100): = "IN";

    SQLBLOCK varchar2 (2000);

    Start

    SQLBLOCK: = "UPDATE HEADCOUNT_VACANCIES SET ' |" FIELDNAME. ' =: FIELDVALUE WHERE ID =: IDVALUE';

    EXECUTE IMMEDIATE SQLBLOCK FIELDVALUE USING, IDVALUE;

    end;

    OR

    YOU CAN PASS THE NAME OF THE TABLE AS

    declare

    v_table_name varchar2 (1000): = "HEADCOUNT_VACANCIES";

    fieldName varchar2 (1000): = "IN_OUT_STATUS";

    IDVALUE varchar2 (100): = '1';

    FIELDVALUE varchar2 (100): = "IN";

    SQLBLOCK varchar2 (2000);

    Start

    SQLBLOCK: = 'UPDATE'. v_table_name | 'VALUE' | fieldName. ' =: FIELDVALUE WHERE ID =: IDVALUE';

    EXECUTE IMMEDIATE SQLBLOCK FIELDVALUE USING, IDVALUE;

    end;

  • Is it possible to use the default value as sql expression in obiee 11g report?

    Hi all

    Is it possible to use the default value as sql expression in obiee 11g report?. Actually what I'm trying to make is that we send an ibot users. They want the same default values that are assigned in the command prompt in the report. So when we send the ibot it shows the report for default values assigned in the report criteria which is obsolute. As a solution, I kept the report in a dashboard page and send the dashboard like ibot page. But the problem here is that I can send only pdf format. Is it possible to do so at the level of the report (without using session variables). I want something like that

    Date between Date ' @{PV1} {Timestampadd (SQL_TSI_DAY,-90, CURRENT_DATE)} and Date ' @{PV2} {CURRENT_DATE}

    Thanks in advance

    Thank you

    AJ

    http://www.w3.org/2001/XMLSchema-instance"container ="http://www.w3.org/2001/XMLSchema"xmlVersion ="201201160' xmlns:sawx="com.siebel.analytics.web/expression/v1.1" > "

    "Question time '." Date '.

    "Question time '." Date '.

    BOX WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 1) THEN TIMESTAMPADD (SQL_TSI_DAY,-2, cast (max (CURRENT_DATE) as date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 2) THEN TIMESTAMPADD (SQL_TSI_DAY,-3, cast (max (CURRENT_DATE) as date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 3) THEN TIMESTAMPADD (SQL_TSI_DAY,-4, cast (max (CURRENT_DATE) as date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 4) THEN TIMESTAMPADD (SQL_TSI_DAY-5 (, cast (max (CURRENT_DATE) date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 5) THEN TIMESTAMPADD (SQL_TSI_DAY,-6, cast (max (CURRENT_DATE) as date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 6) THEN TIMESTAMPADD (SQL_TSI_DAY, 0, cast (max (CURRENT_DATE) as date)) WHEN (DAYOFWEEK (cast (max (CURRENT_DATE) date)) = 7) THEN TIMESTAMPADD (SQL_TSI_DAY-1, cast (max (CURRENT_DATE) date)) END

  • Error in replacement of the expression (mydatastore.mycol, ' ', ") on SQL ANSI

    I am trying to use an expression simple transformation on a target attribute of data with Oracle technology store: replace (COMMON_CIDADAO. APELIDO, ' ', ").

    So simple as that.

    When you run this mapping I got this error in a message box:

    «An error was encountered when parsing the expression: replace (COMMON_CIDADAO.» APELIDO, ' ', ").

    The default parser supports the ANSI SQL delimiters. If you want a nonstandard syntax, use delimiters form free expression / %% and %% / around the expression. »

    All the answers? Thanks in advance!

    José Nicolau

    Here is some info based on a Service request response.

    Bug 18610699 - ODI 12 c - REPLACE USER FUNCTION CAUSING the ERROR SQL ANALYSIS

    There is a similar Bug 17924215 - MAPPING VALIDATION has FAILED AFTER UPGRADE TO 11 G REPO because of ERROR of ANALYSIS already filed and DEV has indicated that it will be fixed in 12.1.3 release.

    I hope that 12.1.3 will be out soon!
    Kind regards
    Michael Rainey

Maybe you are looking for

  • Is a help in offline mode option available?

    In HIS internet is sometimes slow or not available and expensive. A help option offline (such as available for example in LibreOffice) would be very convenient, but I could find one. Have I missed?

  • Firefox hangs at startup on Android Tablet

    We have almost 600 Android Samsung Galaxy Tablet 10.1 with 16.02 installed Firefox. Starting last night, almost every one of them is to get a Firefox crashed message at startup. We tried to upgrade to 18 years, but this does not solve it. So far, the

  • Bus SM EIB 6300 MT controller

    Hallo, ICH verzweifle made. IM Geratemanager steht ein S; - Bus und ich out also nicht installed controller. PCI\VEN_8086 & DEV_1E22 & SUBSYS_339A103C & REV_04\3 & 11583659 & 0 & FB Kann mir bitte someone help. Operating system XP

  • I hope someone can help.my p7-1054 has a black screen

    I hope someone can help.my p7-1054 has a black screen

  • Printing in black only-project mode

    Hello I'm trying to set up my HP 6520 on my mac to print only in black and project/quick mode... How to do this. Thanks in advance for anyones help