Skip navigation links

MySQL Forums :: General :: Insert into with IF condition


Advanced Search

Insert into with IF condition
Posted by: Rui Cunha ()
Date: August 26, 2011 09:33AM

Hi,

After many hours trying to reach the answer to my problem i eventually decided to ask help to experts ;)

What i need is:

Using only SQL STRING in the command line:

if 1 = 1 i want to:

> INSERT into acct_table(AcctSessionId) VALUES ('test');

Just to give a example (i know this is wrong) something like this:

> if 1=1 (insert into acct_table(AcctSessionId) VALUES ('test') ELSE 'false' END;


Thanks in advance.

Best regards,
Rui Cunha

Options: ReplyQuote


Subject Written By Posted
Insert into with IF condition Rui Cunha 08/26/2011 09:33AM
Re: Insert into with IF condition Rick James 08/27/2011 08:42AM
Re: Insert into with IF condition Rui Cunha 09/03/2011 07:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.