It's is possible to make a select from a view?

I don't know if it's possible to make a select of a table-view like V_T5F99FW if it's possible does anybody tell me how can I do?
Thanks a lot,
Regards,
Rebeca

Hi Rebeca,
You can surely do a selection from a projection and database view but not from a maintenance view.
The selection from a view works like a normal selection only.
watch this link
http://sap.ionelburlacu.ro/abap/ABAPperformance.html#Select_with_view
Regards,
Manish
Edited by: MANISH GUPTA on Aug 31, 2008 1:38 PM

Similar Messages

  • Is it possible to make a movie from sequence of images in JMF?

    I am in need of make a movie from image sequences created from YCbCr(YUV) values. Is it possible to make a movie from sequence of images in JMF?

    yes, it is.
    at www.java.sun.com in the JMF session there are several examples about your problem!
    cheers
    thomas

  • Is it Possible to make a join from a single table

    Hi all,
    Is it Possible to make a join from a single table
    Suppose HR_ALL_ORGANIZATION_UNITS table
    can we make a join in the following way
    HR_ALL_ORGANIZATION_UNITS.ORGANIZATION_ID =HR_ALL_ORGANIZATION_UNITS.BUSINESS_GROUP_ID
    Thanks in advance

    Hi
    Yes you can join,
    Like below =- it is called self join -
    Slect a.oersson_id,a.employee_numebr, b.full_name
    form
    hr_all_organization_units a,
    hr_all_organization_units b
    where
    a.person_id = b.person_id and
    sysdate between a.effective_start_date and a.effective_end_date and
    sysdate between b.effective_start_date and b.effective_end_date
    914618 wrote:
    Hi all,
    Is it Possible to make a join from a single table
    Suppose HR_ALL_ORGANIZATION_UNITS table
    can we make a join in the following way
    HR_ALL_ORGANIZATION_UNITS.ORGANIZATION_ID =HR_ALL_ORGANIZATION_UNITS.BUSINESS_GROUP_ID
    Thanks in advance

  • Is it possible to delete data selectively from Business content cubes

    Dear Experts,
             Requesting you to help me out to know, is it possible to delete data selectively from Business content cubes.
    When I'm trying to delete selectively from Business content cubes, the background job gets cancelled with ST22 logs stating
    A RAISE statement in the program "SAPLRSDRD" raised the exception  condition "X_MESSAGE".                                                                               
    Since the exception was not intercepted by a superior program, processing was terminated.  
    and i tried  with few more Technical content cubes but the same thing happens.
    Pls let me know how to selectively delete data from Business content cubes if it's possible?.
    Thanks in advance for your favorable assistance.
    Regards,
    Ramesh-Kumar.

    Hi Ramesh,
    Follow below steps for selective deletion:
    1.     Transaction code: Use the Transaction code DELETE_FACTS.
    2.     Generate selective deletion program:
    A report program will be generated of the given name, here .
    3.     Selection screen:
    Take the deletion program u201CZDEL_EPBGu201D to the transaction code SE38 to see/execute the program.
    After executing it will take you to a selection screen:
    As we need to carry out deletion selective on Calendar week, we need to get the screen field for the field Calendar week. For this, click on the Calendar week field and press F1.
    Click on the technical information button (marked in red box above) you will get below screen:
         ABAP program to carry out the Calendar week calculation
    Problem scenario: As stated earlier the requirement is to delete the data from the cube based on the calendar week. Thus a code must be developed such that the number of weeks should be taken as input and corresponding calendar week should be determined. This calendar week should be then passed to the deletion program in order to carry out the data deletion from the InfoCube.
         Transaction code: Use T-code SE38 in order to create a program.
    Logic: Suppose we need to delete the data older than 100 weeks.
    a.     Get the number of weeks and system date in variables and calculate the total number of days :
    lv_week = 100.      *number of weeks      
    lv_dte = sy-datum.     *system date
    v_totaldays = lv_week * 7.      *total days
    b.     Get the corresponding calendar day from the total days. This is obtained by simply subtracting the total no. of days from the system date.
    lv_calday = lv_dte - v_totaldays. *corresponding calday.     
    c.     Now in order to get the calendar week corresponding to the calculated calendar day we must call a function module 'DATE_TO_PERIOD_CONVERT'. This function module takes input as Calendar day and Fiscal year variant and returns the appropriate fiscal period.
    Get the sales week time elements
      call function 'DATE_TO_PERIOD_CONVERT'
        exporting
          i_date                      = lv_calday
          i_periv                     = lc_sales
        importing
          e_buper                     = lv_period
          e_gjahr                     = lv_year
        exceptions
          input_false                 = 1
          t009_notfound               = 2
          t009b_notfound              = 3.
      if sy-subrc = 0.
        ls_time-calweek(4)      = lv_year.
        ls_time-calweek+4(2)    = lv_period.
      endif.
    v_week = ls_boots_time-calweek.
    Note: We can pass the fiscal year variant which can be obtained from the table T009B.For e.g. here fiscal year variant lc_sales = Z2. LS_TIME will be any table with suitable time units.
    d.     Now we have obtained the required calendar week in the v_week variable. This calendar week is the week till which we need to keep the data. And older data than this week will be deleted. This deletion will be done by the deletion program
    Submitting the Data deletion program for ZEPBGC01 and key field
    SUBMIT ZDEL_EPBG WITH C039 LT v_week.
              Here the calendar week value is submitted to the deletion program ZDEL_EPBG with the screen field of calendar week.
    Hope ... this will  help you..
    Thanks,
    Jitendra

  • Selection from maintenance view

    Hi,
    I have created and activated a maintenance view from tables EKPO and EKKO. I needed an outer join so I had to use maintenance view instead of datbase view. When I see the data in the view using SE11 it works fine. However, when I try to select some fields from it using code it gives me an error message.
    Eg.
    REPORT Z_TEST_REP.
    TABLES: Z_MAINTVIEW.
    SELECT * FROM Z_MAINTVIEW.
    WRITE: / Z_MAINTVIEW-MYFIELD1.
    ENDSELECT.
    When activating, this gives me the error message: "Z_MAINTVIEW" is not defined in the ABAP Dictionary as a table, projection view or database view.
    Does this mean that it is not possible to select single fields from a maintenance view using the select statement? Is there any way I can do this? Any help is appreciated. Thanks.
    Khan

    Hi Khan,
    it is in the nature of EKKO (header) and EKPO (items) that you have 1 to n records (ittems) in EKPO with the same EBELN (purchase order document number). They all have different EBELP (item number values).
    I just tried: You can create a database view with tables EKKO and EKPO with join condition EKKO-EBELN = EKPO-EBELN. In the view you also need EKKO-MANDT = EKPO-MANDT to make sure you stay in your client.
    In the view fields, put all fields you want and/or need.
    You can select from this view; works great.
    Alternative: Use BAPI_PO_GETDETAIL to get all the header and item data you need. This is 100 % compliant with standard and (as I am convinced) with any programming guidelines.
    - OK as I don't know the business scenario, it might be lesss than most appropriate...
    Regards,
    Clemens

  • Is it possible to retrieve the data from maintainance view?

    Hi experts,
    Am facing one problem.
    Is it possible to retrieve the data from Maintainance View ,If yes how?
    IF it is not possible then Y?
    While am trying to retrieve data from maintainance view it's showing message like
    "it is not a database view or table".
    Can u pls give me ans.
    Thanks&Regards,
    Arun.

    Hi Arun,
    It is not possible to retrieve the data from Maintenance view. Maintenance View is different and Database View is different.
    Maintenance view : Maintenance view permits you to maintain the data of an application object together.The data is automatically distributed in the underlying database tables.
    A standardized table maintenance transaction is provided (SM30), permitting you to maintain the data from the base tables of a maintenance view together.
    In other words, Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.
    Database View: Data about an application object is often distributed on several database tables. A database view provides an application-specific view on such distributed data.A database view is automatically created in the underlying database when it is activated.Database views implement an inner join.If the database view only contains a single table, the maintenance status can be used to determine if data records can also be inserted with the view. If the database view contains more than one table, you can only read the data.
    Database views should be created if want to select logically connected data from different tables simultaneously. Selection with a database view is generally faster than access to individual tables. When selecting with views, you should also ensure that there are suitable indexes on the tables contained in the view.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Performance problem with select from _DIFF view

    Hi,
    we have a versioned table with more then one million records. We use the DBMS_WM.SetDiffVersions procedure and select from DIFF view to get data differences between two workspaces. The problem is that the select from the DIFF view is very slow. I takes more than 15 minutes. Has anybody an idea why it consumes so much time? Is there any way how to improve it?
    Thanks and regards
    Ondrej

    Hi,
    This can be due to any number of things, but is typically caused by an inefficient optimizer plan. Make sure that statistics on the _LT table have been recently analyzed.
    Also the following information would be useful:
    1. What is the relationship of the workspaces that you are trying to compare (parent/child, children of the same parent, etc) ?
    2. How many and of what type dml are being performed in the workspaces ?
    3. What version of Workspace Manager are you using and what is the version of the database ?
    4. What is the time needed to select from the _DIFF view based on the primary key ?
    Regards,
    Ben

  • Error while selecting from a view ORA-01031: Insufficient privileges

    As DBA I have granted select privileges on a view to a user, but whenever I login as that user and try to select from the view I get the message 'ORA-01031'. When I run the query in the view as the user I do not have problem and can see the results. This view joins tables from more than one schema and does a distinct on the resultset. I am new to Oracle and would appreciate any help I can get.
    Thanks

    Back on this problem when I created another user with select permission on the same view and a default role that has reference on all the objects on the other schemas, I end up with the same error message. Although this time the schema owner of the view has select privileges on all the tables from other schemas referenced in the view.
    Thanks

  • Can ResultSetMetaData() return the table name if it is selected from a view

    hi all
    can anyone tell me if ResultSetMetaData() can return the name of the table if it is selected from a view? thanks, i tried and it didn't return nothing. is it because the view is treated differently than table in ResultSetMetaData?

    hi all
    can anyone tell me if ResultSetMetaData() can return
    the name of the table if it is selected from a view?
    thanks, i tried and it didn't return nothing. is it
    because the view is treated differently than table in
    ResultSetMetaData?I would say "no". A view could be a multi-table join query, or maybe even a no-table query. The bigger picture I think though, is that you shouldn't need to know what the underlying table(s) were for this query - smells of a mis-design.

  • Is selecting from a view more efficient than selecting from multiple tables

    Hi heres the problem
    Lets say i created a view from 2 tables (person and info). both have a ID column
    create view table_view (age,name,status,id) as
    select a.age, a.name, b.status, b.id
    from person a, info.b
    where a.id=b.idif i want to select a given range of values from these 2 tables which of the following queries would be more effective.
    select a.age, a.name, b.status, b.id
    from person a, info.b
    where a.id=b.id
    and a.id <1000
    select age, name, status, id
    from table_view
    where  id <1000

    Bear in mind that this concept of views storing the SQL text is something relative to Oracle databases and not necessarily other RDBMS products. For example, Ingres databases create "views" as tables of data on the database and therefore there is a difference between selecting from the view and selecting from the base tables.
    Oracle also has "materialized views" which differ from normal "views" because they are actually created, effectively, as tables of data and will not use the indexes of the base tables.
    In Oracle, you cannot create indexes against "views" but you can create indexes against "materialized views".

  • ORA-00903 when selecting from a view

    Hi,
    I'm migrating our existing database on 8.1.7 to 9.2 and I keep getting an ORA-00903 error (on Oracle 9.2.0.1.0) when I try to select from a view with nested selects. Here's a very simple example - no rows are returned when I issue the query (its a dummy query, but it illustrates the problem). However, as soon as I turn it into a view, and do a select from the view, I get an Invalid Table Name error. Can anyone suggest why this is happening?
    So... This works on its own
    SELECT ID
    FROM (
    SELECT /*+ ORDERED */
    t.id
    FROM tblmsg t,
    tblevent e,
    e_workflowstate s,
    (SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowplntasks ws
    WHERE s.e_taskstatus_id = ws.taskid
    UNION ALL
    SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowmantasks ws
    WHERE s.e_taskstatus_id = ws.taskid
    UNION ALL
    SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowtrgtasks ws
    WHERE s.e_taskstatus_id = ws.taskid) V
    WHERE t.id = e.id
    AND t.id = v.e_taskstatus_id
    AND V.e_taskstatus_id = e.id)
    But this doesn't
    CREATE OR REPLACE VIEW TESTVIEW AS
    SELECT ID
    FROM (
    SELECT /*+ ORDERED */
    t.id
    FROM tblmsg t,
    tblevent e,
    e_workflowstate s,
    (SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowplntasks ws
    WHERE s.e_taskstatus_id = ws.taskid
    UNION ALL
    SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowmantasks ws
    WHERE s.e_taskstatus_id = ws.taskid
    UNION ALL
    SELECT e_taskstatus_id
    FROM e_taskstatus s,
    e_workflowtrgtasks ws
    WHERE s.e_taskstatus_id = ws.taskid) V
    WHERE t.id = e.id
    AND t.id = v.e_taskstatus_id
    AND V.e_taskstatus_id = e.id);
    View created
    SELECT * FROM TESTVIEW;
    ERROR at line 1:
    ORA-00903: invalid table name
    This works fine on 8.1.7. I haven't tested it on 9.1 though.
    Any ideas?
    Thanks

    One thing to try would be to use SCHEMA.TABLENAME rather than just TABLENAME to refer to the tables.
    Its just a shot in the dark, but hopefully it may help.
    Martin.

  • ORA-01031 insufficient privileges  error when selecting from a view

    OK I think this might be a dumb question but I can't figure it out:
    User John has been granted SELECT privilege (directly, not through a database role) to schema FRED.table1;
    User John can issue select * from FRED.table1; and it works just fine.
    User John has then been granted SELECT privilege (directly, not via a database role) to schema
    MARK.view1;
    MARK.view1 only selects from FRED.table1. No other tables are in the view1.
    Schema MARK can successfully query the views. SELECT * FROM VIEW1 returns results.
    I also checked the MARK schema to ensure that it has been granted SELECT on FRED.table1 directly which it has.
    Now, when logged into schema John, I try SELECT * FROM MARK.VIEW1; and I get ORA-01031 insufficient privileges error.
    I'm not sure how to troubleshoot this. If John is granted SELECT ANY TABLE, it of course works but I don't want John to have that powerful priv.
    To recap, John has SELECT on both MARK.VIEW1 and the table which VIEW1 selects from (FRED.TABLE1).
    John can select from FRED.TABLE1 no problem but receives a privilege error even though John has SELECT on MARK.VIEW1.
    Any thoughts?
    Oh, Oracle EE 10.2.0.4

    JSebastian wrote:
    OK I think this might be a dumb question but I can't figure it out:
    User John has been granted SELECT privilege (directly, not through a database role) to schema FRED.table1;
    User John can issue select * from FRED.table1; and it works just fine.
    User John has then been granted SELECT privilege (directly, not via a database role) to schema
    MARK.view1;
    MARK.view1 only selects from FRED.table1. No other tables are in the view1.
    Schema MARK can successfully query the views. SELECT * FROM VIEW1 returns results.
    I also checked the MARK schema to ensure that it has been granted SELECT on FRED.table1 directly which it has.
    Now, when logged into schema John, I try SELECT * FROM MARK.VIEW1; and I get ORA-01031 insufficient privileges error.
    I'm not sure how to troubleshoot this. If John is granted SELECT ANY TABLE, it of course works but I don't want John to have that powerful priv.
    To recap, John has SELECT on both MARK.VIEW1 and the table which VIEW1 selects from (FRED.TABLE1).
    John can select from FRED.TABLE1 no problem but receives a privilege error even though John has SELECT on MARK.VIEW1.
    Any thoughts?
    Oh, Oracle EE 10.2.0.4Are you certain John has been granted select on Mark.view1 ? In order for that to work Mark would have to have been given select on Fred.table1 WITH GRANT OPTION ... otherwise the grant would fail and then John would not be able to select from the view because the grant was never successfully issued.
    Here's a basic test case (which i think conforms to what you've outlined) to get it working.
    drop user u1 cascade;
    drop user u2 cascade;
    drop user u3 cascade;
    create user u1 identified by u1;
    grant connect, resource to u1;
    create user u2 identified by u2;
    grant connect, resource, create view to u2;
    create user u3 identified by u3;
    grant connect, resource to u3;
    connect u1/u1@orcl
    create table test1 (col1 number);
    grant select on test1 to u2 with grant option; --> this is the important part
    grant select on test1 to u3;
    connect u2/u2@orcl
    create view test2 as select * from u1.test1;
    grant select on test2 to u3;
    connect u3/u3@orcl
    select * from u2.test2;

  • It's possible to make Hierarchical Tree from multiple tables ?

    the famous example for Hierarchical Tree is about employee_id and manager_id field in employees table ............ so I was wondering it's possible to make[b] Hierarchical Tree from multiple tables ? and How ??
    if the answer associate with example that will be so kind of you :D
    and thanks in advance.

    HI
    use curose in when new form instance or procedure then u can got data more then one table like that
    DECLARE
    htree ITEM;
    top_node FTREE.NODE;
    new_node FTREE.NODE ;
    child_node ftree.node ;
    item_value VARCHAR2(30);
    cursor prime_cur is select main_desc mgr_name, main_code dept
    from pur_item_group_mst;
    cursor child_cur(v_dept number) is select sub_desc,sub_code
    from pur_item_group_dtl where main_code = v_dept ;
    BEGIN
    htree := Find_Item('tmp.tree4');
    for dummy in prime_cur loop
    new_node := Ftree.Add_Tree_Node(htree,
    ftree.root_node,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    dummy.mgr_name,
    'D:\ORYX_POLYBAGS\accept',
    dummy.dept);
    for child in child_cur(dummy.dept) loop
         child_node := Ftree.Add_Tree_Node(htree,
    new_node,
    Ftree.PARENT_OFFSET,
    Ftree.LAST_CHILD,
    Ftree.EXPANDED_NODE,
    child.sub_desc||' '||'('||child.sub_code||' '||')',
    'D:\ORYX_POLYBAGS\next',
    child.sub_code);
    end loop;
    end loop;
    END;
    Rizwan Shafiq
    www.rizwanshafiq.blogspot.com

  • If Possible to make a Image from

    Hello
    I have a doubt, Well I have a System where Exist a Server a three station of Work, Two PC (Station Work) are Ultra 5 (Very Old)
    The Idea is to change these computer by Ultra 80 Station (Because we have this type of machine in my Store)
    Is possible to make a Image of the disk of the Ultra 5 and copy this information to Ultra 80?
    If this is possible, I would Like to help me,
    Regard
    Andres

    Since the NI-DAQ driver software is multithreaded, a multiprocessor system would have enhanced performance over a single processor system. Either way, you can have multiple handshaking digital I/O cards in a system for high speed acquisition, granted you have enough operating system resources (DMA, IRQ) for the cards.
    You can find more information about this by going to the http://www.ni.com/support page and searching All Technical Resources for the keyword "multiprocessor". You will find an excellent NI Developer Zone presentation, as well as tutorials and other technical documents.
    Geneva L.
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Selecting from a view when tables are in more than one schema problem

    I give up where am I missing it. Why is the ORA-01031 error being generated on the view u1.bv1. In testing even if I give object access to u3 I still get the same errors:
    SQL>
    SQL> drop user u1 cascade;
    drop user u1 cascade
    ERROR at line 1:
    ORA-01918: user 'U1' does not exist
    SQL> drop user u2 cascade;
    drop user u2 cascade
    ERROR at line 1:
    ORA-01918: user 'U2' does not exist
    SQL> drop user u3 cascade;
    drop user u3 cascade
    ERROR at line 1:
    ORA-01918: user 'U3' does not exist
    SQL> drop role aRole;
    drop role aRole
    ERROR at line 1:
    ORA-01919: role 'AROLE' does not exist
    SQL>
    SQL>
    SQL> select user from dual;
    USER
    SYS
    1 row selected.
    SQL>
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Solaris: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    5 rows selected.
    SQL>
    SQL> create user u1 identified by u1 default tablespace users
    2 quota unlimited on users;
    User created.
    SQL>
    SQL> create user u2 identified by u2 default tablespace users
    2 quota unlimited on users;
    User created.
    SQL>
    SQL> create role aRole;
    Role created.
    SQL>
    SQL> create user u3 identified by u3 default tablespace users;
    User created.
    SQL>
    SQL> grant aRole to u3;
    Grant succeeded.
    SQL>
    SQL> alter user u3 default role all;
    User altered.
    SQL>
    SQL> grant create session to u3;
    Grant succeeded.
    SQL>
    SQL> create table u1.t1(c1 number);
    Table created.
    SQL>
    SQL> create table u2.t1(c1 number);
    Table created.
    SQL>
    SQL> grant select on u2.t1 to u1;
    Grant succeeded.
    SQL>
    SQL> create or replace view u1.bv1 as
    2 select u1.t1.c1 as c1 ,u2.t1.c1 as c2
    3 from u1.t1, u2.t1 where u1.t1.c1 = u2.t1.c1;
    View created.
    SQL>
    SQL> grant select on u1.bv1 to aRole;
    Grant succeeded.
    SQL>
    SQL> create or replace view u1.gv1 as select * from u1.t1;
    View created.
    SQL>
    SQL> grant select on u1.gv1 to aRole;
    Grant succeeded.
    SQL>
    SQL> connect u3/u3
    Connected.
    SQL>
    SQL> select * from u1.bv1;
    select * from u1.bv1
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL>
    SQL> select * from u1.gv1;
    no rows selected
    SQL>
    SQL> spool off

    User u1 cannot do a grant on a view to other user if the view uses tables from other schemas unless you do a "with grant option" grant.
    You need to do the following to make it work:
    SQL> grant select on u2.t1 to u1 with grant option;
    Grant succeeded.
    SQL>

Maybe you are looking for