Oracle Views with input

Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
Hi Experts,
Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
as
SELECT Col1,Col2
FROM table_name1
where any_column11 in (
&P_inputparam
UNION
SELECT Col1,Col2
FROM table_name2
where any_column22 in (
&P_inputparam
          Thanks In advance.
Edited by: 883279 on May 10, 2013 1:41 AM

883279 wrote:
Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
Hi Experts,
Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
as
SELECT Col1,Col2
FROM table_name1
where any_column11 in (
&P_inputparam
UNION
SELECT Col1,Col2
FROM table_name2
where any_column22 in (
&P_inputparam
          Thanks In advance.
Not like that... no.
What you're using as "input" there are SQL*Plus substitution variables. Those values are requested by SQL*Plus before the code is sent to the database and compiled. Code that runs on the database has no way of interacting with a client keyboard or screen, so you cannot get stored code to prompt for user input.
See: {message:id=10744582}
It's possible to use SYS_CONTEXT to get a view to pick up a value that has been previously assigned before the view is used, though I rarely find a need to do this myself.

Similar Messages

  • Error when using Analytic view with Input Parameters

    Hi,
    I am trying to create an info space based on my Analytic view which has input parameters. The infospace is validated and indexed without any issue. However when I ran the view, I get an error (50011) as it is unable to fetch any results. I tried using an infospace based on Calculation view with input parameters and the explorer view works without any issue.
    Has anyone faced similar issues?
    We are using HANA SP 6 rev 67 and BI 4.0 SP 4.
    Also is there a way to enable input prompts for the users when they refresh the BO Explorer view? If not currently available is there any work around ?
    Thanks

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Questions on CDS Views with input parameters

    Dear Experts,
    1. Can we call a CDS View (or generated database view) with input parameters inside an AMDP? I am looking for something similar to the feature in HANA where we can consume calculation view with filters inside SQL Script?
    2. I understand we can next CDS Views, but how we can next (call) a CDS View with input parameters inside another CDS View?
    Thanks,
    Giri

    Hi Thomas,
    I get the below error that the CDS View's generated table function cannot take field from AMDP.
    I have a requirement to query the CDS View using 2 timestamps (start & end). So, in AMDP I have used the TIME_STAMP and try to pass it to the CDS View
    View code:
    define view Z_Ngi_Cag_A
    with parameters start_ts:abap.dec( 15, 0 ) , end_ts:abap.dec( 15, 0 )
    as select from table {
    resource_key
    where
    (begtstmp > $parameters.start_ts or endtstmp > $parameters.start_ts )
    and
    (begtstmp < $parameters.end_ts or endtstmp < $parameters.end_ts )
    I am calling using the below AMDP:
    DECLARE iv_start_date TIMESTAMP;
    DECLARE iv_end_date TIMESTAMP;
    SELECT CURRENT_TIMESTAMP INTO iv_start_date from dummy;
    SELECT ADD_DAYS(CURRENT_TIMESTAMP, 30) INTO iv_end_date from dummy;
    et_data =      SELECT * FROM ZMR_H_CA ( start_ts => iv_start_date, end_ts =>  iv_end_date );
    What could be wrong ? Is this not supported?
    Thanks,
    Giri

  • Call a Graphical Calc view with input Parameters from a Script Based Calc View

    Hi All.
    I am trying to call a graphical calculation view with input parameters from a script based calculation view as below but getting syntax error:
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                 WITH PARAMETERS  ('PLACEHOLDER' = ('$$IP_START_DATE$$',:START_DATE),
                                     'PLACEHOLDER' = ('$$IP_END_DATE$$',:END_DATE));
    START_DATE  and END_DATE are input parameters of the script based calculation view.
    Can anyone please help me with the correct syntax for accomplishing this?
    Thanks,
    Goutham

    Hi Gautham,
    One more option  what i would like you to try is the below option , here i have just changed the order of passing nothing else.
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                   ('PLACEHOLDER' = ('$$IP_END_DATE$$','$$END_DATE$$'),
                                  'PLACEHOLDER' = ('$$IP_START_DATE$$','$$START_DATE$$'))
    Regards,
    Vinoth

  • Calculated view with input parameters

    Hello there.
    I've created a calculated view with input parameters, which I am going to call  it  'VIEW_A'.
    This view has been working just fine.
    But now I have to create another calculated view and import the last one(VIEW_A) in a projection.
    But I got a error when trying to see the data content. 
    It says :
    Error: SAP DBTech JDBC: [2048]: column store error: search table error:  [6968] Evaluator: syntax error in expression string;expected TK_ID,parsing '"DT_DOC_MES_ANO" >= [here]and "DT_DOC_MES_ANO" <='
    At the 'Problems' panel it says the all the input parameters are unmapped.
    What Am I doing wrong?  Sorry but I am kind new at SAP world.

    http://scn.sap.com/message/15489475Hello Tiago,
    Could you please let me know if you're able to resolve your issue, I'm getting the similar error when I'm passing alpha numeric values as parameter via my SP.
    Thanks for your help in advance!
    Regards,
    Sathish

  • Replicate an oracle view with SLT

    Hi -
    Using Oracle 11g and SLT 2011_1_731 Patch 7 with Hana rev 82
    I am trying to replicate oracle views in hana through SLT
    Scenario 1:
    tables T2 and T3 with View T2_T3_view
    If I follow this thread  SLT view replication
    It creates the view as a table in hana  but does not populate it with any data.
    Scenario 2 -
    I have 2 oracle tables - T4 and T5.  I have a view T4_T5_VIEW that joins the 2 tables.
    I followed steps in a document I received to replicate the view syntax as well as the tables.
    1) replicated both tables T4 and T5 - success
    2) stopped replication on T4
        table exists in hana with data but no replication
    3) using LTRS, assigned the view T4_T5_VIEW to table T4
    4) changed the performance option
    5) restarted replication on T4
    The view gets created as a table, but table T4 gets and error and does not replicate.
    The view gets no data
    What is the proper process for an oracle table?
    I have a very complex view with 5 source tables I want to replicate.
    Thanks
    Diane

    sorry,
    with the query
    SELECT TAB2.COD_M ,
    COUNT(TAB1.COD_MAT) count_mat
    FROM TAB2,
    TAB1
    WHERE TAB2.COD_R (+) = TAB1.COD_MAT
    AND TAB1.COD_R IN ('1','3')
    GROUP BY TAB2.COD_M
    I get:
    COD_M..........COUNT_MAT
    00114940...........1
    00116220...........1
    00116300...........2
    00119320...........1
    00119450...........1
    ...................0
    but I'd like to get this output:
    COD_M..................count_mat
    00114940...................1
    00114949...................0
    00116220...................1
    00116300...................2
    00119324...................0
    00119450...................1

  • Error while creating a BO Universe (using IDT) on top of SAP HANA Calculation View with Input Parameters

    Hi All..
          We are trying to create a Universe (using IDT-Version4.0) on top of the HANA Calculation view. The Calculation view has 4 input parameters, So
    in Universe side we have created the respective prompts. For the creation of derived table we have used the following code
    SELECT *
    FROM "_SYS_BIC"."<schema_name>.<CV_Calculation_View_test>"
    'PLACEHOLDER'=('$$IP_A$$','@Prompt(A)'),
    'PLACEHOLDER'=('$$IP_B$$','@Prompt(B)'),
    'PLACEHOLDER'=('$$IP_C$$','@Prompt(C)'),
    'PLACEHOLDER'=('$$IP_D$$','@Prompt(D)')
    While validating the above code we are getting an error.
    I have attached the snapshot of that error for your reference. Please find the attachment and help me in resolving it.
    Thanks in advance.

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Calculation view with input parameters

    Hello there.
    I got a calculation with that expects 2 input parameters.
    But now I have to created another calculation view that import this calculation view.
    How can I pass these 2 parameters using sqlscript?
      My script so far
      cv1 = CE_CALC_VIEW("_SYS_BIC"."calc_1",["CR"],'"COMPANY"=''7000''');
    I must pass 2 parameters in this  "_SYS_BIC"."calc_1" table

    Hi Tiago,
    as I am aware, you cannot pass input parameters to CE function.
    You can try using regular SQL syntax:
    SELECT "CR" FROM "_SYS_BIC"."calc_1"
    WHERE "COMPANY" = 7000
    (PLACEHOLDER."$$PARAM_1$$" => VALUE_1,
    PLACEHOLDER."$$PARAM_2$$" => VALUE_2)

  • ADF View with input parameter?

    I've a table with three column:
    company id, company name, revenue
    Another table:
    employee id, employee name, company id (foreign key in company table)
    Now I've to display list of employees in 1 company (based on logged in user). How shall I achieve this in ADF using BCs?
    A very standard requirement it seems... A tutorial would be good if someone can point me to that?
    Thanks.

    Create 2 EO for the 2 tables. Create VO on top of them. You can then create a View Criteria on the EMPVO which has the condition companyId = :bCompanyId (where bCompanyId is the bind variable defined and the values is passed from UI).
    http://jobinesh.blogspot.com/2010/10/how-to-set-bind-variable-values-at.html

  • Oracle Views with Column type as CLOB

    I have a table which has a column of type CLOB. I am trying to creating a view which has all the columns of that table.
    I get
    Warning: View created with compilation errors.
    SQL> show errors;
    No errors
    Can any one help me how to create a view on a table wihich has a CLOB/BLOB column types. Also how to select the clob data from the view
    sree

    Are you the owner of the view you created?
    Check out the documentation for the SHOW command.
    If you omit schema, SHOW ERRORS assumes the object is located in your current schema.

  • Using EBS Oracle views with Discoverer

    Hi everyone
    Does anyone have experience of working with the standard EBS BI install for R12? If so, I'd like the opportunity to discuss it with you.
    Please email me on [email protected] so I can pick your brains. :-)
    Best wishes
    Michael

    Hi everyone
    Does anyone have experience of working with the standard EBS BI install for R12? If so, I'd like the opportunity to discuss it with you.
    Please email me on [email protected] so I can pick your brains. :-)
    Best wishes
    Michael

  • Customizing WAD report chart view with input types(pie, line etc..)

    Hi All
    I am very much new to WAD, now i have a requirement where in i am viewing a query output as a chart, but here the added features that need to be embedded are, adjacent to the chart view i have 4 radio buttion say
    1)area view
    2)coloumn view
    3)Line view
    4)Pie view
    Based on the radio button selection the chart view must change, so please guide me how can i achieve this funstionality.
    Regards
    VK

    Hi VK,
    1>>> use container  in that container use all the 4 charts
    2>>>make the 2> 3> 4> charts hidden
    3>>> use 4 radio buttons beside the chart give names as area column line and pie
    4> for area buttom use the command SET_ITEM_PARAMETERS make area chartvisible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide colomn chart
    ^^^^^^^^^       2> to hide line chart
    ^^^^^^^^^       3> to hide pie chart
    5> for colomn buttom use the command SET_ITEM_PARAMETERS make colomn chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
    ^^^^^^^^^       2> to hide line chart
          ^^^^^^^^^ 3> to hide pie chart
    6> for line buttom use the command SET_ITEM_PARAMETERS make line chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
         ^^^^^^^^^  2> to hide column chart
        ^^^^^^^^^   3> to hide pie chart
    7> for Pie buttom use the command SET_ITEM_PARAMETERS make Pie chart  visible
        you have add three more command for this button
    ^^^^^^^  i.e 1> to hide area chart
    ^^^^^^^^^      2> to hide column chart
       ^^^^^^^^^    3> to hide Line chart
    check the following links before , it will help you to start
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/934291ff0b274ee10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/935812ff0b274ee10000000a422035/content.htm
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0f7d724-c0f0-2d10-828f-be249d59b5c3
    Regards,
    Ranganath

  • Error while using Analytic view with BO explorer

    Hi,
    I am trying to create an info space based on my Analytic view which has input parameters. The infospace is validated and indexed without any issue. However when I ran the view, I get an error (50011) as it is unable to fetch any results. I tried using an infospace based on Calculation view with input parameters and the explorer view works without any issue.
    Has anyone faced similar issues?
    We are using HANA SP 6 rev 67 and BI 4.0 SP 4.
    Also is there a way to enable input prompts for the users when they refresh the BO Explorer view? If not currently available is there any work around ?
    Thanks

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Sending a parameter to a Oracle view

    I want to create a oracle view with a variable and i want to change the value of variable according to my needs.
    Can i Do This.
    Query of view is a complex one assume as like this
    SELECT ........ FROM
         ( SELECT ........ FROM .............
             WHERE  tempDate=TO_DATE('2007/2/23', 'YYYY/MM/DD')
      WHERE ...............................Date should be a variable.
    Variable should in a sub query.
    Pls Help as soon as possible

    Try using a PreparedStatement and insert a parameter placeholder ("?") instead of "TO_DATE('2007/2/23', 'YYYY/MM/DD')".
    Pls Help as soon as possibleUsually I don't, good you told me ...

  • Hierarchy on HANA Calculation View with Optional Input Parameters Fails

    Hi,
    Has anyone succeeded in building a hierarchy on top of a calculation view with optional input parameters, where an input parameter is not filled?
    The original requirement came from the wish to create a parent child hierarchy on a calculation view that was copied into the customer space from a HANA Live Financial Statement query view, but I have found the following when creating a simple level hierarchy on a calculation view that consumes one table. The Calculation View has one Input Parameter where the 'mandatory' box is unchecked.
    Calculation view reads ECC table FAGLFLEXT
    Simple level based hierarchy on fields PRCTR, RACCT and SEGMENT
    Input parameter is used as a filter for PRCTR with logic ("EMPTY" = '$$P_PROFITCTR$$' or "PRCTR" = '$$P_PROFITCTR$$')
    When I run the view I see the following behaviour in HANA Studio and Analysis for Excel
    Before building the hierarchy I could run the view with or without the Input Parameter
    After building the hierarchy I can run the view with the Input Parameter filled, but it fails when the Input Parameter is not filled.
    Error message is "error: search table error:  [2426] missing placeholder; missing value for mandatory parameter P_PROFITCTR"
    P_PROFITCTR is not a mandatory parameter, but the selection for the hierarchy view thinks it should be. I don't find any notes around this issue, so I don't think it's version related, however the version I have used for this test is 1.00.70.
    It's a shame we can't currently build the hierarchy as the parent child relationship is provided in HANA Live view NewGLFinancialStatementQuery.
    Thanks,
    Ken

    Hi Ken,
    We have been facing similar issue. We have even tried to set default value and as optional parameter. View still fails to create hierarchy (we are not using HANA live). As mentioned on page 97 of HANA modelling guide input parameter is mandatory from engine point of view. Hierarchy is generated as column view during the initial activation of calculation view and therefore expect a value by caller.
    This seems to be a product error. Some one from HANA development team should explain this issue in detail. I would expect someone like Thomas Jung reply to us.
    At the moment, we cant use input parameter for date prompt which gives us calendar popup feature for date selection. Hierarchies just don't work with input parameter. We are missing something.
    Regards
    Angad

Maybe you are looking for

  • User Defined Fields greyed out for one user

    Hi Experts, One of our users is a Super User but on the Business Partner Master Data screen, the User Defined Fields are greyed out. This is user specific as the issue is happening for the same user on 2 seperate PCs. Other users can update these UDF

  • Bootcamp: The installer disc could not be found

    I have downloaded Windows 8 to a flash drive and the installer doesn't recognize it.  What should I do?

  • CS4 Bridge - Keywords + backup/restore

    I have two questions to keywords in CS4 Bridge. 1. When I put a keyword on a photo, is this keyword placed in the sidecar file only, or also into the photo (NEF) file ? 2. I have made a lot of keywords and have a long list in the Keywords-tab. If I o

  • MySQL User account

    I'm trying to create a user account for MySQL. When I type in the Short Name "mysql" I get an error message "Name is used by another user". I don't know who or where this is being used. I'm trying to create a virtual directory to install and test an

  • English dictionary in csv format to create Apex page

    Hello, Im looking for a Free English dictionary in csv format that I can use to load into Apex as a page. Ive Googled and have seen many links for such, but many of the links are now invalid, or the file is not free, or the file is not in a csv forma