0 Replies Latest reply on Mar 8, 2019 6:57 PM by Mikhail Velikikh

    Quick SQL: genPK and prefixPKwithTname

    Mikhail Velikikh

      Hi All,

       

      Do you happen to know how to get those settings to work?

      I have tried them like this:

      # settings = { genPK: true, prefixPKwithTname: false }
      employees
          name
          salary num
      

      And like this:

      # genPK: true
      # prefixPKwithTname: false
      employees
          name
          salary num
      

      I have also tried to reset settings through the 'Settings' button.

      I keep getting on https://livesql.oracle.com:

      -- create tables
      create table employees (
          name                           varchar2(255),
          salary                         number
      )
      ;
      

      That one works (I added /colprefix and /pk):

      employees /colprefix emp
          id /pk
          name
          salary num
      

      It generates:

      -- create tables
      create table employees (
          emp_id                         number generated by default on null as identity  
                                         constraint employees_emp_id_pk primary key,
          emp_name                       varchar2(255),
          emp_salary                     number
      )
      ;
      
      
      

      I really would like to get something like this (note the primary key name - I just want to generate it as EMP_ID_PK; it would be even better to generate it as EMP_PK):

      -- create tables
      create table employees (
          emp_id                         number generated by default on null as identity  
                                         constraint emp_id_pk primary key,
          emp_name                       varchar2(255),
          emp_salary                     number
      )
      ;