Reg: Including an expression in query

Hi All,
i have a table with two fields like id and expr.
id is unique.
And expr contains expressions like
FirstName||' '||MiddleName||' '||LastName etc ..
My requirement is i have to write a query to fetch employee information from employee table along with full name by embedding/executing the above expression.
I can write like this
Select Employee.*,FirstName||' '||MiddleName||' '||LastName as "Full Name" from Employee.
But here i know the id value only not the expression itself.
Select Employee.*,(select Expr from expr_table where id=<id_value>) AS "First Name" from Employee
It is giving the expression itself instead of executing the expression. It is considering it as a string i think.
Please suggest me anyone in this regards.
Thanks in advance,
Anil Kumar Ch.

Hi, I dont know how to do it SQL, but you can do it in PL/SQL using EXECUTE IMMEDIATE statement .
BEGIN
select Expr INTO v_expr from expr_table where id=<id_value>;
EXECUTE IMMEDIATE 'SELECT ' || v_expr || ' FROM EMPLOYEE' INTO v_full_name ;
dbms_output.put_line(v_full_name);
END;

Similar Messages

  • New Airport Extreme & Airport Express Setup Query

    Hi,
    About three weeks ago, I purchased my first Wi-Fi router so that I could use my iMac anywhere in the house, but also use my iPhone3G. This was because we do not get Edge coverage where I live in the UK, let alone 3G! And it is very handy to use the iphone when in the garden or my cellar/workshop.
    So I thought I would simplify things and 'keep it in the family' so to speak, as I figured Apple products should work best with each other.
    With this in mind i purchased an +Apple Extreme Base Station 802.11n+. This was very easy to setup and having set the WPA2 Personal Security, it was up and running in about 15 minutes and has worked just great.
    I live in a large bungalow and find that the wi-fi coverage is great in moist areas, including the gardens, but rather weak at one side of the house where we have our home cinema setup and music systems.
    With my pleasant experience with the Extreme in mind, and reading about Airtunes, I bought an +Airport Express 802.11n+ unit a couple of days ago.
    I set it up to join my current Airport Extreme network, and setup my speakers etc as well as iTunes.
    On the whole, the Airtunes aspect is brilliant, apart from the odd drop out from time to time, but my real concern is that my network strength has not improved at all in that area where the Airport Express is is plugged in. It is just as weak as it was when only the Extreme unit was installed.
    I was under the impression that when it joined my Extreme network, the Express unit would extend the network. and it does not appear to have done so at all. On my iPhone3G it shows up as the _very lowest_ signal strength. On my partners Windows laptop, the signal strength is shown as 'poor'.
    Am I doing something wrong, or misunderstanding how the Airport Express works with the Extreme unit?
    All help most welcome.

    Thanks James, I have now an Extended network, and my signal strength is excellent. Once I knew what I was aiming for, it was easy enough.
    Thanks

  • How to include 0STOCK_VAL in a Query based on APO DataSource?

    Hi All,
    I have a requirement to include *0STOCK_VAL" from Inventory to the APO InfoCube. But the problem with this is, this particular KeyFigure is not present in the APO hence it cannot be included in the APO DataSource i.e. we cannot get this from the Source System.
    I checked the Production system, 0STOCK_VAL InfoObject is avaiable in one of the InfoCube but it is not present in any DSO's. Since it is not present in any of the DSO's we cannot write a Routine to read it from any of the table.
    I even thought of including the InfoCube where 0STOCK_VAL is present into a MultiProvider along with the APO InfoCube. I can define the joining condition based on Plant and Material. But if I drill down any other characteristics which are not common in both the  InfoCube then we will have a blank line in the Query which is not recommended.
    But this KeyFigure is very much needed in the Query.
    My question is how to include this in the APO InfoCube or How to get this in the Query with values??
    Can anybody please help me on this.
    Thanks in advance.
    Prasapbi

    hi Matt,
      In your example like a transaction was paid for with a payment type of PTAM, then you need all the transaction details. I suppose that all the required transaction details along with payment type PTAM will be loaded into an infoprovider and you run a report on top of this infoprovider. Then for that report you need to have a selection screen variable for Payment Type and if the user enters the payment type PTAM, then he can get all the other transaction details from the infoprovider.
    Let me know if i don't understand the requirement correctly.
    Hope it helps....

  • Include text row in query

    Hi,
    I created a query and am trying to include the text row from the invoice rows. There's a field called LineType but it seems to be only pick up "R" valud rows. S & T don't get picked up.
    Is there a way to get the text rows from a marketing document in a query?
    Thank you,
    Heather

    Hi Heather,
    Have you linked INV10/PCH10 correctly?
    Thanks,
    Gordon

  • Need to include Structures in SAP Query

    Hi,
    I need to extract data of material master from a 3.1 System, where there is a Structure which contains my required information.
    How can i include the fields of the Strucutre into my query?
    thanks,
    Chintan

    Hi,
    As Christopher mentioned, structures do not contain saved information. You must read the tables for getting the information.
    I assume that you´re working with SAP Query (SQ00). If this is so, you need to create or modify an InfoSet (Environment --> Infosets), where you´re gonna declare the necessary table or view.
    When that part is done, go back to your query and assign the infoset, so that you can use the fields that you need.

  • Using constant expression in query

    When I write a query, if I use a bind variable that could be null as for example:
    select *
    from table
    where :variable is null or column = :variable
    the performance drops significantly.
    I can't find any reason, so if you can help me...
    I also tried something simpler, and something I thought it shoud be faster.
    select *
    from table
    where 1=1 or column = :variable
    this query should return all the table, since 1=1 is allways true. It should be easier to evaluate, since it's the same as before, but it does not need to bind the variable. It takes five times longer than before.
    What I am looking for is to understand what the database does when I run this queries.
    Thankyou very much
    Edited by: user4823534 on 27-abr-2010 9:16

    I think I didn't explain myself.
    I have several very complex querys that use bind variables as optional parameters.
    What I noticed is that it's much slower (100 times maybe) to have a constant expression which is true in an or than evaluating something else. For example
    select * from table where :a is null or column1 in (select column1 from table2 where a = :a) should be faster than
    select * from table where column1 in (select column1 from table2 where a = :a) since the last one has to evaluate the in clause, and the first one is allways true.
    Thankyou for your patience and sorry for my bad english.

  • Behavior of BEx Query Attributes for webi on OLAP universe: Including 1 attr to Query!

    My webi report is based on an OLAP universe (.unv) which is based on a BEx Query.   I need an attribute field from an info object.  But when I include that attribute in my BEx query in free characteristics pane……   Every single attribute in that info object comes over to the universe.
    Is this the expected behavior?
    How can I ensure only the attribute wanted comes over and not all the attributes of the info-object.
    I am using BO 4.0SP4.

    Attribute level restriction of an InfoObject is not possible in BEX Query and the same reflects in the Universe.
    You can use attributes of an infoObject which you wanted on WEBI Report Level.
    ---Raji. S

  • Including 0fiscvarnt in the query

    Hi,
    There is no FISCAL YEAR VARIANT in the left panel of the query designer, but still I can see 0fiscvarnt in the filter area of a query, I am creating another query on the same infocube and I am not able to include 0fiscvarnt in the filter area even If I drag and drop 0fiscper..plz help me
    Thanks

    hi
    0fiscvarnt is compounding 0fiscper. So when you drag n drop 0fiscper by default 0fiscvarnt will also come.
    You can drag back 0fiscvarnt if you do not want it.

  • Math expression in query

    Running Oracle 10g on Solaris 10 SPARC
    I have this expression within a query that I would like to round off to the nearest hundreths:
    select (x.VALUE/4800.00)*100 as Percentage,
    Value is equal to: 4145.22 I want the display to be:86.35 not 86.35875 (or 86.36 if we can round up/down versus truncation)
    Thanks

    ME_XE?select round(86.35875, 2) from dual;
    ROUND(86.35875,2)
                 86.36
    1 row selected.
    Elapsed: 00:00:00.81
    ME_XE?
    ME_XE?select round(86.35375, 2) from dual;
    ROUND(86.35375,2)
                 86.35
    1 row selected.
    Elapsed: 00:00:00.31

  • Need help on Regular expression and query

    Hi Guru's, Hope you all are doing great!.
    I have a scenario's where i need do insert the data into table.
    I have three scenarios :
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    Alex Romano
    Kodali,Raj,S
    pppppNow what i want is .
    1. Alex Romano
    if there is space between the string then i want to insert into first name and last name columns
    2. Kodali,Raj,S
    if its a comma between the string then i want to insert into last name , first name and middle name
    3. if there is only one string then same insert into first name and last name.
    I wrote the query earlier to handle only comma and now i am trying but not able to use this all scenarios
    Can you please help me out.
    WITH t AS (
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c))
    from
      SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
              , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
              , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME      
       FROM   t
      CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
      GROUP BY str
    ) ;Currently i am putting a b and c if its null.
    Thanks in advance!

    user590978 wrote:
    Hi Guru's, Hope you all are doing great!.
    I have a scenario's where i need do insert the data into table.
    I have three scenarios :
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    Alex Romano
    Kodali,Raj,S
    pppppNow what i want is .
    1. Alex Romano
    if there is space between the string then i want to insert into first name and last name columns
    2. Kodali,Raj,S
    if its a comma between the string then i want to insert into last name , first name and middle name
    3. if there is only one string then same insert into first name and last name.
    I wrote the query earlier to handle only comma and now i am trying but not able to use this all scenarios
    Can you please help me out.
    WITH t AS (
    select 'Kodali,Raj,S' str from dual
    union
    select 'Alex Romano' from dual
    union
    select 'ppppp' from dual
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c))
    from
    SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
    , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
    , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME      
    FROM   t
    CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
    GROUP BY str
    ) ;Currently i am putting a b and c if its null.
    Thanks in advance!It's never a popular suggestion, but why not fix the design to begin with?
    It's the year 2013, can a client not pass you a "complex" data structure consisting of first, middle and last name?
    Why rely on an unreliable construct when there are so many more usable way to achieve this?
    Cheers,

  • Reg:Creation of chart during query runtime

    Dear all,
    I want to display a Pie-Chart during my query execution
    dynamically. I am working only in query designer not in WAD.
    For example :  I have created a query in query designer based on Zonewise Sales Value. And i have designed the chart also based on these values. But i am facing the problem when i am executing the query i couldnt able to see the Pie-Chart desinged by me.
    Is it possible to save the Pie-Chart as saved view in my query  designer?
    Kindly do the needful. Helpful answers will be rewarded.
    Thanks,
    Harikrishna N

    hai expert's,
    is there any option to save and execute the chart during  query execution. i am asking in query designer?.....
    please through a ligh on it........
    Regards
    Harikrishna N

  • How to include conditions in select query

    i want to write a select query wherein plants have to to be fetched from table vekp
    and if it is a plant then the  set movement type to 999 else leave for exiting.please help me on this

    >
    deep shikha wrote:
    > (This is module pool programming)
    what is modulepool programming doing in form printing forum.
    Please use appropriate forum next time.
    кu03B1ятu03B9к

  • Reg: JDBC Adapter without Update Query

    hi friends
    i have designed a scenario where JDBC as a sender. i need to configure the adapter without using update query

    Hi,
    I believe the date field will store along with the time filed in the same column. At least oracle does that.
    So in your select query you can write as below(from oracle, as i dont have a ms sql now)
    assume
    your table name = yourtable
    date column      = dtcolumn
    select * from yourtable where dtcolumn = sysdate - interval '1' minute;
    This query assumes that the dtcolumn will be always having the value of the date time stamp when data is inserted.
    To be frank you should not do this. I dont understand why you cannot add a column "processed" and add update that. Any specific business requirement?
    For best performance, typically in my implementation I suggest using a shadow table from which XI deletes the records. The actual table has the column saying if this got inserted to the shadow table.
    Regards
    Unni

  • Including an Expression in SQL Code with Columns from a Table

    The code under MY CODE will not work. Getting error saying 00922-from keyword not found where expected..
    In the examples I looked up, the months_between function was written as a select statement like:
    Select
    months_between (sysdate,me607.mbr_dob) / 12 as date
    from mbr_exp me607
    Can anyone help me with the syntax I need to include this with my SQL code as below?
    Thanks..
    MY CODE:
    Select
    me607.mbr_dob,
    months_between (sysdate,me607.mbr_dob) / 12 as date
    from mbr_exp me607

    -date- is an oracle keyword and cannot be used as a column name
    SQL> select sysdate as date from dual
    select sysdate as date from dual
    Error at line 1
    ORA-00923: FROM keyword not found where expectedeither do
    select sysdate as "date" from dualor use a diffent colum name.

  • Reg:Radio button in ABAP Query

    Hi ABAPers ,
    I created radiobuttons in SQ02 there i have to write the coding for it ... what type of coding we have to write
    ALV coding wll work out or what type of coding we have to write can you guys plz suggest me
    Help me out from this problem i am not familiar with ABAP Query
    Regards,
    Y Ravichandra.

    Hi Ravichandra,
       You have to use at selection-screen output event for this purpose here is a sample code try it and you will get the logic.
    PARAMETERS :
       p_flight RADIOBUTTON GROUP r1 ,
       p_book RADIOBUTTON GROUP r1 .
    PARAMETERS :
      w_temp1 RADIOBUTTON GROUP r2 MODIF ID sc1 ,
      w_temp2 RADIOBUTTON GROUP r2 MODIF ID sc1 .
    SELECT-OPTIONS s_carrid FOR sflight-carrid MODIF ID sc1 .
                                           " Airline Code
    PARAMETERS :
    w_temp01 RADIOBUTTON GROUP r3 MODIF ID sc2 ,
    w_temp02 RADIOBUTTON GROUP r3 MODIF ID sc2 .
    SELECT-OPTIONS s_bookid FOR sbook-bookid MODIF ID sc2 .
                                           " Airline Code
    *                       AT SELECTION-SCREEN OUTPUT                    *
    AT SELECTION-SCREEN OUTPUT .
      IF p_flight = 'X'  .
        fl_flag = 1 .
        LOOP AT SCREEN.
          IF screen-group1 = 'SC2'.
            screen-active = 0 .
            MODIFY SCREEN .
          ENDIF.                           " IF SCREEN-GROUP1 = 'SC2'
        ENDLOOP.                           " LOOP AT SCREEN
      ELSEIF p_book = 'X' .
        fl_flag = 2 .
        LOOP AT SCREEN.
          IF screen-group1 = 'SC1'.
            screen-active = 0 .
            MODIFY SCREEN .
          ENDIF.                           " IF SCREEN-GROUP1 = 'SC1'
        ENDLOOP.                           " LOOP AT SCREEN
      ENDIF .                                " IF P_FLIGHT = 'X' .
    Here in this case, There are 2 radio buttons and 2 select options. On clicking the first radio button one of the select option is hidden. If you you just have a single radio button then you can avoid using at selection-screen output and just write your code start-of-selection.
    Much Regards,
    Amuktha

Maybe you are looking for

  • App won't update...Software updates says "

    I have been trying to update my 1Password through Software Updates but I keep getting this window thatr says, "This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled." And

  • Web Help - HTML Pages

    Dear All, I have created a web help project. The project is working fine. But I have been trying to do some R&D. In the project's WebHelp folder (with in SSL folder) we have all the HTML files. The main HTML page when opened from there opens up with

  • White screen and black

    Now, I have a problem of the week, I do still formats it helps for a couple of hours sometimes less. This is a problem .. When you come to a site I get it at the link and sometimes normally turns on what might be wrong?; /

  • Cross Instance Authentication Issues

    I have the portal meta-data installed and running on an instance called DMD1 and all of our users are on a different instance called DCD1. Prior to this setup our metadata and client data was on the same instance and I would run a PSP with the ...pls

  • Importing MPEG 4 Movie into Keynote 2

    After spending 5 days trying to import MPEG 4 video from a Canon Optura 500 videocam, I have learned: Can't be done. Calling Apple help today, confirmed no possible solution to get the movies into Keynote. I tried everything and read all help informa