Can we use formula column in lexical parameter in sql query ...

hi
can we use formula column in lexical parameter in sql query ...
as example
i want to give
select * from & c_table
forumula
function c_table
if :p_sort = 1 then
return 'dept'
else
return 'emp'
end;
c_table formula column
is this possible ...
i have such example in oracle apps reports
if i try in ordinary report usinf emp table it show error ..
how we can give formula column...
please help me in this regard...
Edited by: 797525 on Feb 20, 2012 9:31 PM

thanks sir,
iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
&c_source_from and &c_from_cat formula column and there are defined at report level only ......
pl/sql code &c_source_from is
function C_source_fromFormula return VARCHAR2 is
begin
if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
else if :P_source_type_id = 5 then
     if :C_source_where is null then
          return NULL;
     else
          return(',WIP_ENTITIES wip');
     end if;
else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id is null then
return(',MTL_SALES_ORDERS      mkts,
MTL_GENERIC_DISPOSITIONS mdsp,
GL_CODE_COMBINATIONS gl ');
else null;
end if; end if; end if; end if; end if; end if;
RETURN NULL; end;
this is forumula column i hope that you understand what iam saying
please help me in this regard....
thanking you...

Similar Messages

  • Generation of XML Tags for columns in Lexical parameter in select query

    Hi,
    I have lexical parameter in my select statement of my data model in the report.
    How do i generate XML tags for these columns inside a Lexical Parameter?
    Simple Example: I have data model query as follows:
    SELECT msi.inventory_item_id
    &LP_SELECT
    FROM mtl_system_items_b
    Here my lexical Parameter LP_SELECT is generated in before report trigger as follows in my report:
    :LP_SELECT := 'msi.segment1,msi.description';
    So, the question is how to generate XML Tags for columns in Lexical Parameter(as in the example above, i need XML tags for these columns - segment1 and description)
    Thanks,
    Ratan

    try this
    Select &order data_show
    from oe_order_headers_all
    where order_number ='7889'
    and setting  :order:='order_number';  in after parameter form trigger.
    Hope this helps
    Hamid

  • Linking using formula column

    I've tried several ways of doing this, and this seems to be the easiest way. Basically, depending on the type of record, I need to use one of two columns to link to another query. So, if a row in query A has type 1, I need to use column X to link to query B. If a row in query A has type 2, I need to use column Y to link to query B.
    I thought the easiest way to do this would be to create a formula column in Query A that was the value of column X or Y as appropriate and then link to Query B using this formula field. However, I can't seem to link queries using a formula.
    Does anyone have any ideas how I can accomplish this? I'm new with Oracle reports, so go easy on me :)
    Thanks,
    Julie.

    What error are you getting?
    Is it: REP-1297: Data link child column 'CF_1' must be a database column?
    If so, the reason is the child column cannot be a formula column. The parent column, on the other hand, can be a formula column.
    If I understand your data model correctly, "A" is your parent query/group and "CF_1" is the formula column in query/group "A".
    "B" is your child query. "FK_1" (the foreign key column in query "B") is your child column.
    You should be able to link "CF_1" in "A" to "FK_1" in "B" by doing:
    - click on the link tool
    - click on "CF_1" in "A"
    - drag to "FK_1" in "B"
    - A link should be created. Double click on it to bring up the property palette for that link and you'd see the link properties.
    Hope that helps...

  • Can we use WHO columns in Business Logic implementation

    Hi,
    Can we use WHO columns for business logic implementation..?
    From one table I need to pick up the latest record. I have a ActionDate column in the table which stores the date of the action.
    But on the same day there can be multiple action records. ie Multiple records have same ActionDate.
    Select * from action_table where action_date=(maximum action_date)
    The above query will return more than 1 record.
    Now can I use the Creation_Date which is a WHO column to identify the latest record..?
    Will it introduce any issues if I use creation_date WHO column?
    Usage of WHO column in application logic, Is it against the Standards ?
    Thanks a lot.

    I guess you are talking about populating the value using the history column creation_dt from EO.
    If so, you can use then. We are using them in all our applications to populate WHO columns of our table.
    Infact as far as I know, even Oracle application uses them.
    They generally populate the timestamp, so you may need to format them when doing date comparisons.
    Hope that helps.
    Amit

  • Can we use OUT or IN OUT parameter mode in function?

    Can we use OUT or IN OUT parameter mode in function & if YES then what's limitations?

    hi,
    Yes we can have OUT and IN OUT parameters for a function.
    As per my knowledge there are no limitations , but as per the convention we will use OUT ,IN OUT Parameter modes for only procedures .
    Thanks,
    P Prakash

  • Can I use Other database as the repository, Sybase/SQL Server? Urgent!!!

    Hi all,
    Can I use Other database as the repository, Sybase/SQL Server? Urgent!!!
    And Can I use other database store business data and sync with lite?
    Thanks ahead!!!

    Jonathan,
    No, it is not possible to use any other database than Oracle (8.1.7) or later .
    Oracle Lite will only work with Oracle.
    Regards

  • Can we use SSRS in sharepoint 2013 standard and sql server standard edition

    can we use SSRS in sharepoint 2013 standard and sql server standard edition
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    Yes you can. You do lose some features:
    http://msdn.microsoft.com/en-us/library/cc645993.aspx#Reporting
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to add a parameter to sql query in report

    Hi
    How to add a parameter to sql query in report.
    Parameter is from Visual studio
    example:
    select * from tab1 where dl=parameter???
    I have VS 2008 prof CR XI R2, mysql

    Hello,
    If you have this API available then you can modify the record selection formulae in code to add filtering:
              string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
                CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
    You have to format and follow the rules as in the Designer so not too much work to get this to work.
    CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
    Thank you
    Don

  • Howto use formula columns in matrix reports

    Hello
    How can i use a formula column in matrix report whose function would be
    Formula_Column_Result=A-B where A=Cell A
    B =Cell B
    Regards
    Fahad

    Hii guys
    I solved my problem on my own.
    i wrote
    SELECT * FROM EMP WHERE EMP.DEPTNO=P_DEPT_NO
    and it worked.
    Thanks guys..i luv this forum
    Regards
    Fahad Hameed

  • Can be passed Formula Column value to Procedure/Function?

    Below cf_value is return after some calculation by using main query.
    Can be directly passed formula column value to procedure without assinged to placeorder?
    as below..
    f_convert(:cf_value,new_value);
    My Procedure is...
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    END;
    If anyone knows pls reply me....

    Actually, if there is any other calculations there (In Proceudre)
    Can I used is as below??
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    return (val2);
    END;
    ----A procedure cannot return a value, the return clause in my previous post was part of the function for formula column.
    Suppose you have a formula column say CF_2 then the function for it will be as:
    function cf_2formula return number
    is
    val1 number;
    val2 number;
    begin
    val2 := :cf_1 * 100; -- or val2 := val1 * 100 --parameters not allowed in formula column function
    -- All the other code that you need inclusive of calling function, procedure as in any PL/SQL block can be placed
    return (val2);
    end;So any other calculation can be used in the formula column function

  • How to make an order on repeating frame using Formula Column?

    Hi All,
    I have a repeating frame dependent on some query, how to make an order on this repeating frame using a formula column defined in its group and dependet on values from the query?
    Note: I'm using Reports 6i

    Place your formula column at the top of the itm group and set the BREAK_ORDER to assc.. or desc...
    Hope this helps
    Hamid
    if problem solved, close the thread.

  • How to use formula column,placeholder column in data template option

    Hi All,
    Can you some idea on these concept with example.
    Thanks in adv

    >
    formula column,placeholder column
    >
    it's oracle reports terms?
    http://oraclebizint.wordpress.com/2007/08/22/oracle-reports-to-bi-publisher-conversion-utility/
    http://eoracleapps.blogspot.ru/2009/04/how-to-convert-oracle-reports-in-bi.html
    so convert your oracle reports to bi publisher and you'll see mapping for your case

  • If CASE Statement can be used just nest to 'WHERE' keyword in sql?

    HI All,
    There are 2 tables,
     dbo.headcount_smart_view & dbo.headcount_user_view,they
    are not joined i.e. there is no join between these 2 tables.
     User is trying to create the access restriction on table
    dbo.headcount_smart_view as below,
    The following case clause is just next to 'WHERE' keyword :
    CASE select distinct dbo.headcount_user_view.role_cd from
    dbo.headcount_user_view where UPPER(dbo.headcount_user_view.cmt_id) = UPPER(@Variable('BOUSER'))
    WHEN 8 THEN dbo.headcount_smart_view.l3_id In (select distinct
    dbo.headcount_user_view.divid from dbo.headcount_user_view
    where UPPER(dbo.headcount_user_view.cmt_id)=UPPER(@Variable('BOUSER')))
    WHEN 9 THEN dbo.headcount_smart_view.l4_id In (select distinct
    dbo.headcount_user_view.divid from dbo.headcount_user_view
    where UPPER(dbo.headcount_user_view.cmt_id)=UPPER(@Variable('BOUSER')))
    ELSE
    dbo.headcount_smart_view.l2_id In (select distinct
    dbo.headcount_user_view.divid from dbo.headcount_user_view
    where UPPER(dbo.headcount_user_view.cmt_id)=UPPER(@Variable('BOUSER')))
    END
    The user is getting 'syntax error', it seems that the value is not getting compared with any column hence getting the error.
    can case statment  be used just next to 'WHERE' keyword in sql? 

    I don't have the entire table query...
    but could u tell me wil the sql given below work ....
    if not, why? and what can be done to make it work ?
    SELECT * FROM Customers 
    where case select  CustomerID from customers 
    when 8 then 'Spock'
    when 9 then 'Yedi'
    else 'Jedi'
    end;
    Nope
    because of wrong syntax
    What the purpose of the case when statement here? I'm not seeing a condition in WHERE. You should use it in a condition like below
    SELECT * FROM Customers
    where case CustomerID
    when 8 then 'Spock'
    when 9 then 'Yedi'
    else 'Jedi'
    end = @SomeParameter
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can I use attunity CDC to propagate changes from sql server to a sybase database

    can i use attunity cdc components in sql server to propagate changes to a sybase destination. I did some experimenting with cdc in ssis 2012 and got it working to send changes to sybase, but I need to do this for approx 5000 tables. so looking for a product
    that can do this for me.
    ny help welcome
    thanks
    Geert Vanhove DCOD ------ http://geertvanhove.wordpress.com/ ----------- Please click the Mark as Answer or Vote As Helpful if a post solves your problem or is helpful!

    Hello,
    It seems that you try to with captures SQL Server data changes and move to Sybase database with Attunity CDC. Since it is a thrid party tool, I suggestion that you post the question in the
    Attunity site for support.
    Reference:Attunity CDC
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Can I use like a message box with PL/SQL?

    Hi!
    Well I was making some tests on my forms then i realized that when i erased something it was just like that, no anouncement or something like that and it was gone, so i think users of this might make mistakes, iike erasing somedata very easy, so I want to do something to send a confirmation message in case that the user intents to erase something, something like a messagebox ....
    so I want to use PL/SQL code to do this and i believe that the code should go in the +... before processing the form. + section for my form...
    can you help me? 'cause I don't know how to do it?
    thanks in advance.
    aTTe
    Blume

    You may use the javascript code embedded into pl/sql to prompt users. This means you can put this in all of those places where you may include your html code. for example, in the submit button's html specs.
    You may keep the following code in the additional pl/sql code region and then call such a function (eg, alertCancel() ) in the submit button of your form. Here is a working example.
        htp.p('
              <SCRIPT LANGUAGE="Javascript">
              function alertCancel()
                     if (confirm("Do you really want to cancel this request?") {
                          window.close();
           </script>
        ');Just do a google search for how to call a javascript function from html, if you need.
    hope that helps!
    AMN

Maybe you are looking for

  • Can I instal Reader to a drive other than C:?

    Is someone able to tell me how to instal Reader to a drive other than C:? I am trying to free up space on C: and prefer to load the Reader files into another drive, but I did not see an option to do that when downloading, and the installer just start

  • HDTV as second monitor?

    Will OS X use an HDTV as a second monitor? I'm thinking of running Mini-DVI from MacBook to a DVI<->HDMI cable, and from there into the HDMI port of the TV. Any reason this wouldn't work?

  • Can I extend an O2 router network AND stream to an Airport Express?

    I'd like to put an AE upstairs so I can use AirPlay from my Mac to both the downstairs AppleTV and the upstairs Airport Express at the same time. Also, I'd like the Airport Express to act as a Wi-Fi Network extender for the O2 router that's downstair

  • Droid Incredible 2 won't turn on or charge.

      I have had this problem before, right after I got the DINC2. Yesterday, I wanted to take out my memory card to save pictures on my computer via a usb card reader. I turned my phone off by pressing the power button and selecting power off. I removed

  • Keynote 09 Theme Chooser

    Hi! This just happened after I installed the current update of iWork 09 two days ago. Seems that I cannot select theme "Gradient" (which is my favorite and often used). The first slide came up plain with a big "X" across the entire slide. There was a