Posts

SESSION-LEVEL SEQUENCES

  Oracle Database 12c introduces session-level sequences, which generate sequence values that are maintained independently within each database session: CREATE SEQUENCE seq_new START WITH 1 INCREMENT BY 1 SESSION; --session 1: select seq_new.nextval from dual; 1 --session 2: select seq_new.nextval from dual; 1 To change this sequence from  session level  to  global level , and vice versa, the following commands are used: alter sequence seq_new global ; alter sequence seq_new session;

Oracle AI Database 26ai - SQL Domain

Image
SQL domain can include a set of constraints and attributes, and by assigning it to a column, we can apply those constraints to that column. In other words, SQL Domain enables the extension of data types in a way that aligns with business requirements. One of the most important use cases of this feature arises when we want to apply specific conditions to the input values of a column. For example, for an   Age   column of type   NUMBER , we may want to prevent values less than 18 by enforcing the condition   Age >= 18 . Or, in a more practical example, for a column intended to store email addresses, we can apply a rule so that the column only accepts input in the format   text@text.text . Of course, in versions prior to 26ai, this could be achieved using different approaches such as triggers, check constraints, and so on. For instance, using a check constraint, we can enforce that values inserted into the   Email   column must match the   text@te...