Re: [Dbi-interbase-devel] DBD and Interbase functionality
Status: Beta
Brought to you by:
edpratomo
From: Mark D. A. <md...@di...> - 2002-04-30 05:09:26
|
> This is fairly simple, boiling down to a few SQL questions -- how do you > select the current time? depends on your interbase version and your dialect. See http://www.ibphoenix.com/ibp_60_sql_date_fs.html I use current_timestamp for my needs. btw, another time related factoid you might need to know is that the default time format is '%d/%m/%Y %H:%M:%S' > how do you generate unique key values? interbase uses the term "generator" for what oracle calls "sequences". interbase does not have autoincrement columns as some rdbms's do. in my own home-grown SPOPS :), here is the data structure i'm using to declare how to manage interbase generators: my %INTERBASE_GENERATOR_OPS = ( inc_get_clause => 'GEN_ID(%s,1)', # name inc_get => 'SELECT GEN_ID(%s,1) from RDB$DATABASE', # name get => 'SELECT GEN_ID(%s,0) from RDB$DATABASE', # name set => 'SET GENERATOR %s TO %%s', # name, val (but only sub name initially) create => ['CREATE GENERATOR %s', 'SET GENERATOR %s TO 0'], destroy => 'DELETE FROM RDB$GENERATORS WHERE RDB$GENERATORS_NAME = \'%s\'', ); > I have all that more or less done and things work great. However, I ran > into a problem trying to run multiple statements simultaneously on a > single database handle? (Test script and error message attached.) Is > this supported with DBD::InterBase? If so, do I need to do anything > special? you aren't the first to see this; try google terms: interbase 504 "unknown cursor" I don't see a resolution even though it was reported in year 2000. fyi i gave up on the DBI::InterBase driver last year (i just lurk on this list). what i'm currently using is DBI:ODBC, calling the unixodbc driver manager, calling the unixodbc interbase driver. such an approach introduces an extra layer, but all the layers are more mature than DBI::InterBase, and have more users. all my mysterious bugs disappeared when i made the move. -mda |