|
From: Steven D. <st...@de...> - 2001-10-25 00:10:13
|
All,
During my first installation of OI I have managed to reach the step of =
the Fruit excersise where the install_sql script is executed. There I =
encounter a peculiar error: the table is created succesfully but the =
data is not inserted correctly. The data file is being read but =
apparently is not parsed succesfully by OpenInteract::SQLInstall. This =
is shown by the hash ref printed by SPOPS::DBI. The required data =
structure is missing, does this mean the parsing of the data file is =
somehow not being completed? I would expect and error message from =
OpenInteract::SQLInstall regarding the parsing of the data file but this =
does not occur.
What's the problem here? Why is the data file not parsed like expected? =
After extensive study of the docs I'm still stuck. I'm probably missing =
something ;)
Any help is welcome.
regards
Steven Devijver
(data file below)
[ ... The output of oi_manage install_sql ... ]
Running install_sql...
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
OpenInteract::DBI::connect (41) >> DBI::connect >> Connected ok
OpenInteract::SQLInstall::require_package_installer (29) >> Trying to =
require (OpenInteract::SQLInstall::Fruit) from =
(OpenInteract::SQLInstall) for (fruit)
OpenInteract::SQLInstall::apply (57) >> Finding coderef for =
create_structure
OpenInteract::SQLInstall::read_file (602) >> Reading file =
/usr/local/websites/oitest/pkg/fruit-0.06/struct/create-table-fruit.sql
NOTICE: CREATE TABLE will create implicit sequence 'tbl_fruits_id_seq' =
for SERIAL column 'tbl_fruits.id'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index =
'tbl_fruits_pkey' for table 'tbl_fruits'
OpenInteract::SQLInstall::create_structure (144) >> Structure (from =
create-table-fruit.sql) ok!
oitest::User::_class_initialize (15) >> Set oitest::User to use crypt =
(1)
OpenInteract::DBI::connect (41) >> DBI::connect >> Connected ok
OpenInteract::SQLInstall::apply (57) >> Finding coderef for install_data
OpenInteract::SQLInstall::read_file (602) >> Reading file =
/usr/local/websites/oitest/pkg/fruit-0.06/data/fruit-initial-data.perl
OpenInteract::SQLInstall::process_data_file (259) >> Reading data for =
class oitest::Fruit
SPOPS::DBI::save (524) >> Trying to save a ( oitest::Fruit )
SPOPS::DBI::save (549) >> Security check passed ok. Continuing.
SPOPS::DBI::_save_insert (611) >> Treating the save as an INSERT.
SPOPS::DBI::_save_insert (645) >> Insert failed! Args: $VAR1 =3D {
'db' =3D> bless( {}, 'DBI::db' ),
'is_add' =3D> 1,
'skip_cache' =3D> 1,
'DEBUG' =3D> 1,
'skip_log' =3D> 1,
'table' =3D> 'tbl_fruits',
'skip_security' =3D> 1,
'return_sth' =3D> 1
};
Cannot continue with no SQL, values or table name
OpenInteract::SQLInstall::apply (57) >> Finding coderef for =
install_security
Status of the packages requested for SQL install:
fruit (0.06)
OK:
Structure:
* Created table from (create-table-fruit.sql): ok
Data:
* Error: Cannot create SPOPS object!
Basic: Error saving record to database: INSERT failed
at
/usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa
ce.pm line 243.
Error: Cannot continue with no SQL, values or table
name
Security:
Important Notes
-------------------------
none
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
Finished install_sql!
[ ... And the data file ... ]
$data =3D [
{
spops_class =3D> 'OpenInteract::Fruit',
field_order =3D> [ qw/ name taste price / ]
},
[ "Apple", "slightly sour", "1.00" ],
[ "Banana", "sweet", "1.00" ],
[ "Cherry", "red", "0.05" ],
[ "Tomato", "yes, this is a fruit - look it up in the dictionary", =
"1.00" ],
];
|