[ic] [query] tag insert

Eric Terry elterry at multiservice.com
Mon Jan 12 14:16:59 EST 2004

Thanks for setting me straight. 

$Tag->query() and $Variable worked much better.


-----Original Message-----
From: interchange-users-bounces at icdevgroup.org
[mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of Ed LaFrance
Sent: Monday, January 12, 2004 10:58 AM
To: interchange-users at icdevgroup.org
Subject: Re: [ic] [query] tag insert

At 10:37 AM 1/12/2004 -0600, you wrote:
>Is it possible to insert data into a table using the [query] tag?

Yes it is. Your problem is bad coding. You cannot use the [query] tag 
inside a [perl] block without the interpolate=1 parameter, and even then it 
is a bad idea. Use $Tag->query() or make direct calls to the dbi functions 
instead. Also, $Variable is preferable it $::Variable here; I'm not sure if 
the latter works at all in [perl].

- Ed

>I'm getting the error:
>Safe: Search pattern not terminated at (eval 193) line xxx
>I'm using interchange 4.8.6 and perl 5.8.0
>Here's a snip of my code:
>[set order_changes]
>my $sqldsn = $::Variable->{SQLDSN};
>my $sqluser = $::Variable->{SQLUSER};
>my $sqlpass = $::Variable->{SQLPASS};
># first we need to insert data into the order_changes_log table
>my $ordernumber = $CGI->{order};
>my $username = $Session->{username};
>my $comment = $Values->{comment};
>[query sql="insert into order_changes_log (order_number, username,
>timestamp, comment)
>values($CGI->{order}, $Session->{username}, now(), $Values->{comment})"]
>. more code going here .
>Eric Terry
>interchange-users mailing list
>interchange-users at icdevgroup.org

New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          edl at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax

interchange-users mailing list
interchange-users at icdevgroup.org

More information about the interchange-users mailing list