          return super().last_executed_query(cursor, statement, params)
  
      def last_insert_id(self, cursor, table_name, pk_name):
          sq_name = self._get_sequence_name(table_name)
          cursor.execute('SELECT "%s".currval FROM dual' % sq_name)
          return cursor.fetchone()[0]
  
      def lookup_cast(self, lookup_type, internal_type=None):
          if lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith'):
              return "UPPER(%s)"
 
</s> remove         SELECT "%(sq_name)s".nextval
        INTO :new.%(col_name)s FROM dual;
 </s> add         :new.%(col_name)s := "%(sq_name)s".nextval; </s> remove         SELECT "%(sequence)s".nextval INTO seq_value FROM dual;
 </s> add         seq_value := "%(sequence)s".nextval;
        cursor.execute('"%s".currval' % sq_name)
          return super().last_executed_query(cursor, statement, params)
  
      def last_insert_id(self, cursor, table_name, pk_name):
          sq_name = self._get_sequence_name(table_name)
        cursor.execute('"%s".currval' % sq_name)
          return cursor.fetchone()[0]
  
      def lookup_cast(self, lookup_type, internal_type=None):
          if lookup_type in ('iexact', 'icontains', 'istartswith', 'iendswith'):
              return "UPPER(%s)"
keep keep keep keep replace keep keep keep keep keep
 Fixed #27789 -- Simplified query for sequence value on Oracle. 
django/db/backends/oracle/operations.py