Just use SQL?
INSERT INTO tbl, VALUES ('11','22','33') ON DUPLICATE KEY ....
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
On Wed, Oct 20, 2010 at 9:23 AM, Uri Guttman <[email protected]> wrote:
> >>>>> "SPS" == S Pratap Singh <[email protected]> writes:
>
>
> SPS> Insert query works fine but I am not able to figure out how to
> SPS> achieve this "IF EXISTS then UPDATE else INSERT" using a one
> SPS> liner MYSQL statement . If someone can give me an example to
> SPS> write such query and execute it from perl then it would be really
> SPS> appreciated.
>
> that is an sql question that has nothing to do with perl. please ask it
> in an sql forum. the answer that i know is that you can't do it in basic
> sql.
>
> uri
>
> --
> Uri Guttman ------ [email protected] -------- http://www.sysarch.com--
> ----- Perl Code Review , Architecture, Development, Training, Support
> ------
> --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com---------
>
> --
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> http://learn.perl.org/
>
>
>
--
Regards,
Chris Knipe