[RE]Re: [RE][jifty-devel] UPDATE in SQL
Jesse Vincent
jesse at bestpractical.com
Mon Dec 4 23:24:59 EST 2006
On Tue, Dec 05, 2006 at 01:18:58PM +0900, In-Suk Joung wrote:
> Thanks, but it seems like 'WHERE' clause is not applicable.
>
> Maybe, I can rewrite a new method mimicking '__set'.
>
Indeed. Sorry about that.
> ---------[ ^1THA-o ,THAI ^3>>?e ]----------
> A|,n : Re: [RE][jifty-devel] UPDATE in SQL
> ^3-AYEN : Mon, 4 Dec 2006 22:44:58 -0500
> -o,^3 1/2AI : Jesse Vincent <jesse at bestpractical.com>
> ^1TH'AAI : Nifty apps in a Jiffy <jifty-devel at lists.jifty.org>
>
> On Tue, Dec 05, 2006 at 12:40:24PM +0900, In-Suk Joung wrote:
> > I answer to my question. I did this way. If anybody knows a fancier
> way,
> > please let me know.
>
> Hi! Sorry for the delay in my reply. I've been working a bit too hard of
> late ;)
>
> It should be as easy as
>
> $object->__set( column => 'column_name',
> value => 'column_name +1'
> is_sql_function => 1);
>
> Best,
>
> Jesse
>
> >
> > my $db_handle = $self->_handle;
> > my $table = $self->table;
> > $db_handle->simple_query(
> > "UPDATE $table SET column_name = column_name + 1"
> > ." WHERE column_name >= ?",
> > $certain_number,
> >
> > );
> >
> >
> >
> > ---------[ ^1THA-o ,THAI ^3>>?e ]----------
> > A|,n : [jifty-devel] UPDATE in SQL
> > ^3-AYEN : Mon, 04 Dec 2006 14:01:01 +0900 (KST)
> > -o,^3 1/2AI : "In-Suk Joung" <JMARCH at HANMAIL.NET>
> > ^1TH'AAI : <JIFTY-DEVEL at LISTS.JIFTY.ORG>
> >
> > Could anybody show me a quick example how to replace the SQL below in
> > Jifty?
> >
> > UPDATE table_name SET column_name = column_name + 1 WHERE column_name
> >=
> > $certain_number
> >
> > I guess probably I need to use some methods in Jifty::DBI::Handle. But
> I
> > have no clue, yet.
> >
> > -----------
> > InSuk Joung
> > -----------
> >
> > [IMG]
> > "?`i,(R) AIAAI^3Y, Daum" http://www.daum.net !-oAEo>>y 3/4^2'A ^1<<.a
> > C,N,THAI^3Y!>>
> > [IMG]
> > [IMG]
> >
> > -----------
> > InSuk Joung
> > -----------
> >
> > [IMG]
> > "?`i,(R) AIAAI^3Y, Daum" http://www.daum.net !-oAEo>>y 3/4^2'A ^1<<.a
> > C,N,THAI^3Y!>>
> > [IMG]
> > [IMG]
>
> > _______________________________________________
> > jifty-devel mailing list
> > jifty-devel at lists.jifty.org
> > http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
> --
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
> -----------
> InSuk Joung
> -----------
>
> [IMG]
> "?`i,(R) AIAAI^3Y, Daum" http://www.daum.net !-oAEo>>y 3/4^2'A ^1<<.a
> C,N,THAI^3Y!>>
> [IMG]
> [IMG]
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
--
More information about the jifty-devel
mailing list