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

Ed LaFrance interchange-users@lists.akopia.com
Tue Jul 17 15:58:00 2001


At 03:12 PM 07/17/2001 -0400, you wrote:
>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');

...and that is how I ended up doing it, I just thought there would be less 
overhead in doing an entire row at once.  set_slice looks like a good 
solution, albeit pushing 4.6.x'ers forward.  Thanks, Mike.

- Ed L.


>--
>Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
>phone +1.513.523.7621      <mheins@redhat.com>
>
>Function in chaos, finish in style. -- Unknown
>_______________________________________________
>Interchange-users mailing list
>Interchange-users@lists.akopia.com
>http://lists.akopia.com/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================