Hi,
     Set the value as

      SET @SoftwareID:=7;

    Now, use

      WHERE
        s.softwareID = @SoftwareID  at the end of your query.

Thanks,
Narasimha

-----Original Message-----
From: Erich Beyrent [mailto:[EMAIL PROTECTED]
Sent: Monday, December 13, 2004 8:30 PM
To: [EMAIL PROTECTED]
Subject: User variables

I am having a problem with a query:

SET @SoftwareID = 7;

SELECT
        s.softwareID,
        s.softwareName,
        s.softwareVersion,
        s.softwareCreated,
        s.softwareChanged,
        b.buildName,
        s.supportFlag,
        s.softwareDesc,
        s.softwareLicense,
        s.softwareLocations,
        s.softwareProductKey,
        p.platformName,
        v.vendorName,
        v.vendorURL
FROM
        software s
INNER JOIN platform_groups pg
        on s.softwareID = pg.softwareID
INNER JOIN platforms p
        on pg.platformID = p.platformID
INNER JOIN vendors v
        on s.vendorID = v.vendorID
INNER JOIN builds b
        on s.buildTypeID = b.buildTypeID
WHERE
        s.softwareID = @SoftwareID


This does not work.  It appears that the user variable is not picked up
in
the WHERE clause - the query works fine if I have:

WHERE s.softwareID = 7


Is what I am trying to do not supported?  I am using version 4.1.7 on
FreeBSD 5.3.

Best regards,

Erich Beyrent


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to