Try this:

DECLARE @find varchar(30);

SET @find = '';

If you do not set it to '', then I think it is NULL, which is quite
different in SQL terms.

Does that help at all?



......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Daniel Kessler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 08, 2007 9:47 AM
To: CF-Talk
Subject: declare sql variables

I'm having difficulty declaring sql variables.  I've not done so
(correctly) before, but I think it may solve my problem.  I've assigned
variables on the fly, though.  The following fails with the declare
statement in.  It's fine without it.  I want to declare a var and set it
to empty, ''.

other sql
(
DECLARE @find varchar(30)
  SELECT p.publication_name, p.publication_id,
           o.dept,o.link                  AS author_link,
           NVL(o.lname, a.a_lname)        AS lastname,
           NVL(o.mname, a.a_mname) || '.' AS middlename,
           NVL(o.fname, a.a_fname)        AS firstname,
           a.publicationa_id
            FROM publications p
            INNER JOIN publications_authors a
           ON p.publication_id = a.publication_id
)

So, the question is, how do I declare a variable and set it to blank?
I've used examples from sql tutorial web pages and it doesn't seem to
work (at least that part is consistent).

thanks.

-- 

Daniel Kessler

College of Health and Human Performance
University of Maryland
Suite 2387 Valley Drive
College Park, MD  20742-2611
Phone: 301-405-2545
http://hhp.umd.edu


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:277268
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to