- Here's a timestamp statement:
- This sets it to the current time:
- Don't try to put numbers inside single-quotes. It will give error 217.
- To drop a table, add CASCADE at the end:
- Here are a bunch of error codes you can get back (found here and duplicated on many internet sites):
22 => DB_ERROR_SYNTAX,
85 => DB_ERROR_ALREADY_EXISTS,
108 => DB_ERROR_SYNTAX,
116 => DB_ERROR_NOSUCHTABLE,
124 => DB_ERROR_VALUE_COUNT_ON_ROW,
215 => DB_ERROR_NOSUCHFIELD,
217 => DB_ERROR_INVALID_NUMBER,
226 => DB_ERROR_NOSUCHFIELD,
231 => DB_ERROR_INVALID,
239 => DB_ERROR_TRUNCATED,
251 => DB_ERROR_SYNTAX,
266 => DB_ERROR_NOT_FOUND,
357 => DB_ERROR_CONSTRAINT_NOT_NULL,
358 => DB_ERROR_CONSTRAINT,
360 => DB_ERROR_CONSTRAINT,
361 = "Integrity constraint violation (FOREIGN_KEY...)" (from Java experiments)
- I keep hitting problems trying to use any native sequence functionality with Hibernate. You get the next sequence number with "SELECT UNIQUE" on the table name, thus:
select unique from admin_user
This is automatically available for any table that you create.
Now, the generic Hibernate JDBC dialect acts badly, so I changed things so that I have to retrieve this unique value every time I try to insert into the DB. Sometimes it was difficult to figure out that this was the problem; even P6Spy wasn't showing me why I was getting an error 116 "DB_ERROR_NOSUCHTABLE". I finally found this statement in the FrontBase logs:
select next_hi from hibernate_unique_key;
No comments:
Post a Comment