Generic CREATE TABLE statement

Consider this statement:

CREATE TABLE some_table ( field1 VarChar(255) NOT NULL, field2 VarChar(255) NOT NULL )

Can anyone think of a SQL flavor where that wouldn’t work? If so, what’s the alternative?

BTW, the limit of 255 is not really important. That’s a minimum, but I don’t really care about an upper limit.

None where it won’t work off the top of my head.
But in most db’s that will be the maximum - not a minimum.
And ones where it sets up a table that isn’t usable in the way you might expect - plausible.
What is it you want to drop into the varchar field ?

Yes, I understand that’s a max, I was just thinking of some flavors that don’t honor that limit at all.

Both fields will be text, and neither should be longer than 128 characters, but I’m making allowances for future needs. field1 will be indexed, and I will handle case-sensitivity in code.

FYI, this is for my Security Via Obesity presentation and the class I’ve created to assist with it. The fields are hash1 and salt2.

[quote=69797:@Kem Tekinay]Yes, I understand that’s a max, I was just thinking of some flavors that don’t honor that limit at all.
[/quote]
Some don’t - sqlite

UTF-8 unicode etc ?
Thats more what I was thinking
If its straight ASCII its probably NOT an issue

[quote=69797:@Kem Tekinay]
FYI, this is for my Security Via Obesity presentation and the class I’ve created to assist with it. The fields are hash1 and salt2.[/quote]
I had to go look that damn thing up :slight_smile:

It will be straight ASCII only (hex digits), so no, no encoding issues.

Looks like someone has to attend my session. :slight_smile: