[ic] Problems with $Tag->import() in [perl]

Mike Heins interchange-users@lists.akopia.com
Tue Jul 17 15:10:34 2001


Quoting Ed LaFrance (edlafrance@mindspring.com):
> IC: 4.6.5
> OS: RH 6.2
> Perl: version 5.005_03 built for i386-linux
> 
> 
> This in-page code:
> 
> [tag flag write]fulfillments[/tag]
> 
> [perl tables="fulfillments" global=1]
>          my $body = "9999\tblah";
>          $Tag->import(
>              {
>               table => 'fulfillments',
>               type => 'TAB',
>              },
>              $body
>          );
> [/perl]
> 
> 
> fails to import any data, though no error is logged.  This works fine:
> 
> [tag flag write]fulfillments[/tag]
> [import fulfillments TAB]9999   blah[/import]
> 
> The catalog is defined with AllowGlobal in interchange.cfg; is 
> $Tag->import() undoable with embedded Perl?
> 

Yes. It will be documented as such in future revs. You can use a
number of the (I believe documented) routines like $db->set_field(),
$db->row_settor(), $db->set_row(). In the soon-to-be-released 4.8,
you can do:

	my $db = $Db{fulfillments};
	my @fields = qw/foo bar/;
	my @values = ('9999', 'blah');
	$db->set_slice($key, \@fields, \@values);

Even right now, you can do above:

	my $db = $Db{fulfillments}
		or die "bad db fullfillments";
	$db->set_field(9999, 'your_column', 'blah');

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Function in chaos, finish in style. -- Unknown