[thelist] SQL basic questions

Athena Janiszewski athenaj at rogers.com
Mon Jan 21 21:51:12 CST 2002


> >Question 3.
> >
> > When adding new rows to the database, is there a quick way or
> > function to auto assign a new ID # to that row?
>
> yes, in oracle they're sequences, in sql/server they're identity
> fields, in
> msaccess they're autonumbers, and in mysql they're called auto_increments
>
> another difference is that you have to insert NULLs into them

Sorry I think you mean you _can't_ insert nulls into them.

I also thought that I should mention that its generally not a good practice
to be creating tables on the fly like this, unless you're building a web
database mgmt type tool. . same goes for adding/editing columns. . it would
be better to design a database that could handle all sorts of crazy
situations to begin with rather than to have to create tables on the fly to
meet your needs.

Maybe if you explain a bit about what you're trying to achieve with this
code we can help some more :)

Athena.






More information about the thelist mailing list