Oracle 10g Update logic.

Hi Guys, I have a table table_ref with Ref column 400 charaters long. I have a request to update this column, basically change one thing in the column. The column has value *'ELBOW, 90-DEGREE, LONG RADIUS;_; ASME B16.9; BEVELED END; SCHEDULE 10S; STAINLESS STEEL, ASTM A403 GR WP3046WX/WP304LWX (DL-STPD) IMPACT TSD, CRYO SERV'*
The requirement is to update this table and remove the *6* from WP3046WX to make it read WP304WX
Update table_ref
Set ref = 'ELBOW, 90-DEGREE, LONG RADIUS;_; ASME B16.9; BEVELED END; SCHEDULE 10S; STAINLESS STEEL, ASTM A403 GR WP304WX/WP304LWX (DL-STPD) IMPACT TSD, CRYO SERV'
where 1= 1.
Please note that the 6 has been removed, but I am not clear on how to do this. I know am going to be using substr, instr etc, but I cannot wrap my head around it.
Thank You

Hi,
You could do that using SUBSTR and INSTR, but, as you discovered, it isn't easy.
Here's a much better way:
UPDATE  table_ref
SET     ref     = REPLACE ( ref
                   , 'WP3046WX'
                 , 'WP304WX'
WHERE   ref     LIKE '%WP3046WX%
;REPLACE (str, x, y)       returns a copy of str, but with all occurences of the sub-sting x changed to y. You don't need to know exactly where x occurs, or how many times.

Similar Messages

  • Oracle 10g update from 10.2.0.1 to 10.2.0.4

    Hi all,
    I like to update oracle 10g database from 10.2.0.1 to 10.2.0.4 by applying patch sets, would one please suggest me the best way.
    I am planning to do in the way explained below
    method:
    # Install new Oracle Home
    # Apply the patch to the new Home
    # Shut down the database
    # Change Oracle Home to the new location
    # Start the database
    Can you one suggest me how to do "Change Oracle Home of database to the new location" and back to older oracle_home incase if there are any issues, how to do and what changes requried to make database is run without any probs..
    Thanks in advance..

    If you do it the best way is to read and follow the docs ... not ask strangers if they agree with a small number of bullet points.
    But I disagree with your entire direction. 10gR2 goes into desupport mode at the end of this month. Why move to something that will be desupported before you get there? Why not 11.1.0.7 or 11.2.0.1?
    If you must stay with 10g for awhile at least go to 10.2.0.5.

  • Oracle 10g update question

    Hello,
    I have a production database server with oracle 10.2.0.1 and 3 instances running on it. I want to update it to 10.2.0.3. What are the steps involved? Do i need to update all instances at once?

    What are the steps involved? Follow instructions that come with the patch set.
    Do i need to update all instances at once?Since you will be updating the shared directory, the answer is YES.

  • Blank space updatation to Collection field in Oracle 10g

    Hi,
    we have the Oracle 9i database in the dev environment and Oracle 10g in Production environment.
    In Oracle 9i, the below scenario works find, but in Oracle 10g it won'nt, The scenerio is ,
    Update table1
    set test_collection = ' '; -- works fine in Oracle 9i , but it wont works in Oracle 10g,
    Update tabel1
    set test_collection = null; -- works in both the versions.
    Please suggest,.
    raja k

    What is myv, is that the collection name ?? See post number 5 of this thread where I declared it.
    >
    In Oracle 9i, we need not to specify the collection
    name while updating the collection type field in the
    table. 9.2.0.6 was notoriously buggy and wasn't considered stable till 9.2.0.7 if I recall correctly. And now (thankfully) it's unsupported.
    The sql code was written in concern to Oracle 9i, now
    while migrating to Oracle 10g, we are getting the
    problem with this. The problem is , i don'nt have the
    access to Production environment, which is migrated
    to Oracle 10g, we develop the code on Oracle 9i, and
    will release to deploy on Oracle 10g. Develop in 9i and deploy to 10g! Do you really think that's a good setup? How about upgrading your development environment to match production.
    update table1 set test_collection = null; - this
    works fine in Oracle 9i ,
    update table1 set test_collection = ''; - this works
    fine in Oracle 9i ,
    but in Oracle 10g ,
    update table1 set test_collection = null; - this
    works fine in Oracle 10g ,
    update table1 set test_collection = ''; - this won'nt
    works in Oracle 10g , Yes, I already understand what your issue is.
    as you suggested, do we need to specify the
    collection name while updating the collection type
    field. in Oracle 10g, In Oracle 9i , it won'nt
    required ?? Yes, this would be the correct way to do it.
    Karthick,
    because null is not same as ''
    SQL> select * from dual where ''=null
    2 /
    no rows selectedErrrm, yes it is actually...
    SQL> select 1 from dual where '' is null;
    1
    1
    SQL>
    ... if you use the correct condition for checking nulls.

  • Create an Object in Logical standby database in Oracle 10G

    Hi,
    I have logical standby database in oracle 10g R2 for reporting purpose.Now i want to create procedure in logical standby which is use to create new temp table in logical standby and contained data generated from select operation on existing table.
    Can i create a new user in logical standby database,add new tablespace in logical standby which can insert,update and delete data in standby database base table?
    kindly provide me the steps to implement all this.What will be effect if i set guard_Status in v$database is NONE in logical standby?
    Thanks,
    Shital Patel

    Hi Shital,
    Guard_status protects the data from being changed.
    ALL- By default it is not possible for a non-privileged user to modify data on a data guard SQL apply database. This is because the database guard is automatically set to ALL.
    With this level of security, only SYS user can modify the data.
    STANDBY- When you set this level of security, users are able to modify data that is not maintained by the Logical apply engine.
    NONE permits any users to access the standby database as long as they have correct privileges. This is the normal security for all data in the database.
    You can change the guard status value from ALL to NONE in order to allow non-privileged users to modify data and Yes you can create user and extra tablespace in logical standby database..this is what the one of advantage of using Logical standby database.
    SQL> ALTER DATABASE GUARD NONE;
    Thanks

  • Oracle 10g RAC install on OEL5 update 5 OUI failing to write on tmp fs

    Dear Friends,
    I am attempting to install Oracle 10g R2 on Oracle Enterprise Linux 5 update 5 but facing some errors. Can't believe i have done everything right as far as oracle docs n my understanding concern. when i try to invoke runInstaller for CRS it fails with following error:
    [oracle@server01 clusterware]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-11-15_04-36-47PM. Please wait ...[../stage/Components/oracle.swd.oui.core/10.2.0.1.0/1/DataFiles/filegroup1.jar]
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    note: ../stage/Components/oracle.swd.oui.core/10.2.0.1.0/1/DataFiles/filegroup1.jar may be a plain executable, not an archive
    Error in writing to directory /tmp/OraInstall2010-11-15_04-36-47PM. Please ensure that this directory is writable and has atleast 60 MB of disk space. Installation cannot continue.
    : Success
    [oracle@serverr01 clusterware]$
    I am also attaching the cluster verfication result, if you wish to have a look at this.
    Please let me know if you see any pointers.
    Many Thanks

    hi
    did you extract the zip file without any errors and with oracle user?
    is the /tmp full? post "df -h"
    you can manually set another temp directory using "export TMPDIR=/any/path"
    hth

  • Updating data in oracle 10g

    hello everyone,
    Is there anyone who can explain to me, how to import only recently datas from other database to mine oracle 10g database.
    I wanto update only the newest datas to my database.
    Best regards
    Tony

    userThony wrote:
    Hi,
    I have oracle 10g database installed in 2 servers machines. One has the backup datas from other.
    I would like to import the latest datas from one to other database.
    I don't want to import all the entire database, only the information from 2 weeks ago.
    Best regardsWell, as alluded to earlier, first you have to be able to identify that data. There is nothing inherent in Oracle to do so. At least not after the fact. Is there any column in the table(s) that could be used to identify the data you need? If one database is a backup of the other, why would you NOT want to back up the entire 'source' database? A little more information about the business problem you are trying to solve might lead to some creative solutions.

  • Oel updates and oracle 10g

    Hi
    Can i get updates for oel4/5 ?(using for testing at home)
    can i install oracle 10g oel 5 ?
    thanks

    The ability to get updates for OEL 4 or 5 is a paid service, for which you need to have a subscription to oracle's repository. So, assuming you don't want to explicitly buy a subscription, you can only download the latest version of both OEL 4 and 5, and use it.
    The oracle 10g database (that's also a assumption, that you mean the database with 'oracle 10g') can be installed on OEL5, but because the 10.2.0.1 version was released before OEL5 (actually RHEL5) existed, the installer does not see the linux version as a valid one. This can be bypassed using two popular methods: use the -ignoresysprereqs commandline option with runInstaller, or by copying over the contents of /etc/redhat-release. Also, you need to extra packages (libXp and compat-libstdc++-33). But I assume there are a lot of installation examples to be found on the internet.

  • Oracle 10G AS, Batch Update doesn't commit.

    Hello,
    We are using Batch uptdate to commit a set of records, but to our surprise one of the batches commits in DB and the other doesnt.
    The below pseudo code explains our scenario :
    String str1="INSERT INTO TBL1 (COL1,COL2) VALUES (?,?) ";
    String str2="UPDATE TBL2 SET COL1=? WHERE COL2=?";
    PreparedStatement pstmt1=conn.prepareStatement(str1);
    PreparedStatement pstmt2=conn.prepareStatement(str2);
    for(500 recs)
    pstmt1.addbatch();
    pstmt2.addbatch();
    On 500 Recs
    //This batch updates the DB and commits too
    pstmt1.executeBatch();
    pstmt1.clearBatch();
    con.commit();
    //The Batch executes successfully, but updates are not reflected in DB,
    //which may mean that it must not be committing in DB
    pstmt2.executeBatch();
    pstmt2.clearBatch();
    con.commit();
    - In the above, pstmt1 is an INSERT and pstmt2 is an UPDATE.
    - It so happens that at the end, DB reflects Inserts done by pstmt1, but it doesnt reflect the Updates of pstmt2.
    - We have also fired a SELECT stmt immediately after pstmt2 Execute Batch, but the updated values are not reflected.
    - Also the above scenario works absolutely fine if we use a STATEMENT instead of a PREPAREDSTATEMENT for pstmt2.
    Set up Details:
    App Server :: Oracle 10G AS for Linux 2.1,
    Database Driver :: Oracle 10G Driver which is bundled with Oracle 10G AS
    Database :: Oracle 9i
    Any ideas in this regards would be highly appreciated.
    Thanks !
    - Khyati
    Message was edited by:
    user473157

    I think this is not the right forum for this question; probably a JDBC forum or one of the Oracle AS forums.
    Kuassi

  • Oracle 10g Logical Standby

    The question is on Oracle 10g Logical Standby Data Guard. Below is the short description of what we wanted to do.
    We currently run our Remedy application on Oracle10g. We wanted to setup Data Guard (logical standby) so we can perform our application upgrade on the logical standby. While we upgrade our application, our customers perform the dml on the primary instance.
    During the upgrade, we will change the ddl on our application in the logical standby instance. After the application upgrade, we do a role switch between the two instances (primary became a new logical standby and logical standby became new primary). Now, we wanted the data or the dml that our customers perform on the old primary replicate over to the new primary.
    It is possible for the logical standby to perform the ddl at the same time user perform the ddl and dml on the primary instance?
    After role switch between the two instances, is the data changed on the primary replicate over to the new primary?
    Thank you for your helps.
    Loc Nguyen
    [email protected]

    Hi Shital,
    Guard_status protects the data from being changed.
    ALL- By default it is not possible for a non-privileged user to modify data on a data guard SQL apply database. This is because the database guard is automatically set to ALL.
    With this level of security, only SYS user can modify the data.
    STANDBY- When you set this level of security, users are able to modify data that is not maintained by the Logical apply engine.
    NONE permits any users to access the standby database as long as they have correct privileges. This is the normal security for all data in the database.
    You can change the guard status value from ALL to NONE in order to allow non-privileged users to modify data and Yes you can create user and extra tablespace in logical standby database..this is what the one of advantage of using Logical standby database.
    SQL> ALTER DATABASE GUARD NONE;
    Thanks

  • Simple insert, delete and update not working after oracle 10g installation

    Hello,
    I made a new installation of Oracle 10g (10.2.0.1.0) and created a schema . Now i try to insert or update data using simple queries, but unfortunately nothing happens. I tried inserting or updating data even via sqlplus, but unfortunately the same result. Query takes infinite time to end, so i had to manually end it every time... No errors... No warnings... but takes long time... I have given all the required permissions to the schema but the same result. Can somebody help me figure out the problem?
    Tried creating a new table and the insert and delete are working fine... think the problem is with this table... Imported the rows of the table from another online database. I dont understand how this might be a problem.
    Edited by: user13333704 on Mar 15, 2011 1:26 AM

    However how do you generate awr reports and how to find the session wait?TO generate the AWR report
    sql> ?/rdbms/admin/awrrpt
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#BABDHAGF
    The event column in v$session , in v$active_session_wait will show you the session wait event.What the session was actually waiting for.
    HTH
    Anand

  • Critical patch update for Oracle 10g As 10.1.0.3

    Hi,
    I am facing some security vulnerabilities regarding apache in Oracle 10g applcation server.
    could you please suggest critical patch update for this version.
    Thanks in advance.
    Regards,
    Sathya

    Hi,
    Check below security update from oracle. Check your product in list.
    http://www.oracle.com/technetwork/topics/security/alerts-086861.html
    Thanks,
    JD

  • Oracle cache - 10g updating...

    Hi all,
    I have setup a cache using TimesTen in front of an Oracle 10g instance.
    I am caching a number of tables where I would like to allow updates/inserts within TimesTen to be propogated back to 10g.
    The reason being I would only like to hold a subset of the cached table in TimesTen (and keep on pruning it on a daily basis by date for instance - due to memory constraints) I of course dont want these deletes to be pushed to the cache but I do want the updates and inserts to be pushed.
    Is there a way of doing this?
    Thanks,
    Dan

    Yes, there are several ways to do this.
    1. If you are using TimesTen 7.0 or later then you could configure automatic aging (timestamp or LRU based). See the SQL Guide for details. When aging removes a row in TimesTen the 'delete' is not propagated to Oracle.
    2. If you are using AWT or SWT cache groups, you or the application (or a cron script etc.) can execute UNLOAD CACHE GROUP cgname WHERE ...; Any rows matching the WHERE clause will be removed from TimesTen but again the 'deletes' will not be propagated to Oracle. Contracts this with doing DELETE FROm cgtable WHERE ...; in which case the deletes are propagated to Oracle.
    3. If you have a USERMANAGED cache group and are doing manual propagation to Oracle using FLUSH CACHE GROUP then this anyway does not propagate deletes.
    Chris

  • Laptop supporting Oracle 10g on RHEL 4 Update 2

    Hi,
    I am struggling to find a laptop supporting Oracle 10g on RHEL4 update 2. Though the Redhat HCL shows some laptops... those are all outdated.
    Now, I do find laptops supporting RHEL 5 workstation version. Is Oracle 10g supported on such desktop version ? Kindly help me find a Laptop for personal purpose.
    I am fine to have it Dual boot with Windows Vista / XP but equally want to ensure that it supports the OS as well. Please help me find one such personal Laptop !!!
    [ PS:  Looking for alternative solution other than VMWARE on windows]

    Hi
    This message should be in the linux section. Linux format wrote a quite good article on the issue 105 http://www.linuxformat.co.uk/modules.php?op=modload&name=NewArchives&issue=105
    You should may be go for a Thinkpad (http://www.thinkwiki.org/wiki/ThinkWiki) / (http://www.linux-laptop.net/ibm.html)
    or a DELL http://www.dell.com/content/topics/global.aspx/alliances/en/linux?c=us&cs=555&l=en&s=biz
    Personally I'm using both a Thinkpad with RedHat 5.2 and an Acer aspire on which linux works very well.
    Hope this help otherwise ask more

  • What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?

    Hi
    What mechanism Oracle 10g use for write (Insert/ Update) and Read (Select)?
    Thank you

    Aren't the answers given in PL/SQL forum sufficient enough?Well, as the first answer in that forum directed the OP to this forum you can hardly blame them for the repost.
    There is some high-level stuff in the Concepts Guide. If that is insufficient the OP will need to tell us what more details they need to know (and perhaps why).
    Cheers, APC

Maybe you are looking for

  • My mac won't download photos from my iPhone to iPhoto.

    It stopped a couple months ago. When iPhoto starts up it says "The iPhoto Library is locked, on a locked disk, or you do not have permission to make changes to it." I hit the "repair" button, which lets me use iphoto, but then when I connect my iphon

  • Feature Requests - Adobe Reader for Android

    Adobe Reader for Android is a good start, it renders well (and renders 2 pages at a time), and the UI is nice, but there are some missing features. Please can we have the following features added in the next update; # Bookmark support, including the

  • SharePoint InfoPath error SSL/TLS extern list

    Hello ! I want to modify my Element display on my extern List (BDC SQL Server) with infopath but in SharePoint Designer when I click on edit the form with InfoPath I have this error message : "Could not establish trust relationship for the SSL/TLS (s

  • DOS command from a WebDynpro

    hi, How can i call a DOS command from a WebDynpro Application. I tried this piece of code but it does not work. Runtime.getRuntime().exec("cmd/c help"); Can somebody guide me with the same. Thanks,

  • SCSM Runbook Automation Activity - Number of Parameter Mappings

    Dear Supporters, Can you please help me with the following problem: I am automating the creation of new users over the SCSM Self Service Portal with the help of an Orchestrator runbook. I am configuring the Runbook Automation Activity in Service Mana