[thelist] Adding Custom Info to Primary Keys in SQL

rudy r937 at interlog.com
Wed Feb 5 09:12:01 CST 2003


> When I am creating primary keys that auto-increment, I'd like to add a
> prefix in front of them. So instead of "135," I get "B135."

no can do

however, you can create a view of the table, and then use the view instead
of the table in your join queries

   create view myview
     as
       select 'B' || primarykey   as myprimarykey
          ...


rudy




More information about the thelist mailing list