SQL Bulk Update using Update query in SQL Table

Hello All,
I want to update data in sql table depends on some condition.
I am getting excel sheet from client and want to change value of field say Status = c.
Client is sending excel sheet with 300 field and want to change value for all 300 records with unique fields (field1 and field2) comming in that excel sheet...
How can i write and update records as Bulk.
Instaed updating one one recors ?
Example ( Update Table_Name Set Status = 'c' Where Field1 = Value from Excel for Field1 and
Field2 = Value from Excel for Field2 )
Same needs to do for 300 records...
Any help will wellcome.
Thanks,
Nilesh....
Thanks and Regards, Nilesh Thakur.

you can use OPENROWSET for that
http://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/
Another way is to use SSIS with data flow task having Excel source connecting to excel and using OLEDB command to update rows in table using it. You may also use staging table to get data from excel and later use it inexecute sql task to update your table
to make update set based which would be faster.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Bulk Update query

    Hello Friends,
    Can some one suggest me is that any possible bulk update query which consumes less timings?
    Table - MyTable
    id - PK.
    orderid - Order Id.
    Subid - Sub Id for an Order.
    lineitem - LineItemId.
    ProducId - Product Id.
    Now i want to update the Subid to My Table for Every Order on Basis of LineItemId..
    For Ex:
    I will be having the records in MyTable as for a single Order...there can mutilple Subid's.
    UPDATE MyTable SET subid = 1 WHERE orderid = 123 AND lineitem = 1;
    UPDATE MyTable SET subid = 1 WHERE orderid = 123 AND lineitem = 2;
    UPDATE MyTable SET subid = 5 WHERE orderid = 123 AND lineitem = 2000;
    I worked out three scenarios as follows,
    Case1:
    UPDATE MyTable SET subid = 5 WHERE orderid = 123 AND lineitem = 2000;
    Case2:
    UPDATE MyTable SET subid = 1 WHERE orderid = 123 AND lineitem in(1,2,3.....1000);
    UPDATE MyTable SET subid = 2 WHERE orderid = 123 AND lineitem in(1001,1002,.....1100);
    Case3:
    UPDATE MyTable SET subid= CASE WHEN lineitem = 1 THEN 1 WHEN lineitem = 2 THEN 2 .....WHEN 1000 THEN 1000 END WHERE orderid = 123;
    Please suggest me which update consumes less time and helpful for updating more records nearly 5000 - 10000 at a single table.

    You are comparing three cases that are not equal to each other:
    Case1:
    UPDATE MyTable SET subid = 5 WHERE orderid = 123 AND lineitem = 2000;
    Here you update the records with orderid = 123 and lineitem = 2000
    Case2:
    UPDATE MyTable SET subid = 1 WHERE orderid = 123 AND lineitem in(1,2,3.....1000);
    UPDATE MyTable SET subid = 2 WHERE orderid = 123 AND lineitem in(1001,1002,.....1100);
    This are multiple update statement to update all records with orderid = 123 and lineitems between 1 and 1100.
    Case3:
    UPDATE MyTable SET subid= CASE WHEN lineitem = 1 THEN 1 WHEN lineitem = 2 THEN 2 .....WHEN 1000 THEN 1000 END WHERE orderid = 123;
    And here all records with orderid = 123, regardless of the lineitem are updated.
    So my guess is that 1 will be the fastest as it is updating the least amount of records, followed by 2 and then 3. But it is a really weird comparison.
    I think you'd better make up your mind first about which records need to be updated and how. And then it is best to use one update statement to do the job.
    Regards,
    Rob.

  • Update query for Advanced table.

    Hi,
    I am an newbie to OAF so need help for a simple task.
    I have an advanced table that has been created using expert mode query of VO. (as it contains data from more than one table).
    Now, i want to update the data for any row that is changed in the table,
    i followed the advanced table example in the tutorial and reached till the update method of AM. Now I am not able to update the table. When I searched the forum it said that I need to have a simple EO on the table to update it, but I want to update more than one table ( foreign key relationship), so can I do it using the same VO ? I have both the VO (one based on custom select query of Expert mode and other normal VO based on EO).
    Can someone please give me the query to update the table ?
    Thanks,
    VK

    Thanks Reetesh for your reply.
    As this is a simple task I wan't to do it via OAF query rather than writing PL/SQL procedure.
    I have two tables , say error table and interface table, (there is a foreign key relation ship between these tables, ie. i have to show the interface name present in the interface table via the foreign key in the error table). I used the following query to get the data
    SELECT xxgblErrorMasterEO1.ERROR_ID_NO,
    xxgblErrorMasterEO1.ERROR_CODE,
    xxgblErrorMasterEO1.ERROR_MESSAGE,
    xxgblErrorMasterEO1.CREATED_BY,
    xxgblErrorMasterEO1.CREATION_DATE,
    xxgblErrorMasterEO1.LAST_UPDATED_BY,
    xxgblErrorMasterEO1.LAST_UPDATE_DATE,
    xxgblIntfProgramMaster.INTERFACE_NAME,
    xxgblErrorMasterEO1.ERROR_TYPE
    FROM XXEEG.XXGBL_ERROR_MASTER xxgblErrorMasterEO1,
    XXEEG.XXGBL_INTF_PROGRAM_MASTER xxgblIntfProgramMaster
    where xxgblErrorMasterEO1.INTERFACE_ID_NO =
    xxgblIntfProgramMaster.INTERFACE_ID_NO
    I like the idea of Advanced table while going through the tutorial (example 2) and would want to show certain fields by expanding on the + mark ( just like in the explorer)
    now i want to update any of the fields that i show to the user (except the WHO fields). Say for example if the user updates the error_message and Interface_name, so how should i write the update method in the AM ?
    Pardon me if this sounds simple :(

  • Update query for a table

    Hi
    Can any body send valid update query like this:
    <sql:update var="XX">
    Update emp set name='yy', phone='1234' where id='abc'
    </sql:update>
    Thanks in Advance
    SP

    Hi
    Can any body send valid update query like this:
    <sql:update var="XX">
    Update emp set name='yy', phone='1234' where id='abc'
    </sql:update>
    Thanks in Advance
    SP

  • Update Query For Hierarchy Table

    Hi All
    I have a Hierarchy table that has news categories. I want use a query than when user deactivate a category, all child category has been deactivated. For example
    1- Politics
    1-1- National Politics
    1-2- International Politics
    1-2-1- Asia
    1-2-2- Africa
    2- Economic
    If Politics has been deactivated, all child must be deactivate. (1-1, 1-2, 1-2-1, 1-2-2)
    Please help me
    With Best Regards

    This is table structure script:
    SET NUMERIC_ROUNDABORT OFF
    GO
    SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
    GO
    IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#tmpErrors')) DROP TABLE #tmpErrors
    GO
    CREATE TABLE #tmpErrors (Error int)
    GO
    SET XACT_ABORT ON
    GO
    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
    GO
    BEGIN TRANSACTION
    GO
    PRINT N'Creating schemata'
    GO
    PRINT N'Creating [dbo].[Modules]'
    GO
    CREATE TABLE [dbo].[Modules]
    [Module_ID] [int] NOT NULL,
    [ModuleName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ModuleTitle] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [Status] [int] NULL
    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    PRINT N'Creating primary key [PK_Modules] on [dbo].[Modules]'
    GO
    ALTER TABLE [dbo].[Modules] ADD CONSTRAINT [PK_Modules] PRIMARY KEY CLUSTERED ([Module_ID])
    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    PRINT N'Creating [dbo].[Categories]'
    GO
    CREATE TABLE [dbo].[Categories]
    [Category_ID] [int] NOT NULL IDENTITY(1, 1),
    [Module_ID] [int] NOT NULL,
    [ParentID] [int] NULL,
    [Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [Title] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [Priority] [int] NULL,
    [ThumbnailImage] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [Status] [int] NULL
    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    PRINT N'Creating primary key [PK_Categories] on [dbo].[Categories]'
    GO
    ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED ([Category_ID])
    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    PRINT N'Adding foreign keys to [dbo].[Categories]'
    GO
    ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [FK_Categories_Modules] FOREIGN KEY ([Module_ID]) REFERENCES [dbo].[Modules] ([Module_ID])
    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT>0 BEGIN
    PRINT 'The database update succeeded'
    COMMIT TRANSACTION
    END
    ELSE PRINT 'The database update failed'
    GO
    DROP TABLE #tmpErrors
    GO
    This is table data
    SET NUMERIC_ROUNDABORT OFF
    GO
    SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS, NOCOUNT ON
    GO
    SET DATEFORMAT YMD
    GO
    SET XACT_ABORT ON
    GO
    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
    GO
    BEGIN TRANSACTION
    -- Pointer used for text / image updates. This might not be needed, but is declared here just in case
    DECLARE @pv binary(16)
    PRINT(N'Drop constraints from [dbo].[Categories]')
    GO
    ALTER TABLE [dbo].[Categories] DROP CONSTRAINT [FK_Categories_Modules]
    PRINT(N'Add 14 rows to [dbo].[Categories]')
    GO
    SET IDENTITY_INSERT [dbo].[Categories] ON
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (1, 1, NULL, 'News', N'اخبار', 1, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (2, 2, NULL, 'Article', N'مقالات', 2, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (3, 3, NULL, 'Galleries', N'گالری', 3, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (4, 1, 1, 'Politics', N'سیاسی', 1, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (5, 1, 1, 'Economic', N'اقتصادی', 2, '', 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (6, 1, 4, 'NationalPilitics', N'سیاست داخلی', 1, '', 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (7, 1, 4, 'InternationalPolitics', N'سیاست خارجی', 2, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (8, 1, 7, 'Asia', N'آسیا', 1, '', 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (9, 1, 7, 'Europe', N'اروپا', 2, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (10, 1, 7, 'Africa', N'آفریقا', 3, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (11, 2, 2, 'Scientic', N'علمی', 1, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (12, 2, 2, 'Art', N'هنری', 2, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (13, 3, 3, 'Culture', N'فرهنگی', 1, NULL, 1)
    INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (14, 3, 3, 'Religion', N'مذهبی', 2, NULL, 1)
    SET IDENTITY_INSERT [dbo].[Categories] OFF
    PRINT(N'Add constraints to [dbo].[Categories]')
    GO
    ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [FK_Categories_Modules] FOREIGN KEY ([Module_ID]) REFERENCES [dbo].[Modules] ([Module_ID])
    COMMIT TRANSACTION
    GO
    Thanks for your help

  • Single Update query for multiple tables

    Hiii ....
    I want to update Table A and Table B in a single update query can it be possible.
    it is something like i have previously done with Mysql.
    e.g ..
    UPDATE A, B set a.A=1, b.B=X where (id.A= id.B) and id=101.
    Is it possible or how can i do it, help me out.

    sorry, i am posting the mysql example agin, it is something like this
    e.g ..
    UPDATE A, B set A.a=1, B.b=X where (A.id= B.id) and A.id=101

  • How to use one query against multiple table and recieve one report?

    I have duplicate tables, (except for their names of course) with commodities prices. They have the same column headings, but the data is different of course. I have a query that gives me a certain piece of information I am looking for but now I need to run this query against every table. I will do this every day as well, to see if the buying criteria is met. There are alot of tables though (256). Is there a way to say run query in all tables and return the results in one place? Thanks for your help.

    hey
    a. the all 256 tables whuld be one big partitoned table
    b. you can use all_tables in order to write a select that will write the report for you:
    SQL> set head off
    SQL> select 'select * from (' from dual
      2  union all
      3  select 'select count(*) from ' || table_name || ' union all ' from a
      4  where table_name like 'DB%' AND ROWNUM <= 3
      5  union all
      6  select ')' from dual;
    select * from (
    select count(*) from DBMS_LOCK_ALLOCATED union all
    select count(*) from DBMS_ALERT_INFO union all
    select count(*) from DBMS_UPG_LOG$ union all
    remove the last 'union all', and tun the generated quary -
    SQL> set head on
    SQL> select * from (
      2  select count(*) from DBMS_LOCK_ALLOCATED union all
      3  select count(*) from DBMS_ALERT_INFO union all
      4  select count(*) from DBMS_UPG_LOG$
      5  );
      COUNT(*)
             0
             0
             0
    Amiel

  • How to define a JPA "Entity" used to query multiple database tables

    While using JPA to access database, I have a need to define a generic "Entity" class to use for query different tables. The reason is I have a lot of non-business tables (reference tables) I need to query. I intend to use Native SQL to do the query. Most query will only return 1 - 3 columns. It is tedious to define many JPA entities only to use them sparsely.
    For example, if I have two Native query, and define a JavaBean that has 3 properties, how do I implement this in JPA?
    Thanks for your help.
    query 1:
    select LASTNAME as f1, AGE as f2 from PERSON
    query 2:
    select zipcode as f1 from LOCATION
    package model.uti;
    public class SimpleBean {
    private String f1;
    private String f2;
    private String f3;
    public SimpleBean() {
    public void setF1(String f1) {
    this.f1 = f1;
    public String getF1() {
    return f1;
    public void setF2(String f2) {
    this.f2 = f2;
    public String getF2() {
    return f2;
    public void setF3(String f3) {
    this.f3 = f3;
    public String getF3() {
    return f3;
    }

    An @Entity is mapped to a specific table. You can't fill it with totally random data from a collection of tables.
    If you want to access data from multiple tables within the one entity, then the JPA spec defines an annotation @SecondaryTable, which allows you to specify a
    second table and the join condition.
    http://java.sun.com/javaee/5/docs/api/javax/persistence/SecondaryTable.html
    The JPA spec talks about this as do most good EJB/JPA books.
    -steve-

  • How to use dynamic query for Result table

    Hello Experts,
    I want to use dynamic query and then display the result in the assignment block.
    Using dynamic query BTQAct and BTQRAct and base on some search criteria i want tofilter and then append the result in the result table of that custom context node, and then it should display the result in the view in UI.
    SO can you please provide me the samplle code on how to use the dynamic query and append in the result table.
    Regards.

    Hi,
    Please find below sample code:
    data:  query         TYPE REF TO cl_crm_bol_dquery_service,
               result        TYPE REF TO if_bol_bo_col.
    DATA: lt_params       TYPE crmt_name_value_pair_tab,        
               lwa_params      TYPE crmt_name_value_pair.             
    query = cl_crm_bol_dquery_service=>get_instance( 'BTQAct' ). " Get instance of dynamic query
    Set general query parameter for maximum number of hits
          lwa_params-name = 'MAX_HITS' .
          lwa_params-value = '50'.
          APPEND lwa_params TO lt_params.
          query->set_query_parameters( it_parameters = lt_params ).
          query->add_selection_param( iv_attr_name = 'OBJECT_ID'
                                                    iv_sign      = 'I'
                                                    iv_option    = 'EQ'
                                                    iv_low       = <lv_objectid>
                                                    iv_high      = '' ). " Set your search criteria. Repeat this code if you have multiple parameters
    "You can find possible search options for a query object in  GENIL_BOL_BROWSER
    result ?= query->get_query_result(  ).   " Get result from your search query
    me->typed_context-> <your result context node>->set_collection( result ). 
    Here you will have to create a context node in your view which would refer to query result object like for BTQAct its BTQRAct                      
    Hope this helps.
    e Regards,
    Bhushan

  • Is it worth using select query on infotype tables

    Hi Experts,
    I might be posting in the wrong column, but i just need to know is it worth using a select query on Infotype tables (PAxxxx)?? or should we prefer using the function modules for data fetching?
    If select is not suggested, what is the reason for that?
    Rgds
    Prateek

    Hi ,
    Its not said that u cant write select on PAXXXX tables . Yes of couse LDB are there to fetch the data but it depends on
    the requirement when to write a select and when to consider using in LDB .
    Generally when you are looking at say 8 to 10 tables of infotypes with free selection , then LDB is suggested to fetch the data .
    if you are looking to fetch the data for say some tables for a restricted selection (where clause) then select is used .
    If i want to write a program using select only then fetching data from infotypes tables for large no of records will lead to
    more time consumption which becomes easier in LDB as they are fetched in hierarchy level based on keys .
    Normally it will be a combination of LDB and select querys  in the development scenario
    Br,
    Vijay.

  • Update Query Joining Two Tables

    What is the sql for updating a table with another table's field value. I accomplished this using a subquery, but the query took forever to run. I was hoping there was a way to accomplish this inner join more efficiently.

    One way:
    UPDATE TABLEA A
    SET (COLUMNA, COLUMNB) = (SELECT COLUMNA, COLUMNB FROM TABLEB B WHERE (A.KEYCOLUMN1 = B.KEYCOLUMN1)
    WHERE EXISTS (SELECT 'X' FROM TABLEB B WHERE A.KEYCOLUMN1 = B.KEYCOLUMN1);
    1. The subquery should join on columns that are indexed. Use EXPLAIN PLAN to look at your query to determine if indexes are being used.
    2. The last WHERE clause ensures that you are only updating rows in TABLEA that have data in TABLEB. Without this clause COLUMNA and COLUMNB will be set to NULL if the subquery returns no rows; this will destroy any existing values in these columns.
    3. The "SELECT 'X'" in the last WHERE clause (rather than "SELECT (1)" or "SELECT *") tells Oracle that no data needs to be retrieved into buffers but that only the condition needs to be examined.
    Good luck!
    null

  • How to update/query informix table for every update/query on Oracle table

    We have a system that can talk to only Oracle.
    Here, we have a certain program that updates an Oracle table thru a View of the Table. For every database operation on Oracle table View, we want to update a corresponding table in Informix database.
    Similarly for every query on the View of oracle table we want to query informix database and fetch the records from there.
    We want to use Oracle as a medium to access Informix.
    Can some one help me on how to do this ?
    Thanks

    You can use the Transparent Gateway for Informix to access Informix from an Oracle environment. The gateway makes the Informix database look like a remote Oracle database.
    You can take a look at the gateways page on OTN for more information on this. http://otn.oracle.com/products/gateways/content.html
    Look at the Certification matrix to ensure that you are using a certified configuration.

  • Update Query for Object Table

    Hi All,
    I have table column defined as user defined data type. That User defined data type contains many columns.
    My requirement is i want to update one particular column of that User defined data type column.
    How should i update.
    Pls help me.
    I am using Oracle 10g.
    I have listed below one table and its associated columns.
    PERSON_ID VARCHAR2(20)
    PHIN_NO VARCHAR2(20)
    SSN_NO VARCHAR2(20)
    PERSON_NAME XPN
    That XPN data type consists of
    FAMILY_NAME FN
    GIVEN_NAME VARCHAR2(30)
    MIDDLE_NAME VARCHAR2(30)
    SUFFIX VARCHAR2(20)
    PREFIX VARCHAR2(20)
    DEGREE VARCHAR2(6)
    For example If i want to update prefix column value. how should i do?
    Cheers
    Moorthy.GS

    Hi,
    In My XPN Object type contains
    Structure:-(FAMILY_NAME(FN),GIVEN_NAME,MIDDLE_NAME,SUFFIX,PREFIX,
    DEGREE,NAME_TYPE_CODE,NAME_REPRESENTATION_CODE,
    NAME_VALIDITY_START_DATE,NAME_VALIDITY_END_DATE,
    NAME_ASSEMBLY_ORDER,EFFECT_DATE,EXPIRATION_DATE,
    PROFESSIONAL_SUFFIX,NAME_CONTEXT)
    Sample Values:- XPN(FN('BALU','','','',''), 'NAVEEN','G','', 'DOM000327','','','','12-JUL-06 11.57.57.854000 AM','12-JUL-06 11.57.57.854000 AM','','12-JUL-06 11.57.57.854000 AM', '12-JUL-06 11.57.57.854000 AM','','')
    I want to update the value for Prefix compent, then how should?
    Pls help me
    Cheers
    Moorthy.GS

  • Capturing data from query panel built used "ADF Query panel with table ?

    Hi All,
    I have a Search page built with a view Criteria.
    I enter the user_name in the query panel and hit Search and the result panel shows the results.
    Now If I gave a user_name which does not have any record in the VO, no data is displayed.
    At this point I want to capture the user_name from the query panel and on the click of a button ("Add" button I have created for Adding Records if not present) want to navigate to a different Add page .
    So how to capture the user_name from the query panel.
    Any pointers ??
    I am using Jdev 11.1.1.4.0
    Thanks
    Sumit Yadav

    Hi , I tried using the impll java file and i was able to get the handle to the bind params ..
    The sampl code is ..
    ViewObjectImpl userRespVO=this.getSystemAdministrationUserResponsibilitySearch1();
    SystemAdministrationUserResponsibilitySearchImpl provide =(SystemAdministrationUserResponsibilitySearchImpl)userRespVO;
    String userName1=provide.getbind_UserName();
    Thnanks
    Sumit Yadav
    Edited by: Sumit Yadav on Jul 7, 2011 9:17 AM

  • Problem in bulk update on partitioned table

    Hi,
    As per my old discussions on my huge table t_utr with 220 million rows,
    I'm running a bulk update statement on the table which may update 10 to 10 million rows in a single update statement.
    The problem is that when the statement has to update more number of rows, the update statement take more time.
    Here I want to know, when a update statement has to update more rows, will it impact the performance?
    Regards
    Deepak

    > I'm running a bulk update statement on the table
    which may update 10 to 10 million rows in a single
    update statement.
    Bulk updates does not make SQL statements execute any faster.
    > The problem is that when the statement has to update
    more number of rows, the update statement take more
    time.
    It is not a problem, but a fact.
    > Here I want to know, when a update statement has to
    update more rows, will it impact the performance?
    You have a car capable of traveling 120km/h. You drive from point A to point B. These are 10 km apart. It takes 5 minutes.
    Obviously when you travel from A to Z that are a 1000 km apart, it is going to take a lot longer than just 5 minutes.
    Will updating more rows impact performance? No. Because you cannot compare the time it takes to travel from point A to B with the time it takes to travel from point A to Z. It does not make sense wanting to compare the two. Or thinking that a 1000km journey will be as fast to travel than a 10km journey.
    Updating 10 rows cannot be compared to updating 10 million rows. Expecting a 10 million row update to be equivalent in "performance" to a 10 row update is ludicrous.
    The correct question to ask is how to optimise a 10 million row update. The optimisation methods for a large update is obviously very different than those of a small update. E.g. 5 I/Os per row updated is insignificant when updating 10 rows. But is very significant when updating 10 million rows.

  • Help needed with an update query

    Hi,
    I am trying to execute an update query on a table. Here is an example: I have 2 tables t1 and t2 and these tables have 2 similar columns, c11 and c12 in t1 and c21 and c22 in t2. I have to now execute an update statement for the column c11 in t1 with the values for c21 in t2 where the c12 in t1 is equal to c22 in t2. So, the query which I have formulated is:
    update t1 set c11 =
    (select t2.c21 from t1,t2 where t1.c11=t2.c22)
    where t1.c11 in (select t1.c11 from t1);
    But this query gives me an error: ORA-01427: single-row subquery returns more than one row.
    Where am i going wrong? Kindly help.

    Hi,
    CrazyAnie wrote:
    Hi,
    I am trying to execute an update query on a table. Here is an example: I have 2 tables t1 and t2 and these tables have 2 similar columns, c11 and c12 in t1 and c21 and c22 in t2. I have to now execute an update statement for the column c11 in t1 with the values for c21 in t2 where the c12 in t1 is equal to c22 in t2. So, the query which I have formulated is:
    update t1 set c11 =
    (select t2.c21 from t1,t2 where t1.c11=t2.c22)
    where t1.c11 in (select t1.c11 from t1);
    But this query gives me an error: ORA-01427: single-row subquery returns more than one row.
    Where am i going wrong? Kindly help.Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements for all tables) and the results you want from that data.
    In this case, where the problem involves changing t1, the INSERT statements should show reflect the state of the tables before the UPDATE, and the results are shat's in t1 after the UPDATE.
    Without that information, people can only guess at the solution.
    As the error message said, the problem is that the sub-query:
    (select t2.c21 from t1,t2 where t1.c11=t2.c22) is returning more than one row. Each row of t1 can only have one value for c11; which one is it supposed to be?
    It's unusual to have an UDPATE on a table be based on a join of that same table and another table. It's not necessarily wrong, but a more common UPDATE statement is:
    update  t1
    set      c11 = (     select      t2.c21
              from      t2
              where     t1.c12     = t2.c22
    where      t1.c12 in ( select  c22
                  from    t1
                );But again, I don't know where you're starting from (sample data), or where you want to go (results from that data), so it's hard to give you good directions.

Maybe you are looking for