If I want to create a table i can do this:
my $c = $DB->creator('tablename');
$c->cols(
$col1 => {
type => 'ENUM',
values => ['val1', 'val2' ... ],
not_null => 1
},
$col2 => {
...
}
);
$c->create;
but can i do this and add the fields one at a time?
my $c = $DB->creator('tablename');
$c->cols('yahger' => {
pos => 1,
type => 'INT'
});
$c->cols('laur' => {
pos => 2,
type => 'INT'
});
$c->create;
I tried and got odd results. I was wondering if it is supported. For what I am writing I need the ability to do one at a time. Would my best bet be to create the table with the first field, then add a new field?
Thanks,
- Jonathan
Code:
my $c = $DB->creator('tablename');
$c->cols(
$col1 => {
type => 'ENUM',
values => ['val1', 'val2' ... ],
not_null => 1
},
$col2 => {
...
}
);
$c->create;
but can i do this and add the fields one at a time?
Code:
my $c = $DB->creator('tablename');
$c->cols('yahger' => {
pos => 1,
type => 'INT'
});
$c->cols('laur' => {
pos => 2,
type => 'INT'
});
$c->create;
I tried and got odd results. I was wondering if it is supported. For what I am writing I need the ability to do one at a time. Would my best bet be to create the table with the first field, then add a new field?
Thanks,
- Jonathan