DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Help with Pl/SQL

  1. #1
    Join Date
    Nov 1999
    Posts
    226
    Hi

    I have a table with 3 columns .

    name, type and IP

    Is there a way , I can update Name = ' Name' (witha leading space where type =PRINTER.

    Regards


  2. #2
    Join Date
    May 2002
    Posts
    2,645
    How many places are you going to post this question?

  3. #3
    Join Date
    Nov 1999
    Posts
    226
    No more !!

    Thanks

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    That's okay - I was getting ready to give you five different answers - one for each forum!

  5. #5
    Join Date
    Nov 1999
    Posts
    226

    Why don't you send me one

    Just for your ref

    I have 368 rows with Printers in them .

    Regards


  6. #6
    Join Date
    May 2002
    Posts
    2,645
    Alrighty then.

    Here is one way: use SQL to write SQL for you and spool the output to a file.

    select 'update table_name set name = '||chr(39)||chr(32)||name||chr(39)||'
    where name = '||chr(39)||name||chr(39)||' and
    type = '||chr(39)||'PRINTER'||chr(39)||';' from table_name;

    This generates

    update table_name set name = ' ATKINS'
    where name = 'ATKINS' and
    type = 'PRINTER';

    How does that work for you?

  7. #7
    Join Date
    Jul 2002
    Posts
    4

    Talking

    Sorry to say that...But your quastion is so funy for a site called (DBA SUPPORT)...I Think you are not even related to ORACLE software...dont get offended PLZ..
    Being slave fighting for freedom better than being free acting like slaves
    Ghandi

  8. #8
    Join Date
    May 2002
    Posts
    2,645
    Thank you for your contribution, dba_junior. You were more than helpful. I can only hope that my suggestion is up to the lowest standard you have for development.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width