Oracle - where can i go for answers

Results 1 to 3 of 3

Thread: Oracle - where can i go for answers

  1. #1
    Join Date
    Dec 1969
    Posts
    148

    Default Oracle - where can i go for answers

    Need to set primary key, and unlike SQL, it doesn&#039t have the ability to set an auto increment in O8 personal edition.<BR><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    1,671

    Default RE: Oracle - where can i go for answers

    You will have to do the sequence number increment with an Insert Trigger. I wish I could be more specific on exactly how to do that but I can&#039t.<BR><BR>The basic syntax is <BR><BR>CREATE TRIGGER trigger_name<BR>{BEFORE&#124AFTER}<BR>{DELETE&#124 INSERT&#124UPDATE {of col1,col2,...]}<BR>ON table<BR>plsql block<BR><BR>If you don&#039t specify columns then the trigger will fire when any field in a record is updated/inserted/deleted<BR>The pl/sql block would be the actual code to increment the counter and put it in the appropriate field.<BR><BR>I&#039m at home now, but I will try to find a better exmple at work<BR><BR>As a last thought... you said you needed to set a primary key...do you really need to do it via a sequence number or is there some unique field, or combinations of fields, that would be more appropriate for the key ? If so, then you wouldn&#039t need the trigger.<BR><BR>also check out www.oracleassist.com which has some infor on oracle.<BR><BR>Mike<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    148

    Default RE: Oracle - where can i go for answers

    thanks a bunch. Oracle 8 has a trigger wizard which does everything but the plsql block and that&#039s what I have no idea on. I need a SQL(i miss it already) like tabel that has a unique value primary key that increments by 1. That&#039s all I want..(boo hoo hoo) and there just doesn&#039t seem to be very much on the web and I can&#039t believe Oracle doesn&#039t have that in it.<BR><BR>I will check out oraclassist. thanks again<BR>Mickey

Posting Permissions

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