That's what I though.
In Transact SQL this is valid code to run on the server, and you may
optionally
choose to put it all into a single stored procedure. In most other
databases, a stored
procedure has a language that is not executable outside the procedure
code itself.
With MySQL there will b
T-SQL style procedural scripting will not be initially available outside
of stored procedures. Stored procedures are new to 5.0 (still under
development) so what you want to code is not available, yet. You will
have to make program branch choices in a programming language as the SQL
engine cur
Hi,
Apologies, yes I have RTFM, and should've clarified my question. I
actually need to do something more like this:
IF(@SomeValue = 1)
BEGIN
THEN
SELECT "Data" as Column1,
"MoreData" as Column2
ELSE
SELECT "SomeValue is not = 1" as Error
END IF
Thanks,
Luke Venediger.
On
Hi Anders,
Thanks for that. Yes, I have come from an MSSQL environment, and I'm
using .Net 1.1 with the MySQL Connector/Net. The idea behind using
conditional statements was to assign a query to a business task. For
example, I could write a query to handle adding items to a shopping
cart. In the
I don't know why you want to do this, but looking at your sybtax, it
seems like you come
from a Sybase or SQL Server environment. What you are trying to achieve
is the
way it is done in Transact SQL, where the conditional statements and
stuff like that which
are typically used in stored procedur
, I'm pretty sure you can't put ifs around
your SQL.
Rhino
- Original Message -
From: "Luke Venediger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 22, 2004 10:31 AM
Subject: Conditional statement: IF
> Hi,
>
> I'm tryin
[snip]
I'm trying to write a conditional statement in my query. Is the
following possible in MySQL?
IF(@SomeValue = 1)
THEN
SELECT "The value is 1";
ELSE
SELECT "The value is not 1";
END IF
I've tried different variations and nothing seems to be working (I'm
getting syntax errors). I'm using My
Hi,
I'm trying to write a conditional statement in my query. Is the
following possible in MySQL?
IF(@SomeValue = 1)
THEN
SELECT "The value is 1";
ELSE
SELECT "The value is not 1";
END IF
I've tried different variations and nothing seems to be working (I'm
getting syntax errors). I'm using MySQ