How to perform update in pl/sql

hi buddies,
would like to know how can i perform an update statement as a part of my function.
i need to trim a column
and that has to be updated in the database.
pls advice.
thanks in advance

Hi Alagu,
Please understand that I know nothing of your code or application.
Therefore try to be as clear and detailed as possible.
From what I can make of your description:
1) you're storing emails and/or emailaddresses into the database?
( how are you accomplishing that at the moment?)
2) you want to trim the data
Trimming the data can be done in various ways.
F.i. using trim, but maybe a regular expression could come in handy as well...
Can you provide some sample code, some sample data and a create table description and your database version?
Because: without knowing at least the datatypes, the columns, how it works we can't say much useful.

Similar Messages

  • How to perform UPDATE/INSERT

    Hi,
    How can i perform update/insert we do in OWB, which insert records if they are not available in target and updates them if they already exists.
    I am now using IKM Oracle Incremental Update(MERGE)
    but i am getting some error while execute
    VSG

    Here is the error.
    com.sunopsis.core.SnpsInexistantObjectException: There is no connection for this logical schema/context pair:RDDM_LOGICAL / STGDW_LOGICAL
         at com.sunopsis.dwg.dbobj.SnpConnect.getSnpConnectByLSchemaNameAndContext(SnpConnect.java)
         at com.sunopsis.dwg.dbobj.SnpConnect.getSnpConnect(SnpConnect.java)
         at com.sunopsis.dwg.dbobj.SnpSession.getDwgConnectLst(SnpSession.java)
         at com.sunopsis.dwg.dbobj.SnpSession.getConLst(SnpSession.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • How to use update trigger in sql server 2008 with specific column

    Hello friends currently my trigger updates on table update, and I need to change this to only fire when specific column changes.
    /****** Object: Table [dbo].[User_Detail] ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[User_Detail](
    [sno] [int] IDENTITY(1,1) NOT NULL,
    [userid] [nvarchar](50) NULL,
    [name] [nvarchar](max) NULL,
    [jointype] [nvarchar](50) NULL,
    [joinside] [nvarchar](50) NULL,
    [lleg] [nvarchar](50) NULL,
    [rleg] [nvarchar](50) NULL,
    [ljoining] [int] NULL,
    [rjoining] [int] NULL,
    [pair] [int] NULL
    ) ON [PRIMARY]
    GO
    /****** Object: Table [dbo].[User_Detail] table data ******/
    SET IDENTITY_INSERT [dbo].[User_Detail] ON
    INSERT [dbo].[User_Detail] values (1, N'LDS', N'LDS Rajput', N'free', N'Left', N'jyoti123', N'SUNIL', 6, 4, 4)
    INSERT [dbo].[User_Detail] VALUES (2, N'jyoti123', N'jyoti rajput', N'free', N'Left', N'mhesh123', N'priya123', 3, 2, 2)
    SET IDENTITY_INSERT [dbo].[User_Detail] OFF
    /****** Object: Table [dbo].[User_Detail] trigger ******/
    CREATE TRIGGER triggAfterUpdate ON User_Detail
    FOR UPDATE
    AS
    declare @userid nvarchar(50);
    declare @pair varchar(100);
    select @userid=i.userid from inserted i;
    select @pair=i.pair from inserted i;
    SET NOCOUNT ON
    if update(pair)
    begin
    insert into Complete_Pairs(userid,pair)
    values(@userid,1);
    end
    GO
    /****** Object: Table [dbo].[Complete_Pairs] Script Date: 05/22/2014 21:20:35 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Complete_Pairs](
    [Sno] [int] IDENTITY(1,1) NOT NULL,
    [userid] [nvarchar](50) NULL,
    [pair] [int] NULL
    ) ON [PRIMARY]
    GO
    my query is TRIGGER triggAfterUpdate is fired only when pair column in User_Details table is update only and when we update other column like ljoin or rjoin then my trigger is not fired
    please any one can suggest us how it can done or provide solution
    Jitendra Kumar Sr. Software Developer at Ruvixo Technologies 7895253402

    >select @userid=i.userid
    frominserted i;
            select
    @pair=i.pair
    frominserted i;
    The code above assumes a single row UPDATE.
    You have to setup the trigger for set processing like when 100 rows are updated in a single statement.
    UPDATE trigger example: http://www.sqlusa.com/bestpractices2005/timestamptrigger/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to perform Update operation in Ios using Odata Services

    Hello,
          I want to do PUT(update) operation on odataservice... I am using followin code to get the proper Entry property to update
    SDMODataEntry * entry1=((SDMODataEntry *)[ArraySelectedCell objectAtIndex:0]);
        SDMODataPropertyValueObject* obj = ((SDMODataPropertyValueObject*)[entry1getPropertyValueByPath:@"rm_comment"]);
    But i am getting following error
    __NSDictionaryM getPropertyValueByPath:]: unrecognized selector sent to instance 0x10166620
    Please help...
    Regards,
    Ravindra

    Ravindra Dolas
    Can you please look at this thread SMP 3.0 - OData CRUD Help
    I hope you will get some inputs.
    Rgrds,
    Jitendra

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • How can we update data in LDAP server using PL/SQL.

    Hi,
    How can we update data in LDAP server using PL/SQL program.
    Is there any sample code for refrence.
    Thanks,
    Tarun

    Hi Justin,
    Thanks for your help. You got my correct requirements.
    Tim's example returning all the attributes of current user which is admin user. Please correct me if I am wrong.
    I have the following information:
    the admin user and password,server info , port and ldap_base for admin.
    I have uid and password for regular user, I am trying find the ldap_base for regular user, which may be different from adminuser.
    Please help me.
    Thanks,
    Edited by: james. on Jan 12, 2009 5:39 PM

  • How to avoid performance problems in PL/SQL?

    How to avoid performance problems in PL/SQL?
    As per my knowledge, below some points to avoid performance proble in PL/SQL.
    Is there other point to avoid performance problems?
    1. Use FORALL instead of FOR, and use BULK COLLECT to avoid looping many times.
    2. EXECUTE IMMEDIATE is faster than DBMS_SQL
    3. Use NOCOPY for OUT and IN OUT if the original value need not be retained. Overhead of keeping a copy of OUT is avoided.

    Susil Kumar Nagarajan wrote:
    1. Group no of functions or procedures into a PACKAGEPutting related functions and procedures into packages is useful from a code organization standpoint. It has nothing whatsoever to do with performance.
    2. Good to use collections in place of cursors that do DML operations on large set of recordsBut using SQL is more efficient than using PL/SQL with bulk collects.
    4. Optimize SQL statements if they need to
    -> Avoid using IN, NOT IN conditions or those cause full table scans in queriesThat is not true.
    -> See to queries they use Indexes properly , sometimes Leading index column is missed out that cause performance overheadAssuming "properly" implies that it is entirely possible that a table scan is more efficient than using an index.
    5. use Oracle HINTS if query can't be further tuned and hints can considerably help youHints should be used only as a last resort. It is almost certainly the case that if you can use a hint that forces a particular plan to improve performance that there is some problem in the underlying statistics that should be fixed in order to resolve issues with many queries rather than just the one you're looking at.
    Justin

  • How to create conditional update trigger in sql server

    How to create conditional update trigger in sql server

    You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
    Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
    CREATE TRIGGER Trg_TableName_Upd
    ON TableName
    FOR UPDATE
    AS
    BEGIN
    IF UPDATE(Col3) OR UPDATE (Col5)
    BEGIN
    ....your actual logic here
    END
    END
    UPDATE() function will check if column was involved in update operation and returns a boolean result
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to perform auto update in staging database using warehouse builder ?

    Hi ,
    here our client requirement is?
    our client want to transfer data from their production database to staging database using warehouse builder.and also what ever the update occur in production database
    that must be reflected in staging database.
    here we are transfering data from product-db to staging using etl(maping--insert/update operator )
    it is transfering fine.but it is not automaticaly updating in staging db with new update in production database?
    can any body give me the details how to achive it.
    Thanks & regards,
    k azamtulla khan.

    Hi,
    firstly there are two threads for the same issue from youself(excluding this one) which is a waste of others time so kindly refrain from doing so and use one thread.
    OWB: how can automatic updation  perform in staging database using OWB
    OWB: how to use insert/update table operator for target table
    secondly, with regards to the options , here are some options:
    1. Use trigger for update.
    2. Use materialized view(refresh on commit)
    3. Use oracle advance queing mechanism (OAQ) for queing the recent inserted/updated records.
    Kindly close other threads and maintain just one thread.
    Regards
    Message was edited by: Rado
    user647181

  • How to Update this T-SQL Table?

    Hello,
    I am having trouble finding the correct syntax for updating this T-SQL table.
    Here is my Query which is adding an additional ' at the beginning and end.
    Query:
        Update [denodo].[dbo].[wrappers]
      SET wrapperWhereClause = '''AND County_Input=''Cheyenne & Arapaho Tribal Court'' AND WrapperID=729'''
      WHERE wrapperID = '729'
    The Outcome:
    'AND County_Input='Cheyenne & Arapaho Tribal Court' AND WrapperID=729'
    The Outcome I am hoping for:
    AND County_Input='Cheyenne & Arapaho Tribal Court' AND WrapperID=729
    Can anyone help me edit this so I can receive the outcome I am hoping for?

    >> Please learn
    I am having trouble finding the correct syntax for updating this T-SQL table. Here is my Query [sic] which is adding an additional ' at the beginning and end. <<
    Please learn basic terms so
    we can communicate. UPDATE is a statement and not a query. You do not know ISO-11179 rules, etc.
    Why are you building statements in SQL? You are doing bad SQL programming
    and need to stop. Your silly meta-data “wrapper_where_clause” and “county_input” is so fundamentally wrong I would fire you. Look at what I have done
    with SQL and see what a criticism that is!
    UPDATE Wrappers
    SET ??
    WHERE county_something =
    'Cheyenne & Arapaho Tribal Court'
    AND wrapper_id = '729';
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to get updated by count value in database ?

    hi all,
    I created jsp page iin which insert,update,delete , query and queryall Functionalities are working...
    I need following,
    whenever i update a record i should get updated by, updated time and updated count.. to be stored in database...
    i achieved to store updated by and updated time...
    please help me how to get updated count:
    when ever a record is updated for first time updated count=1,
    for second time it should be 2 for third time it should be 3 and so onnnn
    please help me how to write this kind of function and kind of code help will be appriciated....

    if you want "number of updates" performed on each row to be persistive, you should have designed the schema with an extra field which keeps number of updates performed.
    to generic solution sql statement should have been written like
    INSERT INTO table (a,b,c,update_count) VALUES (1,2,3,4)
      ON DUPLICATE KEY UPDATE update_count=update_count+1;in this case even a insert statement will work, you wouldn't had to write another update statement.
    or if u want to use update statement only
    have an extra column "update_count" do "update_count=update_count+1" on each update statement, set initial default value to 0;
    and if u want to know how many rows have been updated
    as BalusC wrote
    BalusC wrote:
    PreparedStatement#executeUpdate() returns an int which represents the amount of affected rows.

  • How can I update the area automatically?

    Hi,
    I've a view LOG_AREA:
    CODE......NAME......ID........AREA
    001.......Tom.......1.........200
    001.......Tom.......2.........300
    124.......John......5.........1000
    124.......Tom.......2.........2000
    124.......Sam.......3.........300
    004.......Sam.......5.........600
    The area of view LOG_AREA change every day.
    for example if this view the day after has this values:
    CODE......NAME......ID........AREA
    001.......Tom.......1.........300
    001.......Tom.......2.........800
    124.......John......5.........300
    124.......Tom.......2.........2000
    124.......Sam.......3.........300
    004.......Sam.......5.........800
    I'd like to get a table "AUDIT_AREA" which does the difference between the current area and the previous area:
    CODE......NAME......ID........AREA_OLD...AREA_NEW....DIFF
    001.......Tom.......1.........200..........300......100
    001.......Tom.......2.........300..........800......500
    124.......John......5.........1000.........300......-700
    124.......Tom.......2.........2000.........2000.....0
    124.......Sam.......3.........300..........300......0
    004.......Sam.......5.........600..........800......200
    How can I create a statement sql (or procedure) that does this update of area?
    Thanks
    Raf

    Some people might quibble about your data structure. The DIFF column is obviously unnecessary. Storing both the old and new values for AREA is also questionable, although the performance benefits probably outweigh the sins of de-normalisation. Anyway, you need to do something like this.
    CREATE OR REPLACE TRIGGER log_area_bur BEFORE UPDATE OF log_area FOR EACH ROW
    BEGIN
       INSERT INTO audit_area (code, name, id, area_old, area_new, diff)
       VALUES
       (:NEW.code, :NEW.name, :NEW.id, :OLD.area, :NEW.area, (:OLD.area-:NEW.area);
    END;
    /Cheers, APC

  • How do i update my ios on iphone 4

    how do i update my ios on iphone 4 if it doesnt come up in the general settings menu?

    If your iDevice is using a version of iOS lower than 5, you will need to use iTunes on your syncing computer to perform the upgrade. Use the Apple link below as a guide for the upgrade.
    http://support.apple.com/kb/HT4972
    Also read the instructions from the section entitled "Update your device using iTunes" at the link below.
    http://support.apple.com/kb/HT4623
    Information regarding transferring purchases from your iDevice to iTunes on your syncing computer can be found at the link below.
    http://support.apple.com/kb/ht1848

  • How to Perform a "Clean Install" - Offline installer link not working...

    The thread containing - "How to Perform a Clean Install of Flash Player in Mac OS X" -  was an answer given by Mike M. several times in this forum. I attempted to access the "offline installer" link that was offered, but it does not seem to be working. Does anyone have an updated link to a functional offline installer that I can use to finally download Flash Player for Mac OS X v. 10.9.5?
    I receive an error message stating "Error: Unable to proceed with the installation."
    Many of the photography and game websites I use (almost all, actually) FP, and I would really love to get back to my daily routine soon!
    Best Regards,
    Mel R.

    Hi Mel,
    The correct link is posted at the bottom of the Installation problems | Flash Player | Mac page, in the 'Still having problems section'. The download links recently changed and it appears the FAQ was not updated.  I have updated the with the help page URL as it's less likely that this link will change, and if it does, a re-direct to the new location would be implemented.
    Maria

  • Software update does not work when I try to update from OSX 10.6.8 to OSX 10.7.  How do I update?

    How do you update from OSX 10.6.8 to OSX 10.7?  Software update app does not perform update.

    That's because 10.7 is not an update, it is an upgrade that you have to buy by using the App Store app, not by using the Software Update.
    It costs $19.95: http://store.apple.com/us/product/D6106Z/A/os-x-lion

Maybe you are looking for

  • I want no movement on stills in imovie 9

    Sorry if this is blindingly simple, I want to make a movie mainly of stills. When I import them from iphoto the stills play with an automatic pan and tilt movement. I'd like to have no automatic movement, adding my own when necessary. Can anyone help

  • Replication of Project Server 2010 databases from Production to Development

    HI We have One Production, One Development and One QA server but the Production data is not matching with the Dev and QA. Now our client is asking is there any possibility that we can copy the production data bases and replicate in the Dev and QA. Is

  • Error 'Processeur ABAP : TSV_TNEW_PAGE_ALLOC_FAILED'

    Hi all, I have developed a custom program (Z-program) for a interface and its working fine in the development server.But in the testing server its running for more than '34 HRS' then interrupted giving a dump stating that  ' Processeur ABAP : TSV_TNE

  • Blocked G/L Account

    Hi All, When I am trying to create an excise invoice I am getting the below error: Account 424004 is temporarily blocked in Co. code. I tried to unblock the account in FS00 by clicking on the block button but could not do it. Please let me know how i

  • How to print pages with specific content

    I have a PDF fie of about 500 pages which contains the pay slip of staff of the entire establishment. I wish to print only the pages that are for the staff in my department who are 70 in number. Each page contains a staff ID number at the top. I have