[ic] Perl/SQL - UPDATE Queries

Russ Mann interchange-users@lists.akopia.com
Mon Jul 2 15:51:00 2001


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.

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