Ok, I've been with the list now on and off for about 4 months.  I've seen
some DBI examples, but most only deal with extracting info from a database.
I want to create one.  Here's what I have:

I have a current shell script using SQLPlus that creates the database within
Oracle on our primary systems which run Solaris.  What I want to do is
convert this shell script into a perl script using DBI with a MS Access
database to support code development using the PC.  Here is a sample SQL
statements creating a given table....

create table assetvessel
(   
      constraint PK_assetvessel primary key (scenario, name),
                     --
      scenario   varchar2(16),
                     -- name of the scenario
      name       varchar2(16),
                     -- name of the instance within the class
      bearing    number(3)
                    constraint C_assv_bearing
                    check (bearing between 0 and 359),
                     -- bearing in integer degrees from guide ship
      deltasc    number(3)
                     -- delta scenario flag
      g_name   varchar2(16),
                     -- name of instance within the g_class
      range       number(4)
                     constraint C_assv_range
                     check (range between 0 and 9999)
                     -- nautical miles to the guide ship, 0 to 9,999 nm
);

What I have found so far is that in order to enable the primary key
constraint on the table, I have to move the PK_assetvessel definition to the
bottom of the table definition or it generates a DBI->prepare error and does
not work.  I also convert all of the varchar2 data types to char data types
and that work.  The number data types we are currently entering as integer
types, however we cannot get the constraints to work properly on these.  If
we remove the field constraints, DBI->prepare does not error and the table
is created, though there are no constraints on the data.

Anyone have any experience with this?


TIA,

Will

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to