I have slected lines from Links, haw to get all fields from slected lines and add the lines to another table?
Jan 16, 2002, 5:48 AM
User (281 posts)
Jan 16, 2002, 5:48 AM
Post #2 of 6
Views: 1688
Aloha,
Ehm maybe u can refine your question ?
Me quess now is: add columns one be one mannuly in the new table ...
Open 2 windows (1 with links table and 1 with the new table u created) and look carefully at the value's of each field... Like enum,char type...
But again refine your question and maybe someone has a better solution.
Good luck, with it...
Ehm maybe u can refine your question ?
Me quess now is: add columns one be one mannuly in the new table ...
Open 2 windows (1 with links table and 1 with the new table u created) and look carefully at the value's of each field... Like enum,char type...
But again refine your question and maybe someone has a better solution.
Good luck, with it...
I think this must be the right way but the records don't add to Links2
my $db = $DB->table('Links');
my $db2 = $DB->table('Links2');
my $hits = $db->query ( { Field_A => 'x', Field_B => 'y' } );
if ($db->hits) {
foreach my $hit (@{$hits})
{
$hash = $db->array_to_hash($hit);
$db2->add ( Title => $hit->{Title});
}
}
Any ideias?
my $db = $DB->table('Links');
my $db2 = $DB->table('Links2');
my $hits = $db->query ( { Field_A => 'x', Field_B => 'y' } );
if ($db->hits) {
foreach my $hit (@{$hits})
{
$hash = $db->array_to_hash($hit);
$db2->add ( Title => $hit->{Title});
}
}
Any ideias?
Jan 22, 2002, 2:57 PM
Administrator (9387 posts)
Jan 22, 2002, 2:57 PM
Post #5 of 6
Views: 1648
Try:
my $link_db = $DB->table('Links');
my $other_db = $DB->table('Links2');
my $sth = $db->query_sth ( { Field_A => 'x', Field_B => 'y' });
while (my $hash = $sth->fetchrow_hashref) {
$other_db->add ($hash) or die "Can't add: $GT::SQL::error";
}
Cheers,
Alex
--
Gossamer Threads Inc.
my $link_db = $DB->table('Links');
my $other_db = $DB->table('Links2');
my $sth = $db->query_sth ( { Field_A => 'x', Field_B => 'y' });
while (my $hash = $sth->fetchrow_hashref) {
$other_db->add ($hash) or die "Can't add: $GT::SQL::error";
}
Cheers,
Alex
--
Gossamer Threads Inc.