Search code examples
sqloracle-sqldevelopercreate-table

When creating a table in Oracle SQL, how can I create a column that will contain specific values?


I am trying to create a table and one of the columns will contain file names like 2009-00014 or 2013-55045. Should it be 'number' or 'varchar'?


Solution

  • The hyphen requires that the column be a string. In Oracle, the recommended type would be varchar2(), with a specified length.

    In addition, the names of files might one day include other characters -- who knows how an application will change in the future.