Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

autoincrement Spalte in Oracle

Empfohlene Antworten

Bei Oracle kannst du dafür sog. Sequences verwenden.

Du legst dafür eine Sequence an

create sequence blah

start with 1

increment by 1;
, wobei du noch mehr Parameter mitgeben und die Werte natürlich auch anders wählen kannst und greifst auf sie mit "nextval" beim Insert zu:
insert into blub

values (..., ..., blah.nextval, ..., ...)

Gruß, Löti.

brauchst aber noch nen trigger fuer...


Begin

  if :new.COMP_ID is null then

    SELECT SEQ_COMP_ID.nextval

    into :new.COMP_ID

    from dual;

  end if;

End;

der trigger wird VOR dem einfuegen aktiviert (muss einstellen, im timing reiter)

dazu halt noch die sequence ... btw. du musst fuer jede tabelle nen trigger und ne sequence anlegen... ;)

so long

den Trigger brauchst Du nicht unbedingt, kannst auch den insert direkt mit sequence_name.nextval ausführen

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.