« February 2007 | Main

March 31, 2007

Timestamps - laugh or cry

The Sybase ASE TIMESTAMP datatype causes more confusion to developers than any other data type. The expectation is that it has a "meaningful" date/time which tells you when the column was last modified. Of course - it's completely different and I've yet to work on a database where it was required.

I suspect that the confusion comes from the prevalence of MySQL, where their TIMESTAMP datatype behaves like a DATETIME which is set to the current time when a record is modified.

Anyway, when looking up the MySQL timestamp on the web, I came across this irate post on the MySQL official support site. How I laughed - what would the poster make of the Sybase timestamp?

Subject: F*** You

The MySQL datatype isn't a timestamp.  A timestamp should be a second count from the beginning of the unix epoch.  This allows for linear math application of that data in geometric equations.  The current "Timestamp" datatype is simply a renamed date datatype.  Advertising the existence of a timestamp datatype when none exists in a commercial product could also be seen as fraud.

Suggested fix:

Provide a valid timestamp integer... or remove the datatype all together and stop making up datatypes that don't exist.

And the official MySQL Support reply?

Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation

March 24, 2007

missing dlls, version 15

I installed DBArtisan on my laptop and tried to connect to my 15.0 database server.

Error: "Can not load Open Client, please verify that libct.dll and libcs.dll are in your path". Turns out that Sybase have changed the names of the open-client dlls for version 15.

There is a batch file that will copy the "new" dlls to the "old" dlls. Its under $SYBASE\OCS-15_0\scripts. There's a README file in the scripts directory with more inf.

Run copylibs.bat to copy the files and get DBArtisan to work.

March 06, 2007

MS Word, isql and quotes

I'm creating test cocuments in Microsoft Word and once again am tripping over the issue of quotes ("", '). I document a simple insert statement in MS Word and copy-and-paste into isql and it fails.

insert into product (product_name) values ('ACME Corporation')

The error message is Unclosed quote before the character string '), a sure sign that the quote in the Word document isn't recognised. The problem is that Microsoft uses its own Ascii coding for quotes, and by default will replace the "straight" quote with its "smart" quote (known by everybody else as a "curly" quote - one commentator says that as a rule of thumb, every time Microsoft uses the term "smart" look for a gotcha).

One solution is not to use MS Word (Wordpad doesn't do this).

Another solution is to disable the curly quote in MS Word: under Tools; AutoCorrect Options; AutoFormat As You Type; deselect Replace Staight Quotes with Smart Quotes

Make sure that you are on the "AutoFormat As You Type" tab, not the Autoformat Tab.