Creating a variable in a select

Hi, I trying to do a select statement like this:
select (x-y) as test1, (test1*4) as test2 from table X
so i don't have to recalculate x-y.
There is something like that in SQL?

You cannot use a column user define in same level that definition.
You can use an in-line view :
select test1, (test1*4) as test2
from (select (x-y) as test1 from table X)HTH,
Nicolas.

Similar Messages

  • RSBBS - create a variable customer exit based on initial selection

    Dear all,
    I am using RSBBS (RRI) to jump from one query specific cell to another query. The destination query gets the parameters from the selected cell. In order to achieve this, the only thing we have done was to insert the relevant characteristics as Free Characteristics on the destination query (no variables were required).
    Now, I need to add a new variable on my destination query. This variable should be a customer exist based on one of the paramenters that the destination query gets from the original query. How do I get this value to use it in the variable customer exit???
    Thanks in advance

    Thanks for your reply,
    I got it in a different but not tottally different way from wthat you suggested.
    I have created a variable () (ready for imput) for my characteristic. However, on transaction RSBBS, when defining the target query, I went to "Assigment Details" option and for my characteristic, I have changed the type form "generically" to "variable" and choosed the field name of the variable ().
    In this way the target report gets the original report definition for this characteristic as a variable that I can then use on my costumer exit.
    I have tryed and worked...brilliant!

  • Creating two variable/selection screens in one BW Report

    Hello Experts,
    Can I create two variable screens in one BW Report?
    For EX:     
    Variable screen 1 (For Chars/KF)
    XXXX     :     -
    XXXXXX     :     -
    Variable Screen 2 (For Exceptions and Conditions)
    XXXXX     :     -
    XXXXX     :     -
    also How can I change the LOW & HIGH variable to parallel.
    I have percentage KF. when I want to display the variable (Between) values in parallel.
    EX: XXXX : -
        XXXX : -
        to
        XXXX:------     TO XXXX:----
    All inputs are much appreciated and the full reward points will be awarded.
    Thanks,
    London

    Hi Londener,
    1 You cannnot create variables for Keyfigures,
    Eventhough if you create N Number variables, All variables disaply at one shot.
    OR Let me know your exact requirement.
    Please assign points if it is helpfull.
    By
    CCC

  • Error while Creating Presentation variable

    Hi,I am new to OBIEE
    I am facing this error:
    "A numeric value was expected (received "max("Sales Measures".Dollars)").
    Error Details
    Error Codes: EHWH2A7E"
    1.I am using paint rpd.I want to use presentation variable.
    2.So i took two column in criteria 1.Region 2. Dollars
    3.In Dollars edit formula ,I created presentation variable i.e. @{Doller_presentation}{max("Sales Measures".Dollars)} in the column formula.
    4.And In the same column i use filter
    Add ->presentation variable->variable exp =Doller_presentation and default =max("Sales Measures".Dollars)
    5.I have added this request on dashboard page,but error is coming.
    6.Also i have created dashboard prompt,
    Set presentation variable to "Doller_presentation"
    and in column formula :@{Doller_presentation}{max("Sales Measures".Dollars)}
    and took that prompt on the same dashboard page.
    so promt with 2 values are coming.1.All choces 2.13087528..may be ths is max value of dollar but on click its showing error as
    "Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 42021] The query does not reference any tables. (HY000)
    SQL Issued: SELECT 13087529 FROM Paint ORDER BY 1"
    I am confuse abt use of presentation variable
    Please Help,
    Thanks
    Kapil
    [email protected]
    Edited by: user13098263 on May 9, 2010 10:58 PM
    Edited by: user13098263 on May 9, 2010 11:01 PM
    Edited by: user13098263 on May 9, 2010 11:02 PM
    Edited by: user13098263 on May 9, 2010 11:04 PM

    Hi Rachit
    You answered my doubt.This one really works . Thanks a lot !
    But i have one more doubt i.e if have created the Presentation variable in the dashboard prompt and I want to use it in a report
    i.e the scenario is If I have created a new column i.e " Revised Salary " in the Presentation Services and want the values to be entered there dynamically upon end users choice. For ex the end user selecrts value of 1 then the report would display an increament of 500 to all the employees in the " Revised Salary " column and if the end user select value of 2 .. the report would display a decrement of 500 in the " Revised salary column".
    I am getting the following error :
    ========================================================================
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)
    SQL Issued: SELECT "D0 Time"."T05 Per Name Year" saw_0, "D2 Market"."M04 Region" saw_1, "D4 Product"."P01 Product" saw_2, "D1 Customer"."C1 Cust Name" saw_3, "F1 Revenue"."1-01 Revenue (Sum All)" saw_4, CASE WHEN 0='1' then "F1 Revenue"."1-01 Revenue (Sum All)" +500 else "F1 Revenue"."1-01 Revenue (Sum All)" - 500 end saw_5 FROM "Sample Sales" ORDER BY saw_0, saw_1, saw_2, saw_3
    ========================================================================
    Please NOTE : The column on which I want to do an increament is : "F1 Revenue"."1-01 Revenue (Sum All)"
    Thanks

  • Error in creating Text Variable

    Hi  Gurus,
    I have one requirement to create a text variable for the user & the user wants to put the description as input to the variable.
    But when i am creating the variable,the variable type "characteristic Value"  is by default selected and i am also unable to change the variable type to text variable.
    Please any body have the solution to resolve the error.
    Regards
    Debasish

    Hi,
    Just select a particular key figure and on the right side you will see its properties..
    Now just besides the description of the key figure you will find a symbol for create variables, just click on that.. It will create a text variable...
    Edited by: mansi dandavate on Aug 31, 2009 11:12 AM

  • Getting error while creating the variable of Schema Element type

    Hi everybody,
    For creating a variable of schema element type I am doing the following steps...
    Select 'Variables' after right clicking on bpel process. IN this window, go to 'Create VAriable' then select 'Element' type. Now in Type Choose, I expanded the my imported schema files. And selected a element type, then click ok to create this variable... I am getting the message...
    IN ORDER TO SAVE IMPORTED WSDL/SCHEMA FILES, YOU MUST HAVE A PARTNER LINK LOCATED UNDER THE CURRENT PROJECT DIRECTORY.
    What is mean by that.
    I have imported the schema files in project. AFter that I have imported them into the WSDL also. Now why I am getting error while creating the variable. However I can create variable directly in .BPEL file then everything is fine. And it is working also. But what is mean with the above error? Why I am not able to create variable through GUI?
    Thanks.

    Hi,
    I have this same problem this morning, and I was going crazy, until I found this webpage on the internet:
    [http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process|http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process]
    The idea is that the jdeveloper is not very good working with directories with spaces on the directory name. If you move all your work to a directory without spaces, it will work smoothly. At least, it had worked for me.
    Regards,
    Nacho

  • Infoset BI - not showing created on - variable in a query

    Hi
    I created an infoset based on two cubes, in one of the cubes used in the infoset - the Billing cube I have my document dates-created on (0createdon) infoobject.
    When I try to create a query reporting of the infoset, I can see the infoobject but not all the variables in the created on. At least 4 variables are missing from the Created on object.
    Any thoughts?

    Hi Michelle,
    If you have created four variables and selected all four variables and you still can't it all, it could be because the criteria of your variables are similar and the system ignore some of them. have you check the messages from the BEx status area? it is on the bottom left hand corner of your BEx.
    cheers.

  • How to create dummy variable in Webi report in BO 4.0 with Bex query.

    Dear All,
    We have a requirement where we need to overlap multiple tables and based on user selection any one of the table should display in report.
    We are on BO 4.0 and source is BW Bex report, we dont have any Universe.
    To achieve this we plan to have dummy variable with some fix value and use it as report filter & based on selected value in filter the related table should be display.
    We have not found any way to have dummy variable directly in Webi.
    Is their any way we can create dummy variable directly in Webi?
    Thanks v much in advance,
    Regards,

    lets say u want to display following picture:
    sept$-----august$
    City
    -chicago123$--
    44$
    so in Query designer go to Default values section.
    Bring in Calendar month
    right click calendar month
    and hit Restrict
    now select variable
    use standard sap variable Current Month.
    hit okey
    now select Variable and hit Red button
    Result u restricted current month.
    in columns bring in keyfigure $
    right click and hit edit
    bring in time field calendar month
    right click and hit restrict
    bring in Current month
    right click and select - SET OFFSET FOR VARIABLE
    select -1
    hit okey
    repeat the above process
    and this time select offset = -2
    this way u restricted current month
    but displayed last 2 months for keyfigure values.

  • List View Report with pipelined function in Mobile application and ORA-01007: variable not in select list

    Hi!
    I have a problem with List View Report in mobile application (theme 50 in apex) after updating to apex 4.2.2. I created Report -> List View. I used select from pipelined function in Region Source. Then when page is running and submited three times (or refreshed three times) I get an error:
    Error during rendering of region "LIST VIEW".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 21230833903737364557
    component.name: LIST VIEW
    error_backtrace:
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    I get this error only when I use select from pipelined function in Region Source (for example: "select value1, value2 from table(some_pipelined_function(param1, param2)) ").
    You can check it on http://apex.oracle.com/pls/apex/f?p=50591 (login - demo, password - demo).
    In this application:
    - I created package TAB_TYPES_PKG:
    create or replace PACKAGE TAB_TYPES_PKG IS
    TYPE cur_rest_r IS RECORD (
        STR_NAME          VARCHAR2(128),
        INFO              VARCHAR2(128)
    TYPE cur_rest_t IS TABLE OF cur_rest_r;
    END TAB_TYPES_PKG;
    - I created pipelined function TEST_FUNC:
    create or replace
    FUNCTION TEST_FUNC
    RETURN TAB_TYPES_PKG.cur_rest_t  PIPELINED IS
    r_cur_rest TAB_TYPES_PKG.cur_rest_r;
    BEGIN
    r_cur_rest.STR_NAME := 'ROW 1';
    r_cur_rest.INFO := '10';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 2';
    r_cur_rest.INFO := '20';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 3';
    r_cur_rest.INFO := '30';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 4';
    r_cur_rest.INFO := '40';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 5';
    r_cur_rest.INFO := '50';
    PIPE ROW (r_cur_rest);
    RETURN;
    END TEST_FUNC;
    - I created List View Report on Page 1:
    Region Source:
    SELECT str_name,
           info
    FROM TABLE (TEST_FUNC)
    We can see error ORA-01007 after refresing (or submiting) Page 1 three times or more.
    How to fix it?

    Hi all
    I'm experiencing the same issue.  Predictably on every third refresh I receive:
    Error
    Error during rendering of region "Results".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 6910805644140264
    component.name: Results
    error_backtrace: ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613 ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    OK
    I am running Application Express 4.2.2.00.11 on GlassFish 4 using Apex Listener 2.0.3.221.10.13.
    Please note: this works perfectly using a classic report in my desktop application; however, no joy on the mobile side with a list view.  I will use a classic report in the interim.
    My region source is as follows:
    SELECT description AS "DESCRIPTION", reference AS "REFERENCE" FROM TABLE(AUTOCOMPLETE_LIST_VIEW_FNC('RESULTS'))
    The procedure:
      FUNCTION AUTOCOMPLETE_LIST_VIEW_FNC(
          p_collection_name IN VARCHAR2)
        RETURN list_row_table_type
      AS
        v_tab list_row_table_type := list_row_table_type();
      BEGIN
        DECLARE
          jsonarray json_list;
          jsonobj json;
          json_clob CLOB;
        BEGIN
          SELECT clob001
          INTO json_clob
          FROM apex_collections
          WHERE collection_name = p_collection_name;
          jsonobj              := json(json_clob);
          jsonarray            := json_ext.get_json_list(jsonobj, 'predictions');
          FOR i IN 1..jsonArray.count
          LOOP
            jsonobj := json(jsonArray.get(i));
            v_tab.extend;
            v_tab(v_tab.LAST) := list_row_type(json_ext.get_string(jsonobj, 'description'), json_ext.get_string(jsonobj, 'reference'));
          END LOOP;
          RETURN(v_tab);
        END;  
      END AUTOCOMPLETE_LIST_VIEW_FNC;
    Thanks!
    Tim

  • How to create a variable in BEx 7.0

    Hi,
    Can anyone please tell me how to create a variable in BEx 7.0
    In 3.5, when we right click on a characteristic, we used to get an option for restrict.
    I cant find any such option in 7.0

    Hi,
    Right click on the characteristic 0CALMONTH in the default values or drag it to char. restriction section and say restrict.Pull the drop down menu in that to select variables. There u will get a create icon.Click on that...then in details tab u can specify whether mandatory,interval and all..
    Regards,
    Rathy

  • Unable to create the Variable icon which shows Less than or equal to

    Hi Experts,
    when we create a variable normally will get a icon of the variable which say equal to symbol on the varaible icon. Hope everybody know that.
    Now how can we change that variable icon to less than or equal.
    Please can you provide me that information.
    Thanks alot !

    hi,
    when you are trying to restrict the char select range values instead of variable.
    then select the operator type (less than, greate than etc) and in place of value select variable and then give the variable name.
    regards,
    Arvind.
    Edited by: Arvind Tekra on Jun 15, 2011 4:57 PM

  • Got an error while creating bind variables using sql database.

    iam going to use sql database for ADF-BC .
    i created the bind variable and apply the bind position for the corresponding variable in the view object editor.when i click test it shows me "query is valid". when i tried to run that it gives me two errors.
    1) sql error during statement preparation.(ie) select empid ,empname......from the emptable where empid like :'emp' and
    2) [Microsoft][SQl server  2000 driver  for jDBC] invalid parameter bindings
    i need help to know the solution for this...(or) is there any other way to create bind variable ......

    The 3 binding styles supported by JDev:
    Oracle Named - ie. SELECT xxxx FROM xxxx WHERE emp_id = :vEmp (note colon and variable name)
    Oracle Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = :1 (note colon)
    JDBC Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = ?
    Literally this query is sent to the database to execute, then the bind variables values are applied as a separate database operation. If SQL Server doesn't suport any of these binding styles, it's not going to work. As Chris Noonan suggests, try the JDBC Positional style though as you're using a JDBC driver to connect to SQL Server and it should support that style (the others are Oracle styles), and make sure you've switched the binding style on the VO query page to "JDBC Positional" too.
    You must also on the VO bind variable page define your bind variables.
    Also read the 10.1.3 JDev guide on ADF Business Components and View Object bind variables.
    CM.

  • Creating text variable, urgent plz

    Hi friends,
               I would like to create a text variable on fiscalyear/period. the requirement is
    when user enters 001.2007   it has to display jan2007
                               002.2007   it has to display feb2007 so on.
       but when I am trying to create on fiscalyear/period it is not allowing me to create text variable. can any one suggest me please, it is an urgent requirement,
    I appreciate your help very much.....
    Ravi.

    Hi ravi
    we can do this with the text with replacement path and the var which u have created u to put display as text thats it...
    take a selection in the rows and create a variable in the text heading and give replacement fron the user entry default variable which the user enters.
    Assign points if it helps
    Khaja

  • How to use bind variable in this select statement

    Hi,
    I have created this procedure where table name and fieldname is variable as they vary, therefore i passed them as parameter. This procedure will trim leading (.) if first five char is '.THE''. The procedure performs the required task. I want to make select statement with bind variable is there any possibility to use a bind variable in this select statement.
    the procedure is given below:
    create or replace procedure test(tablename in varchar2, fieldname IN varchar2)
    authid current_user
    is
    type poicurtype is ref cursor;
    poi_cur poicurtype;
    sqlst varchar2(250);
    THEVALUE NUMBER;
    begin
         sqlst:='SELECT EMPNO FROM '||TABLENAME||' WHERE SUBSTR('||FIELDNAME||',1,5)=''.THE ''';
         DBMS_OUTPUT.PUT_LINE(SQLST);
    OPEN POI_CUR FOR SQLST ;
    LOOP
         FETCH POI_CUR INTO THEVALUE;
              EXIT WHEN POI_CUR%NOTFOUND;
              DBMS_OUTPUT.PUT_LINE(THEVALUE);
              SQLST:='UPDATE '||TABLENAME|| ' SET '||FIELDNAME||'=LTRIM('||FIELDNAME||',''.'')';
              SQLST:=SQLST|| ' WHERE EMPNO=:X';
              DBMS_OUTPUT.PUT_LINE(SQLST);
                   EXECUTE IMMEDIATE SQLST USING THEVALUE;
    END LOOP;
    COMMIT;
    END TEST;
    Best Regards,

    So you want to amend each row individually? Is there some reason you're trying to make this procedure run as slow as possible?
    create or replace procedure test (tablename in varchar2, fieldname in varchar2)
    authid current_user
    is
       sqlst      varchar2 (250);
       thevalue   number := 1234;
    begin
       sqlst := 'update ' || tablename || ' set ' || fieldname || '= ltrim(' || fieldname || ',''.'')  where substr(' || fieldname
          || ',1,5) = ''.THE ''';
       dbms_output.put_line (sqlst);
       execute immediate sqlst;
    end test;will update every row that satisfies the criteria in a single statement. If there are 10 rows that start with '.THE ' then it will update 10 rows.

  • Is it possible to create a variable in bex with the last work day?

    Hi Gurus
    Is it possible to create a variable in bex with the last work day?
    Actually end-user every day open queries,
        - Put in selection date day - 1 or
        - put last Friday if the day is Monday or
        - put last Thursday if the day is Monday and Friday is holiday (in a calendar for example 25 the December).
    Please do the needful. It is urgent
    Thanks in advance
    Raj

    Try this logic in a customer exit:
    DATA:  l_s_range TYPE rsr_s_rangesid.
    DATA:  X_PERIOD LIKE T009B-POPER,
               X_YEAR   LIKE T009B-BDATJ.
      CASE I_VNAM.
      WHEN 'ZPREVWORKDAY'.
        DATA: l_DayOfWeek(1) TYPE C,
              l_act_date     TYPE d,
              l_prev_date    TYPE d.
        l_act_date = sy-datum.
        CALL FUNCTION  'DATE_COMPUTE_DAY'
             EXPORTING DATE = l_act_date
             IMPORTING DAY  = l_DayOfWeek.
        CASE l_DayOfWeek.
          WHEN '1'.
            l_prev_date = l_act_date - 3.
          WHEN '2'.
            l_prev_date = l_act_date - 1.
          WHEN '3'.
            l_prev_date = l_act_date - 1.
          WHEN '4'.
            l_prev_date = l_act_date - 1.
          WHEN '5'.
            l_prev_date = l_act_date - 1.
          WHEN '6'.
            l_prev_date = l_act_date - 1.
          WHEN '7'.
            l_prev_date = l_act_date - 2.
        ENDCASE.
        l_s_range-low  = l_prev_date.
        APPEND l_s_range TO e_t_range.
    ENDCASE.
    Edited by: Tyler Blouse on Feb 13, 2008 8:28 PM

Maybe you are looking for

  • PROBLEM IN 122 DOC OF CAPITAL GOODS

    Dear All, I have done the G.R for Capital Good P.O. All PART 2 entries of 101 document is correct (Updating to RG23C g/l NOS only as per the Excise determination per transaction) But when I doing return delivery with ref to above document, all three

  • How to handle the dynamic rows in pdf table

    Dear All, earlier i posted one thread reagarding getting pdf table data [facing problem while getting interactive form table data; this is working fine, i sued bind_table in wddoinit, but here i am fixing the rows count and bind_table. for example i

  • Sync'ing Files Between Computers

    I've just invested in a MacBook Pro to go along with my iMac in my daily workflow. I have one folder where I save all my work files (graphic designer). What I'm trying to do is find a way where I can have a copy of this folder on each Mac, and it wil

  • SOLVED  Help! Why won't my CS6 apps open?

    NEVERMIND, DETAILS BELOW I had Photoshop open, and it was fine. I tried to open InDesign, and got just Welcome to Adobe Creative Cloud......  But I have CS6, I read the license and it is supposed to keep working even after any deadline for upgrading

  • Toplink issues select distinct type query before fetch

    When we have type classifiers identified by value, Toplink issues a 'SELECT DISTINCT TYPE' on the parent object and then queries the child records for that type, is there way to avoid the select distinct type query from Toplink in queries, this is sl