Views for PO related tables?

Hi Guys,
           Can anybody tell me any views for PO tables with EKKO,EKPO,EKKN and EKBE ?
                     I am using these tables for displaying a report and i have to get EKBE-BELNE ,EKKN-(PRCTR,ANLN1) , EKPO-(EBELP,NETPR,KNTTP),EKKO(EBELN,BEDAT,LIFNR) into a single internal table.The reason for views is if i link these tables its taking so much of time.
Thanks,
Gopi Anne.

the statement "don't use joins, use for all entries" is simply not correct, but you seemingly can't get this out of people's heads anymore.
I would try something like this
SELECT ... INTO ...
FROM EKKO
JOIN EKPO ON EKKO~EBELN = EKPO~EBELN
JOIN EKKN ON EKPO~EBELN = EKKN~EBELN
         AND EKPO~EBELP = EKKN~EBELP
JOIN EKBE ON EKPO~EBELN = EKBE~EBELN
         AND EKPO~EBELP = EKBE~EBELP
WHERE ...
If we're lucky, the optimizer will choose the correct index from either EKKO (LIFNR, BEDAT) or EKKN (ANLN1) and the thing might actually run quite quickly...
Make sure you include EKKO-BSTYP = "F" in your WHERE-clause (for the EKKO-BEDAT index).
Cheers
Thomas

Similar Messages

  • Reg :-maintain a table maintenance view for the z table.suggest me the code

    i have question.i have created a z table related to pp module.the requirement is to maintain {table maintenance view} for this z table.how could this be done.can any one suggest me the code for this?

    Hi ,
    We have a lots of queries on table maintainance creation in the forum posted and replied to.Pls have a look at it first.
    In se11 -> change mode of the ztable -> goto -> utilities -> table maintainance generator -> click on it...
    it will give a new screen-> enter the required details like function group , authorisation(use &NC& or leave it blank if you dont know)  and screens
    2 step and 1 step means=> number of screens displayed in maintainace
    if step1 is selected then we have a screen which will be like a table control for data entry.........
    for step2 we have a table control screen and a more detailed individual field display as second screen
    click on the button 'find screen numbers' so that system automatically proposes the screen numbers
    after which click on the "create" button and follow the required instructions/messages
    once done go to SM30 enter the table name to check if maintainance has been created properly
    Hope it helps,Pls check and revert
    Regards
    Byju

  • Changing the default associated view for a related entity

    A question from a peer:
    Hey there
    Do you know how in CRM 2015 to change the default associated view for a related entity?
    Say you are in an Account and from the menu open the opportunities for that account.
    That new pop up window states “Opportunity Associated View” I want to change that to “My Custom View”
    I thought we covered this in class years back but cannot remember

    There are a few ways to get what you want, the easiest being
    Create a document as you want it for a particular site, save it is junk.php or similar and create a new file by saving as this as the proper document name such as index.php
    Use the Dreamweaver template system, i.e. create a template with a .dwt.php extension like template.dwt.php and use that to create new pages.
    There are other ways like creating your own php template system. But you can put that in the too hard basket.

  • View for CDPOS & CDHDR tables

    Hi all,
    I am developing a report for which I am fetching fields from CDPOS & CDHDR tables (both r cluster tables). when i run st05, it fetches values from a cluster table CDCLS which takes most of the database time.
    Is there any view for CDPOS & CDHDR tables?
    How to find the views for cluster tables?
    Thanx in advance.
    Vijay.

    hi,
    check this code,
    here i used function module to get details of cdhdr,cdpos.
    TABLES : MARC.
    DATA :BEGIN OF GI_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          DISPO LIKE MARC-DISPO,
          END OF GI_MARC.
    DATA : CHAR TYPE I,
           COUNT TYPE I,
           VAR TYPE I.
    DATA : BEGIN OF GI_FINAL OCCURS 2000,
           MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME LIKE CDHDR-USERNAME,
           UDATE LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           TABNAME LIKE CDPOS-TABNAME,
           TABKEY  LIKE CDPOS-TABKEY,
           FNAME  LIKE CDPOS-FNAME,
           VALUE_NEW  LIKE CDPOS-VALUE_NEW,
           VALUE_OLD   LIKE CDPOS-VALUE_OLD,
           CHANGENR LIKE CDHDR-CHANGENR,
           END OF GI_FINAL.
    DATA : MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME1 LIKE CDHDR-USERNAME,
           UDATE1 LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           CHANGENR LIKE CDHDR-CHANGENR.
    DATA : GI_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE.
    DATA : GI_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    DATA : OBJECTCLAS LIKE CDHDR-OBJECTCLAS VALUE 'MATERIAL',
           OBJECTID LIKE CDHDR-OBJECTID,
           USERNAME LIKE CDHDR-USERNAME VALUE 'RSS-SPE',
           UDATE LIKE CDHDR-UDATE VALUE '20070101',
           CHANGE_IND LIKE CDHDR-CHANGE_IND VALUE 'U'.
    type-pools: slis.
    data: gt_slis_fcat type slis_t_fieldcat_alv.
    data: gt_fieldcat type slis_t_fieldcat_alv.
    *data: gt_fieldcatall type slis_t_fieldcat_alv.
    data: g_repid like sy-repid.
    data: gs_layout type slis_layout_alv.
    gs_layout-zebra             = 'X'.
    gs_layout-colwidth_optimize = 'X'.
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-110.
    SELECT-OPTIONS :  P_DISPO FOR MARC-DISPO.
    SELECT-OPTIONS : RECORDS FOR CHAR.
    SELECTION-SCREEN : END OF BLOCK B1.
    START-OF-SELECTION.
    perform process_data.
    perform f_fieldcat_init using gt_fieldcat[].
    perform alv_display tables gi_final using gt_fieldcat[].
    form process_data.
      SELECT MATNR WERKS DISPO FROM MARC INTO TABLE GI_MARC
                                WHERE DISPO IN P_DISPO
                                AND WERKS = '1011'." Becoz we hav to chk the
    the changes made in the material while extendin tht matrl frm 1011 to
    *other plant.
      IF NOT GI_MARC[] IS INITIAL.
        IF NOT RECORDS-LOW IS INITIAL .
          IF NOT RECORDS-HIGH IS INITIAL.
            DESCRIBE TABLE GI_MARC LINES COUNT.
            IF RECORDS-HIGH < COUNT.
              DELETE GI_MARC FROM RECORDS-HIGH TO COUNT.
            ENDIF.
            IF RECORDS-LOW <> 1.
              IF RECORDS-LOW <> 0.
                DELETE GI_MARC FROM 1 TO RECORDS-LOW.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      LOOP AT GI_MARC.
        CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
          EXPORTING
            INPUT              = GI_MARC-MATNR
         IMPORTING
           OUTPUT             = GI_MARC-MATNR
    EXCEPTIONS
      LENGTH_ERROR       = 1
      OTHERS             = 2
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        OBJECTID = GI_MARC-MATNR .
        CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
          EXPORTING
      ARCHIVE_HANDLE                   = 0
           DATE_OF_CHANGE                   = UDATE
            OBJECTCLASS                      = OBJECTCLAS
            OBJECTID                         = OBJECTID
      TIME_OF_CHANGE                   = '000000'
           USERNAME                         = USERNAME
      LOCAL_TIME                       = ' '
      DATE_UNTIL                       = '99991231'
      TIME_UNTIL                       = '235959'
          TABLES
            I_CDHDR                          = GI_CDHDR
         EXCEPTIONS
           NO_POSITION_FOUND                = 1
           WRONG_ACCESS_TO_ARCHIVE          = 2
           TIME_ZONE_CONVERSION_ERROR       = 3
           OTHERS                           = 4
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        IF NOT GI_CDHDR[] IS INITIAL.
          LOOP AT GI_CDHDR.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
            VAR = 1.
            CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
              EXPORTING
                INPUT              = GI_FINAL-MATNR
                IMPORTING
               OUTPUT             = GI_FINAL-MATNR
             EXCEPTIONS
               LENGTH_ERROR       = 1
               OTHERS             = 2
            IF SY-SUBRC <> 0.
            ENDIF.
            OBJECTID = GI_FINAL-MATNR ."to ensure that objid is in proper
    *format
            SELECT *
                   FROM CDPOS
                   INTO TABLE GI_CDPOS
              PACKAGE SIZE 100
              FOR ALL ENTRIES IN GI_cdhdr
                   WHERE OBJECTID = OBJECTID
                     AND CHANGENR = GI_CDHDR-CHANGENR
                     AND OBJECTCLAS = OBJECTCLAS
                     AND CHNGIND =  CHANGE_IND." only those values will b
    *takn which have been modified nd nt created
            IF SY-SUBRC = 0.
              LOOP AT GI_CDPOS.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
                MOVE GI_CDPOS-TABNAME TO GI_FINAL-TABNAME.
                MOVE GI_CDPOS-TABKEY TO GI_FINAL-TABKEY.
                MOVE GI_CDPOS-FNAME TO GI_FINAL-FNAME.
                MOVE GI_CDPOS-VALUE_NEW TO GI_FINAL-VALUE_NEW.
                MOVE GI_CDPOS-VALUE_OLD TO GI_FINAL-VALUE_OLD.
                  APPEND GI_FINAL.
                  CLEAR GI_FINAL.
               ENDIF.
                VAR = VAR + 1.
       ENDSELECT.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
              CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        ENDIF.
      ENDLOOP.
      endform.
    form f_fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
       clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'MATNR'.
      ls_fieldcat-seltext_l    = 'Material number'.
    ls_fieldcat-tabname      = 'GI_final'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'DISPO'.
      ls_fieldcat-seltext_l    = 'mrp controller'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'USERNAME'.
      ls_fieldcat-seltext_l    = 'Username'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'CHANGENR'.
      ls_fieldcat-seltext_l    = 'Change Number'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UDATE'.
      ls_fieldcat-seltext_l    = 'modified date'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UTIME'.
      ls_fieldcat-seltext_l    = 'MODIFIED TIME'.
      append ls_fieldcat to lt_fieldcat.
    clear ls_fieldcat.
    ls_fieldcat-fieldname    = 'UDATE'.
    ls_fieldcat-seltext_l    = 'MODIFIED DATE'.
    append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TCODE'.
      ls_fieldcat-seltext_l    = 'TRANSACTION CODE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABNAME'.
      ls_fieldcat-seltext_l    = 'TABLE NAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABKEY'.
      ls_fieldcat-seltext_l    = 'TABLE KEY'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FNAME'.
      ls_fieldcat-seltext_l    = 'FNAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FVALUE'.
      ls_fieldcat-seltext_l    = 'FVALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_NEW'.
      ls_fieldcat-seltext_l    = 'NEW VALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_OLD'.
      ls_fieldcat-seltext_l    = 'OLD VALUE'.
      append ls_fieldcat to lt_fieldcat.
    endform.                    " f_fieldcat_init
    form alv_display tables  gi_final using gt_fieldcat .
      call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = ' Material list '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
         is_layout                      = gs_layout
         it_fieldcat                    = gt_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab                       = gi_final
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.
    regards
    siva

  • Creation of Sales org views for customers related to vendor

    Hello All,
                 Can any body tell me is there any functional module which can be used to created the sales org views for customers related to vendors.
    Regards
    Srinivas

    Hi Ravi,
    the number of sales area possible would be 6 sales area,
    yes you can of course use the common master data functionality
    After creating the organizational structure and relevant master records you want to use as the masters, that is, in the distribution channels and divisions you are going to use as a reference, you can group distribution channels and divisions separately for master data (which combines customer master and material master records), group condition records, or both master data and condition records.
    Letu2019s say you have a product range that is not different for the four different distribution channels you have (the channels could be telesales, retail, industry, and wholesale.) Neither is there a difference in the customersu2019 details when they purchase through one or the other. Thus, you will not want to create a multiple of four views of customer master and material master records. Merely create the customer master records and material master records in one of the distribution channels, such as retail. Then assign the other distribution channels you created in the organizational structure setup to this one.
    Donu2019t forget this means you can only create or change master data in the distribution channel that is being referenced. In the scenario above, this means you can only change data for the retail distribution channel. Even if you should access a customer or material master in change mode, press F4 (possible entries), and select telesales, industry, or wholesale, you will receive a message u201CSales area is not defined . . . u201D
    The same is true for the sharing of conditions. If conditions are shared, you need only create a condition in the distribution channel or division you are using as the reference. Obviously, this only pertains to conditions that have the distribution channel and/or division in their key, such as a price based on sales area
    Revert if helpful
    Mohit Singh

  • Creating 2 table maintainance views for one custom table

    Hello All,
    I want to create 2 table maintainace views for one custom table.
    I know how to create table maintainace but I want to know whether we can create only one maintainance view or we cal also create 2 maintainace views for a single custom table.
    Regards
    Mahesh

    Hello,
    You can create as many maintenance views one one table as you want.
    Kind regards,
    Bart

  • View for mseg database table

    I want to extract data from MSEG. Its becoming performance issue. Can anybody advice me regarding any view which i can use in place of MSEG

    a view won't increase performance, have you tried to force the index or create an index for the fields you use for the mseg table
    perhaps if you need specific data you can also check BSAK BSIK  BSAD BSID  tables which are related to BSEG .
    kind regards
    arthur de smidt
    Edited by: A. de Smidt on Jul 30, 2008 1:03 PM

  • Create view for Global Temporary Table

    if view is create for global temporary table so exactly how it works which helps regarding application performance.
    Regaards,
    Sambit Ray

    A view is just a stored query. It can be on global temporary tables or regular one, makes no difference.

  • DB view for union of table

    hi guys.
    Is it possibile to create an ABAP DataBase view for an UNION ALL of 2 tables with same fields ?
    From SE11 is possible to create only joined tables, i think...is it true ?
    I must split records of one custom table into two tables (active records and archived records); so, i thought to create an union all (view) to semplify modification on abap programs needs both tables's record.
    thanks a lot.

    hi.
    Thanks for confirmation it isn't possible to create union on abap DB view (se11).
    for Yukonkid:
    - on sql-92 "union join" is included
    - "SELECT form both tables and "union" them in an internal table"...a DB view intend to be a same solution but more easy to develop (easy=few abap's rows)
    for Sneha:
    my target is performance: i have a big table (a lot of rows) with 95% archived and using index not resulted a good solution
    bye

  • Creating maintainance view for a customising table

    Hello Team,
    I have a scenario where we have to create a maintainance view for a standard customising table. But all changes to entries for customising tables will prompt for a transportable change request. How to switch off this prompt for change request? Please let me know your views on this.
    Thanks!

    create a maintainance view for a standard customising table
    Doing that wont be a good idea.
    If you only want to disable the transport request in a production system, then call transaction SOBJ. Give the name of the object = the maintenace view, set the "[Current Settings|http://help.sap.com/saphelp_glossary/en/35/2a2c6ad9685cd5e10000009b38f974/content.htm]" flag on. (eg. F-60 on V_T001B for "Posting Periods: Specify Time Intervals")
    Regards,
    Raymond

  • Creating view for DataSource from table containing Structures.

    Hello All,
    I need to make a datasource for HR PY master data from a table PA9004(its special for a HR infotype) which needs some fields like PFOBEE(PF-Opening Balance-Ee).
    Field(PFOBEE) is part of a structure(PS0008) which is included in the table PA9004.I tried where-used list for this structure in programs,FuncModules,Tables but got no result of any transparent table.
    To form my Datasource I tried creating the Database view, which had inconsistencies. I tried using the table PA9004, which said "This operation failed, because the template structure quantity fields or currency fields, for example, field PFOBEE refer to a different table."
    Also Projection view cant be used for generic datasources.
    Even Create Infostructure(MC21) does not work for HR: PY-IO.
    All suggestions welcome.Mail me at [email protected]

    Hello All,
    I solved this problem by forming my generic datasource(TCode RSO2) on a Infoset which had the table pa9004. There were some warnings regarding the use of the development class, but finally I had the datasource ready.
    I checked the datasource is working using the RSA3 TCode and the DS is perfectly extracting the data. I replicated this DS in BW server and it appears exactly where I wanted.
    Some colleages had suggested writing a functional module to extract the data, which must be right but I have not tried this option yet.
    Experts may please review my solution and offer tips. I am willing to offer points to anyone offering a more elegant solution.

  • Standard Datasource for Excise related tables in R/3

    Hi Experts,
        We are developing BI Reports for the Custom Reports in R/3 .
        In one of the ZReports in R/3 the data is coming from 12 tables.
        The data is coming from the tables EKBE,EKPO,EKKO,ADRC,MKPF,BKPF ,MAKT,
        J_1IPART1,J_1IPART2,J_1IEXCDTL,J_1IMOVEND,J_1IMTCHID.
        The tables J_1IPART1,J_1IPART2,J_1IEXCDTL,J_1IMOVEND,J_1IMTCHID are Excise Related.
        Please suggest me if any standard Datasource is available for these tables .
    Regards,
    Chakradhar

    Hi,
    There is no Standard DS for Excise.
    I created the Generic Dss on those tables with delta enabled in my last project. And they are running successfully.
    I created 2 DSs on the same table , one with delta enabled on Created date and  another one with delta enabled on Changed date ( Wherever this field is there in the base table). And used Lower limit as 1 as safty delta so that I was able to do delta loads multiple times in a day.
    Regards,
    Anil Kumar Sharma .P

  • Maintaince view creation for a cluster table

    Hi friends,
    I have created a maintaince view for a cluster table bseg and i have activated it its working fine..
    now my problem is i can create maintaince view for mutiple tables if other tables are linked with primary table using foriegn key relationship..
    Now can any one tell me is it possible to create maintance view for cluster table with multiple tables as i need a linked table with bseg which iam not able to get... ie : when i click on the relationship tab iam not getting the linked tables for bseg...
    now can i create a maintaince view with 2 linked cluster tables..
    if so can any one tell me how to create it.
    As sap says we can create projection view for cluster and pooled table and we cannot create database view for cluster and pooled tables , but it does not mentioned like that for maintaince view....
    I assume we can do it.... as iam trying to create a maintaince view with single cluster table then it shoudl allow me to create for multiple linked cluster tables.... and is it mandatory to maintain TMG for this maintaince view....?
    Regards
    KUMAR

    yes.. ur right inserting values into a cluster table other than standard sap tarnactions is dangerious....
    But sap didnot mentioned any where that we cannot maintain data for cluster tables using maintaince view... which it said for database view..that pooled and cluster table cannot be used for database view..
    Regards
    Kumar

  • HELP! Applying a varray to a relational table via an object view

    Hi
    I could really do with some help on this one its drivin me nuts!
    I'm trying to create an object view for the following table using the following ADTs and a Varray:
    R_CUSTOMER
    CUSTID NUMBER
    LNAME VARCHAR2(25)
    FNAME VARCHAR2(25)
    STREET VARCHAR2(30)
    TOWN VARCHAR2(25)
    COUNTY VARCHAR2(25)
    PCODE CHAR(9)
    DPHONE CHAR(15)
    EPHONE CHAR(15)
    MPHONE CHAR(15)
    PERSON_TY
    LNAME VARCHAR2(25)
    FNAME VARCHAR2(25)
    ADDRESS ADDRESS_TY
    PHONES PHONE_VA
    ADDRESS_TY
    STREET VARCHAR2(50)
    TOWN VARCHAR2(25)
    COUNTY VARCHAR2(25)
    PCODE CHAR(9)
    create or replace type PHONE_VA as varray(4) of VARCHAR2(15)
    But can the procedure required to select data from the varray be included in the view. I've tried all sorts but i just can't get it to work.
    Can this be done? if so how
    Thks
    null

    Matthew,
    Yes, this can be done with the cast-multiset operator. Please see my answer to your earlier posting.
    Regards,
    Geoff

  • REF to an object in a relational table

    Hi!
    I try do create a DB for TINs made of triangles. Because of the topology a triangles ist made of three edges and each edge is made of two nodes. The nodes contain the geometry (x,y,z coordinates).
    I created object types for each element.
    In order to fasten the request of geometry data I build Spatial objects, too.
    My tables look like the following
    CREATE OR REPLACE TYPE node_objtyp AS OBJECT (
    node_Id NUMBER(10,0),
    xValue NUMBER(7,3),
    yValue NUMBER(7,3),
    zValue NUMBER(7,3)
    CREATE TABLE nodes_reltab(
    node_Id NUMBER(10,0),
    node_Ref node_objtyp,
    node_Shape mdsys.sdo_geometry
    CREATE OR REPLACE TYPE edge_objtyp AS OBJECT (
    edge_Id NUMBER(10,0),
    from_Node_Ref REF node_objtyp,
    to_Node_Ref REF node_objtyp,
    is_Fold     NUMBER(1,0)
    CREATE TABLE edges_reltab(
    edge_Id NUMBER(10,0),
    edge_Ref edge_objtyp,
    edge_Shape mdsys.sdo_geometry
    How do I insert data into edges_reltab if from_Node_Ref and to_Node_Ref in edge_objtyp should refer to two existing node_objtyps in nodes_reltab node_Ref column??
    I tried
    INSERT INTO edges_reltab VALUES(
    1,
    edge_objtyp(
    1,
    (SELECT REF(n)
    FROM (
    SELECT node_ref
    FROM nodes_reltab
    WHERE node_Id = 1
    )n
    (SELECT REF(n)
    FROM (
    SELECT node_ref
    FROM nodes_reltab
    WHERE node_Id = 2
    )n
    0
    mdsys.sdo_geometry(
    3002,
    NULL,
    NULL,
    mdsys.sdo_elem_info_array(1,2,1),
    mdsys.sdo_ordinate_array(
    2,4,0,
    3,4,0,
    2,4,0
    But just got a ORA-00904 error!
    In my first DB I used object tables. It worked fine, but it was impossible to create an Spatial index an these tables. So I've been forced to use relational tables.
    Thank you for your help!
    Joerg

    Hi Joerg
    It is only possible to use REF with object tables and object views.
    Creating an object view over the relational table will probably not solve your problem (see error ORA-22979).
    Therefore, since you are using a relational model, you should use a foreign key.
    Chris

Maybe you are looking for