[ic] Perl/SQL - UPDATE Queries

Jason Kohles interchange-users@lists.akopia.com
Mon Jul 2 16:52:00 2001


On Mon, Jul 02, 2001 at 02:26:39PM -0600, Russ Mann wrote:
> How would you do this in a [perl] block?
> 
$Tag->query({sql => "update table set foo='bar'"});

> -----Original Message-----
> From: interchange-users-admin@developer.akopia.com
> [mailto:interchange-users-admin@developer.akopia.com]On Behalf Of Jason
> Kohles
> Sent: Monday, July 02, 2001 1:52 PM
> To: interchange-users@developer.akopia.com
> Subject: Re: [ic] Perl/SQL - UPDATE Queries
> 
> 
> On Mon, Jul 02, 2001 at 01:52:07PM -0600, Russ Mann wrote:
> > Hello List,
> >
> > How can I run UPDATE SQL queries within a regular IC page?  Does anyone do
> > this?  All the examples are of SELECT queries, but that doesn't do me any
> > good.
> >
> Exactly the same way...
> [query sql="update table set foo='bar'"]
> 
> 
> > Thank you.
> >
> > Russ
> >
> > -----Original Message-----
> > Sent: Friday, June 29, 2001 4:27 PM
> > Subject: RE: [ic] Perl/SQL
> >
> >
> > I can't seem to get any of these things to work with what I'm trying to
> do.
> >
> > I need to be able to run queries like this:
> > @tables is an array including everything that has a username field in it.
> >
> > foreach $table (@tables) {
> > UPDATE $table SET username='$new_username' WHERE username =
> '$old_username'
> > }
> >
> > Which method would you use to do this?
> >
> > R
> >
> > -----Original Message-----
> > From: interchange-users-admin@developer.akopia.com
> > [mailto:interchange-users-admin@developer.akopia.com]On Behalf Of Mark
> > Johnson
> > Sent: Friday, June 29, 2001 1:57 PM
> > To: interchange-users@developer.akopia.com
> > Subject: Re: [ic] Perl/SQL
> >
> >
> > MANY options, but the main ones:
> >
> > In embedded perl, use the %Db object's query method
> >
> > http://interchange.redhat.com/cgi-bin/ic/dev/icconfig_30.html
> >
> > As its own tag, use the [query] tag.
> >
> > [query list=1 sql="select * from foobar"]
> > Field		Value
> > -----		-----
> > code		[sql-code]
> > foocol		[sql-param foocol]
> > barcol		[sql-param barcol]
> > [/query]
> >
> > Russ Mann wrote:
> > >
> > > Hello,
> > >
> > > How do I execute an SQL statement from within a [perl] bock?
> > >
> > > Or, how do I execute an arbitrary SQL statement from a regular page?
> > >
> > > Thanks,
> > >
> > > Russ
> > > _______________________________________________
> > > Interchange-users mailing list
> > > Interchange-users@lists.akopia.com
> > > http://lists.akopia.com/mailman/listinfo/interchange-users
> >
> > --
> > Mark Johnson
> > Senior Systems Architect - Professional Services
> > Red Hat, Inc.
> > E-Business Solutions
> > markj@redhat.com
> > 703-456-2912
> > _______________________________________________
> > Interchange-users mailing list
> > Interchange-users@lists.akopia.com
> > http://lists.akopia.com/mailman/listinfo/interchange-users
> >
> >
> > _______________________________________________
> > Interchange-users mailing list
> > Interchange-users@lists.akopia.com
> > http://lists.akopia.com/mailman/listinfo/interchange-users
> >
> >
> > _______________________________________________
> > Interchange-users mailing list
> > Interchange-users@lists.akopia.com
> > http://lists.akopia.com/mailman/listinfo/interchange-users
> 
> --
> Red Hat E-Business Solutions                    Jason Kohles
> 11480 Sunset Hills Road                         Senior System Architect
> Reston, VA 20190                                jkohles@redhat.com
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
> 
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

-- 
Red Hat E-Business Solutions                    Jason Kohles
11480 Sunset Hills Road                         Senior System Architect
Reston, VA 20190                                jkohles@redhat.com