Oracle VIEW created on SAP table

Hi All,
I've Oracle 10g. I've a view in it on an SAP table using DB link.
I started getting error ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind when this view is fetched using FOR loop. On investigation, I found that there is a column which when VIEW is described shows datatype as VARCHAR2(10) but it actually has some records with length more than 10.
When I modified PL/SQL block and modified this query by adding SUBSTR on the column to get just 10 chars, it worked.
I suspect that this SAP table might have been recently altered to increase columns length i.e. altered after VIEW was created on it. Here, my question is that will I need to recreate this view? As usually when a view is created on an Oracle table, it automatically inherits table column's data types. even when a table column is altered after view is created.
Thanks in advance.

Hi Chintan,
Why can't you Query the SAP table and checking the length of the column ?
I think the error is now in the view. I think the problem is with the code. Hope you might
have declared a variable which does not fit the size of the value you are assigning.
This may be the cause too when you take the substr function you are not getting errors.
Can you Please the code ??
And,
If I am Clear,
When you create a view from SAP table, we just issue,
CREATE OR REPLACE VIEW sp_view
AS
   SELECT *
     FROM sapprd.marm@sap;And, the view is created based onthe base Table. So the datatype is inherited, for VARCHAR and NUMBER datatype.
And, the TIMESTAMP in SAP is to VARCHAR2 type in oracle.
Thanks,
Shankar

Similar Messages

  • How to find the views created on a table..?

    Hi all,
    I am having one table name, EMP. I want to know what are the views created on this table. Is there any SQL query is there for this or any another
    way to find it.
    Thanks in advance.
    Pal

    You can use ALL_DEPENDENCIES for that:
    SQL> create view emp_v as select * from emp;
    View created.
    SQL> select name
      2  ,      referenced_name
      3  ,      referenced_type
      4  from   all_dependencies
      5  where  name = 'EMP_V';
    NAME                           REFERENCED_NAME                                                  REFERENCED_TYPE
    EMP_V                          EMP                                                              TABLE
    1 row selected.
    SQL> select name
      2  ,      referenced_name
      3  ,      referenced_type
      4  from   all_dependencies
      5  where referenced_name = 'EMP';
    NAME                           REFERENCED_NAME                                                  REFERENCED_TYPE
    EMP_V                          EMP                                                              TABLE
    EMP_TRG                        EMP                                                              TABLE
    2 rows selected.
    SQL> Keep in mind that it matters whether you restrict on NAME or on REFERENCED_NAME.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#sthref935
    edit
    Ah, spoonfeeding!
    Don't you want him to learn something, and to become independent?Now you made me feel guilty ;) ( don't know what Saubhik posted originally, but anyway...)
    I blame my currently terribly slow connection for that...
    Anyway, OP, always start a quick search from the docs first.
    Chances are you'll find your answer yourself.
    Homes:
    http://www.oracle.com/pls/db102/homepage
    http://www.oracle.com/pls/db112/homepage
    Edited by: hoek on Oct 15, 2010 2:53 PM

  • Not able to view/check the SAP tables in BI server

    Hi All,
    Actually i was trying to view/check some SAP tables in my BI server through SE11. For example CSKS, MARA.....etc.
    But i am unable to view any tables in my BI server. I have cross checked many other tables also. The same tables i can check in my ECC server. but in my BI server system shows the message " CSKS does not exit. Check name".....so please advise whether it is some authorization problem or some thing else?.....

    Hi,
    BI/BW = OLAP System for Ready only Data
    ECC    = OLTP System for Business Transactions Purpose , Read/Write/Delete/Update/Change Data.
    So you can't find ECC Business Related tables in BW. So please check in ECC.
    If we have MARA,VBAK,VBAP etc tables in BW, why we need BW Server seperatly, we can analyse the data directly without loading to Cube/DSO.
    Thanks
    Reddy

  • View created on which table in oracle

    Hi,
    How can we get the information that view is created for which table.
    Please suggest

    SQL> desc dba_dependencies
    Name                            Null?    Type
    OWNER                            NOT NULL VARCHAR2(30)
    NAME                            NOT NULL VARCHAR2(30)
    TYPE                                  VARCHAR2(18)
    REFERENCED_OWNER                        VARCHAR2(30)
    REFERENCED_NAME                        VARCHAR2(64)
    REFERENCED_TYPE                        VARCHAR2(18)
    REFERENCED_LINK_NAME                        VARCHAR2(128)
    DEPENDENCY_TYPE                        VARCHAR2(4)query against view above

  • VIEW created from two tables

    hi,
    i have created a view between two tables.
    1. i want to know whether will i get the upto date data if i fetch data from the view.?
    2. Does  view fetch data from table every time when it is used or it stores it in buffer or something like that.? If it fetches every time ,then what is the advantage over accessing  tables directly using joins?
    pls help

    Hi Saravanan,
    Views are definitely advantageous. And you can use views over joins.
    But remember that just like joins, views using 3 or more tables can be slightly slow.
    The view doesnt store any data on its own. A view is only a logical join.
    And it does make use of the DB buffers already defined.
    May be, you need to check if you have defined your view correctly. Check your view join conditions.
    Hope this answers ur question. Reward points if it does.
    Rgds,
    Prashanth.
    SAP.

  • Query on Materialized View created on Prebuilt Table

    Hi,
    I am trying to explain the scenario below on Materialized View which I want to setup for our database.
    I have created a materialized view on prebuilt table on target side on primary key. Now for purging history data from target side which are more than 5 years old I have executed the following steps:
    1. Dropped the materialized view which was created previously on prebuilt table in target side.
    2. Deleted the data from that target table which are more than 5 years old.
    3. Now created the materialized view again on the prebuilt table.
    Now, the problem which I am facing is that - if any changes happens in the source side during the above 3 steps on the target side those changed records were not captured even after successfully building materialized view again in the target side (i.e. after completing step-3 of above the intermediate changed records were not captured).
    Can you please let me know exactly what I am doing wrong here and how can I achieve my intended result.
    Regards,
    Koushik

    See matelink for doc id *252246.1*. The document id says: A materialized view was defined on a Table A. This table had a referential constraint defined against another table, Table B. This constraint was defined as 'ON DELETE CASCADE'. An 'ON DELETE CASCADE' constraint is not allowed on views but as the constraint was created on the table underlying the materialized view, Table A, it could be created although it would behave as a constraint on the view. The constraint existed for performance reasons, which is permitted, and was disabled when created but a general script had been run to enable all constraints. When a delete was performed on Table B the error above was reported although there was no view created on Table B.

  • Modifying a View created by SAP

    Hello All,
    My requirements are to add some fields to the View in the SAP component FITE_VC_MILEAGE.
    My initial thought was to create a new Z component with a View that contains my custom fields.  I would then use my custom component as a Used Component in FITE_VC_MILEAGE. 
    When I attempt to create the used component in FITE_VC_MILEAGE, the system prompts me for an Access Key.  It will not allow me to create a Used Component in Enhancement mode.
    Should I just create the modification using the Access Key or is there a more preferred way of doing this?  After I add my component as a Used Component, would I then be able to make my changes in Enhancement Mode?
    Thanks in advance!
    -Aaron

    yes.

  • How to see the views created on a table

    Dear all,
    Please let me know the procedure to find out "the views created on a perticular table"

    CKPT wrote:
    Did OP mentioned ? :(
    change the query as
    select a.view_name,b.table_name from dba_views a, dba_tables b where a.owner='user1' b.owner='user2' and b.table_name='table' and a.owner='user';simpleWhat is that query supposed to return ?
    <s>It will do a scalar product between DBA_VIEWS and DBA_TABLES returning one single table name for every single view over your db without any link together except they have the same owner. Very useful, very helpful.</s><br>
    I misread the query, it is even worse than I thought, the query will return nothing. Nothing because a.owner cannot be equal to user1 and to user in the same time.
    I think Girish give a much better solution with DBA_DEPENDENCIES.
    Nicolas.
    Edited by: N Gasparotto on Aug 12, 2010 12:48 PM

  • Oracle view to Find out views on Table

    HI Gurus,
    Can someone please let me know how i can see all the views created for a table?
    THanks,

    Hi,
    SELECT * FROM dba_dependencies
    WHERE REFERENCED_NAME='table_name' --->Replace with ur tab name
    AND REFERENCED_TYPE='TABLE';
    Thanks

  • Can the Data Foundation Of Business View Manager Handle 100 tables or views

    Post Author: palm
    CA Forum: Crystal Reports
    Hi All,
    I am working on the DF which will take 100 Oracle Views , some may be tables in it
    Do any one know the limit of tables or views to include in DF  Or is DF can handle any number of tables or views in it that are joined in anyways?
    And one more , i had around 30 table in my DF , when i double click the table or view that are inserted in DF it will expand and minimize
    But i face this problem , when i expand a table by double clicking it in DF and then save that DF  , the BVM window closes
    Do any one know about this , please help me
    Thanks!

    Post your question to the BV forums: Semantic Layer

  • Can Oracle view refer a table in Sql Server Database

    Can a view created in Oracle database refer a table created in SQL Server database. If yes, how do we do it. Code will be very help full.
    Again, if yes does it require any special software and what would be price of that software.
    Thanks for your response in advance.
    Venkat Sathiamurthy

    You would need to configure Oracle Heterogeneous Connectivity to create a database link to the SQL Server system. This can either be done via the Oracle Transparent Gateway for Microsoft SQL Server, which retails for $15,000 per server at http://store.oracle.com or by configuring Oracle Generic Connectivity and using ODBC to go after the SQL Server data. Depending on the operating system you run Oracle on, there may be a free (or cheap) ODBC driver for SQL Server that could be used.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to CREATE VIEW to merge two tables each of which has CLOB-typed column

    I failed in creating a view to merge two tables that have CLOB-type column each.
    The details are:
    Database: Oracle 9i (9.2.0)
    Two tables "test" and "test_bak", each of which has the following structure:
    ID Number(10, 0)
    DUMMY VARCHAR2(20)
    DUMMYCLOB CLOB
    The following operation fails:
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test
    union
    select id, dummy, dummyclob from test_bak;
    I was announced:
    select test.id, test.dummy, test.dummyclob
    ERROR in line 2:
    ORA-00932: inconsistent data type: required - , but CLOB presented.
    But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
    1) one table, with CLOB-typed column
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test;
    2) two tables, without CLOB-typed columns
    create view dummyview (id, dummy) as
    select id, dummy from test
    union
    select id, dummy from test_bak;
    I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
    many thanks in advance

    Dong Wenyu,
    No.
    But you could do this:
    SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
    FROM your_table1 tab1, your_table2 tab2, (
    SELECT primary_key, ...
    FROM your_table1
    UNION
    SELECT primary_key, ...
    FROM your_table2
    ) source
    WHERE source.primary_key = tab1.id (+)
    AND source.primary_key = tab2.id (+)
    In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
    d.

  • ORA-02070: Error when updating a SQL Server table thru an Oracle View

    I have a SQL Server table TIMESHEET which contains a number of VARCHAR and NUMERIC columns plus a DATETIME column.
    Only the DATETIME column is giving me trouble.
    On the ORACLE side I have a view which selects from the SQL Server table but in order to get the SELECT to work, I had to either put a CAST or TO_DATE function call around the DATETIME field
    Below is the relevant part of the 2 view definitions I have tried
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    CAST("PeriodEnding" AS DATE) as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support CAST in this context
    create view TIMESHEET as
    SELECT
    "TsKeySeq" as TS_KEY_SEQ,
    "EmployeeNo" as EMPLOYEE_NO,
    TO_DATE("PeriodEnding") as PERIOD_ENDING,
    . . . (more columns - not relevant)
    FROM [email protected];
    An update to the view generates this message
    ORA-02070: database OLEMSQLPSANTDAS6 does not support TO_DATE in this context
    If I don't include either the TO_DATE() or CAST() then I get
    Select Error: ORA-28527: Heterogeneous Services datatype mapping error
    ORA-02063:preceding line from OLEMSQLSANTDAS6
    Does anyone have any idea how to update a SQL Server DATETIME column thru an ORACLE view?

    You can't cast accross heterogenious databases and there is no need to. HSODBC treats SQL Server DATETIME column as DATE. For example, I have SQL Server table:
    CREATE TABLE [Ops].[T_JobType](
         [JobType] [varchar](50) NOT NULL,
         [JobDesc] [varchar](200) NULL,
         [InsertDt] [datetime] NOT NULL CONSTRAINT [InsertDt_00000006]  DEFAULT (getdate()),
         [InsertBy] [varchar](128) NOT NULL CONSTRAINT [InsertBy_00000006]  DEFAULT (user_name()),
         [LastUpdated] [datetime] NOT NULL CONSTRAINT [LastUpdated_00000006]  DEFAULT (getdate()),
         [LastUpdatedBy] [varchar](128) NOT NULL CONSTRAINT [LastUpdatedBy_00000006]  DEFAULT (user_name()),
    CONSTRAINT [T_JobType_PK] PRIMARY KEY CLUSTERED
         [JobType] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON [DATA01FG]
    ) ON [DATA01FG]Now on Oracle side I do:
    SQL> desc "Ops"."T_JobType"@pbods
    Name                                      Null?    Type
    JobType                                   NOT NULL VARCHAR2(50)
    JobDesc                                            VARCHAR2(200)
    InsertDt                                  NOT NULL DATE
    InsertBy                                  NOT NULL VARCHAR2(128)
    LastUpdated                               NOT NULL DATE
    LastUpdatedBy                             NOT NULL VARCHAR2(128)
    SQL> select "InsertDt" from "Ops"."T_JobType"@pbods;
    InsertDt
    18-AUG-08
    09-OCT-08
    22-OCT-09
    18-AUG-08
    19-NOV-08
    SQL> SY.

  • Linking Tables to Oracle Views

    I am not able to see the PKs in MS-ACCESS after creating a linked table to a view within Oracle. The views were created using Select * from the base table which is a materialized view. No WHERE clause in the view.
    Also, why do I get an error when creating a linked table to a materialized view in Oracle. I am getting the following error when creating the linked table:
    "Invalid filed definition M_ROW$$ in definition of index or relationship.
    Thanks,
    Todd Schaberg
    [email protected]

    This is a known problem. We're trying to work with the materialized views folks to get this resolved.
    As a workaround, you can create a view of the materialized view and link to that.
    Justin Cave
    ODBC Development

  • View with SAP tables fails with "No Owner" error

    Dear experts,
    We have created a view (VIEW_MARA_MAKT) on Information Steward (4.2 SP1) using SAP tables MARA and MAKT.  This view is working perfectly.  Next we create another view to join with our previous view (VIEW_MARA_MAKT) to table MARC.  The view validates correctly, but when trying to view the data we get the following error:
    Data Services execution failed for VIEW_MATERIAL_PLANT. Error :
    (14.2) 04-08-14 12:46:21 (E) (0432:6996) RES-020106: |SESSION JOB_VView_736_43f3f6da_b863_46d6_ad64_b4f432a939b0|DATAFLOW EABAPDF_VIEW736_0|STATEMENT <GUID::'4a0dddf9-c993-4577-9e9a-1e0adf2dc9e2::794ee432-24f4-4801-bccf-587ef489e934::65e45615-06f8-426f-abf2-61345f6c252f' READ TABLE ICCDS_21."".MARC OUTPUT(IS_VIEW_RDR_475_0)> Table <MARC> for owner <> was not found in the repository for datastore <ICCDS_21>. Import this table from the external source. If the name is case-sensitive in the database (and not all uppercase), enter the name as it appears in the database and use double-quotation marks around the name to preserve the case. (COR-10690)
    It appears that DS is not satisfied that there is no owner name sent from IS, but for SAP connections it is not possible to specify owner names when adding the tables to IS.
    Please can you give some recommendations to resolve this error.

    What you can do is to use a table of record.
    And create a block based on stored procedure.
    Below is a table of record and procedure for querying from multi-tables.
    If you want to update, insert, delete rows, you need to create 3 more procedures on the package. One for updating, another for inserting, and so on.
    I never done updaing part before. So I need to spend time for coding.
    If you want, I can post later as soon as I got it.
    CREATE OR REPLACE PACKAGE TEST5 AS
    TYPE REC1 IS RECORD (FIRST TEST1.FIRST%TYPE,
    SECOND TEST1.SECOND%TYPE,
    THIRD TEST2.THIRD%TYPE);
    TYPE TAB1 IS TABLE OF REC1 INDEX BY BINARY_INTEGER;
    PROCEDURE TEST1CREATE (P_TAB IN OUT TAB1);
    END;
    CREATE OR REPLACE PACKAGE BODY TEST5 AS
    PROCEDURE TEST1CREATE(P_TAB IN OUT TAB1) IS
    CURSOR C IS
    SELECT A.FIRST,A.SECOND,B.THIRD
    FROM TEST1 A, TEST2 B
    WHERE A.FIRST=B.FIRST;
    i NUMBER:=0;
    BEGIN
    OPEN C;
    LOOP
    EXIT WHEN C%NOTFOUND;
    i:=i+1;
    FETCH C INTO P_TAB(i).FIRST,P_TAB(i).SECOND,P_TAB(i).THIRD;
    END LOOP;
    END TEST1CREATE;
    END;
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Hercules:
    <HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • Master Detail Query automatic query ..Urgent help

    In my last question, I asked about how to automatically query a form based on table or master detail and gota good answer. What I actually need to do is also query on the detail, for example select a.user_id, b.week_ending,b.mon_hrs,b.tues_hrs from e

  • Count Requirement

    Hi Gurus, Can you help me with my requirement. I have this report that has Summary and Details section. My issue is I can't get the correct count of my status. My Summary Section is not match with my Details section. In my SQL query output I have thi

  • Missed call notification in lock screen

    I have an iPhone 4S running iOS 5.0.1 and I discovered a potential security/privacy issue. Generally, when apps are configured so that they leave a notification on the lock screen, you can actually swipe the notification itself (rather than the "slid

  • GRR3 Deleted Report Painter report

    I deleted a Report Painter report in GRR2.  It no longer exists in table T008 or assigned to any report group.  However, the deleted report still appears in GRR3 under the respective library.  How can we remove permanently a deleted report from GRR3?

  • Can I create digital signatures for other people?

    I am trying to determine if there are rules/software limitations that prohibit me from creating a digital signature for other people on my PC. As an example, I support a Vice President-can I create his digital signature and store it to use on his beh