<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Oracle 8i Question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939273#M797499</link>
    <description>hi scott!&lt;BR /&gt;&lt;BR /&gt;You cannot rename a column in Oracle 8i.&lt;BR /&gt;&lt;BR /&gt;In Oracle8i, you can drop a column from a table but not rename.&lt;BR /&gt;&lt;BR /&gt;The way to do it is to use a view.  You can minimize the impact on applications by doing simply:&lt;BR /&gt;&lt;BR /&gt;rename TableName to TableName_TBL;&lt;BR /&gt;create view TableName &lt;BR /&gt;as &lt;BR /&gt;select c1 New_Name_For_C1, c2, c3, .... cn from TableName_Tbl;&lt;BR /&gt;&lt;BR /&gt;After that you must grant on the view the same privileges that you had normally granted on the table.&lt;BR /&gt;&lt;BR /&gt;This way, all existing applications will see the new column name with the old table name.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Nov 2005 23:20:59 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2005-11-08T23:20:59Z</dc:date>
    <item>
      <title>Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939267#M797493</link>
      <description>Yes, we are still in the dark ages!  I can't find an answer in Metalink so I thought I'd try someone that really knows; all of you!&lt;BR /&gt;&lt;BR /&gt;We have a column in a table called "comment".  It's been there forever but now it has been requested to get changed since it is a reserved word.  It seems simple enough to add the new column name, update it's contents with the existing data and then dropping the old name.  However, the update fails becuse of the reserved word usage:&lt;BR /&gt;&lt;BR /&gt;update tablename set new_commnet = comment;&lt;BR /&gt;&lt;BR /&gt;ERROR at line 1:&lt;BR /&gt;ORA-00936: missing expression&lt;BR /&gt;&lt;BR /&gt;update tablename set new_commnet = "comment"&lt;BR /&gt;&lt;BR /&gt;ERROR at line 1:&lt;BR /&gt;ORA-00904: invalid column name&lt;BR /&gt;&lt;BR /&gt;Is there another way around this?  There is "comment" data in some of these rows so "create table tablename as" won't work either.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Nov 2005 15:03:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939267#M797493</guid>
      <dc:creator>Scott Buckingham</dc:creator>
      <dc:date>2005-11-08T15:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939268#M797494</link>
      <description>Maybe export/import is the general course of action here.&lt;BR /&gt;&lt;BR /&gt;If I remember I'll ask my oracle guy to read ths.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 08 Nov 2005 15:20:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939268#M797494</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-11-08T15:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939269#M797495</link>
      <description>That is one thing Metalink did point out is that export/import can't handle this either so I didn't even try.</description>
      <pubDate>Tue, 08 Nov 2005 15:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939269#M797495</guid>
      <dc:creator>Scott Buckingham</dc:creator>
      <dc:date>2005-11-08T15:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939270#M797496</link>
      <description>How about...&lt;BR /&gt;&lt;BR /&gt;update tablename t1&lt;BR /&gt;   set new_commnet = (select comment from tablename t2 where t1.p_key = t2.p_key);</description>
      <pubDate>Tue, 08 Nov 2005 15:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939270#M797496</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-08T15:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939271#M797497</link>
      <description>No, that's not it either.  I get the same errors that I reported earlier.</description>
      <pubDate>Tue, 08 Nov 2005 15:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939271#M797497</guid>
      <dc:creator>Scott Buckingham</dc:creator>
      <dc:date>2005-11-08T15:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939272#M797498</link>
      <description>Call off the search as I found the problem!  I had to keep in mind that when using double-quotes to identify the reserved word that the object name is case-sensitive.  Therefore, I needed to uppercase COMMENT.&lt;BR /&gt;&lt;BR /&gt;Thank you for you help!</description>
      <pubDate>Tue, 08 Nov 2005 16:19:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939272#M797498</guid>
      <dc:creator>Scott Buckingham</dc:creator>
      <dc:date>2005-11-08T16:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939273#M797499</link>
      <description>hi scott!&lt;BR /&gt;&lt;BR /&gt;You cannot rename a column in Oracle 8i.&lt;BR /&gt;&lt;BR /&gt;In Oracle8i, you can drop a column from a table but not rename.&lt;BR /&gt;&lt;BR /&gt;The way to do it is to use a view.  You can minimize the impact on applications by doing simply:&lt;BR /&gt;&lt;BR /&gt;rename TableName to TableName_TBL;&lt;BR /&gt;create view TableName &lt;BR /&gt;as &lt;BR /&gt;select c1 New_Name_For_C1, c2, c3, .... cn from TableName_Tbl;&lt;BR /&gt;&lt;BR /&gt;After that you must grant on the view the same privileges that you had normally granted on the table.&lt;BR /&gt;&lt;BR /&gt;This way, all existing applications will see the new column name with the old table name.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Nov 2005 23:20:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939273#M797499</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-11-08T23:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939274#M797500</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;i tried same as you above and it worked!&lt;BR /&gt;&lt;BR /&gt;please check.&lt;BR /&gt;&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; create table t1 (id number(1), "COMMENT" varchar2(100));&lt;BR /&gt;&lt;BR /&gt;Table created.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:00.02&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; desc t1&lt;BR /&gt; Name&lt;BR /&gt;   Null?    Type&lt;BR /&gt; -------------------------------------------------------------------------------&lt;BR /&gt; ID&lt;BR /&gt;    NUMBER(1)&lt;BR /&gt; COMMENT&lt;BR /&gt;    VARCHAR2(100)&lt;BR /&gt;&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; alter table t1 add new_commnet varchar2(100);&lt;BR /&gt;&lt;BR /&gt;Table altered.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:00.08&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; update t1 set new_commnet=t1."COMMENT";&lt;BR /&gt;&lt;BR /&gt;0 rows updated.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:02.53&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; desc t1&lt;BR /&gt; Name&lt;BR /&gt;   Null?    Type&lt;BR /&gt; -------------------------------------------------------------------------------&lt;BR /&gt; ID&lt;BR /&gt;    NUMBER(1)&lt;BR /&gt; COMMENT&lt;BR /&gt;    VARCHAR2(100)&lt;BR /&gt; NEW_COMMNET&lt;BR /&gt;    VARCHAR2(100)&lt;BR /&gt;&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; alter table t1 drop column "COMMENT";&lt;BR /&gt;&lt;BR /&gt;Table altered.&lt;BR /&gt;&lt;BR /&gt;Elapsed: 00:00:00.53&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt; desc t1&lt;BR /&gt; Name&lt;BR /&gt;   Null?    Type&lt;BR /&gt; -------------------------------------------------------------------------------&lt;BR /&gt; ID&lt;BR /&gt;    NUMBER(1)&lt;BR /&gt; NEW_COMMNET&lt;BR /&gt;    VARCHAR2(100)&lt;BR /&gt;&lt;BR /&gt;yogeeraj@MYDB.MU&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 08 Nov 2005 23:39:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939274#M797500</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-11-08T23:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939275#M797501</link>
      <description>Hi Scott,&lt;BR /&gt;&lt;BR /&gt;I'll do it this way:&lt;BR /&gt;&lt;BR /&gt;- Make sure you have a good database backup;&lt;BR /&gt;- Test it in a Test database if possible;&lt;BR /&gt;- Now the commands:&lt;BR /&gt;&lt;BR /&gt;create table bak_comment_table_name as&lt;BR /&gt;select a...., a.comments new_comments, a...&lt;BR /&gt;from &lt;COMMENT_TABLE_NAME&gt; a -- I'm not sure this will work&lt;BR /&gt;&lt;BR /&gt;desc bak_comment_table_name; -- to confirm the new comment column is new_comments...&lt;BR /&gt;&lt;BR /&gt;drop table &lt;COMMENT_TABLE_NAME&gt; cascade constraints; -- this is why you need to test this or, at least, have a good backup!&lt;BR /&gt;&lt;BR /&gt;create table &lt;COMMENT_TABLE_NAME&gt;  as &lt;BR /&gt;select * from bak_comment_table_name;&lt;BR /&gt;&lt;BR /&gt;PS: try Yogeeraj's suggestion first since I didn't test this one... &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes&lt;/COMMENT_TABLE_NAME&gt;&lt;/COMMENT_TABLE_NAME&gt;&lt;/COMMENT_TABLE_NAME&gt;</description>
      <pubDate>Wed, 09 Nov 2005 04:44:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939275#M797501</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-11-09T04:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle 8i Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939276#M797502</link>
      <description>I had to keep in mind that when using double-quotes to identify the reserved word that the object name is case-sensitive. Therefore, I needed to uppercase COMMENT.&lt;BR /&gt;&lt;BR /&gt;Thank you for you help!</description>
      <pubDate>Wed, 09 Nov 2005 08:09:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-8i-question/m-p/4939276#M797502</guid>
      <dc:creator>Scott Buckingham</dc:creator>
      <dc:date>2005-11-09T08:09:51Z</dc:date>
    </item>
  </channel>
</rss>

