I have simplified this to:
But get error [Macromedia][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near 'a'.
Any more help please?
Allan
--
CREATE PROC GetMessages2
@searchtext varchar (100)
AS
DECLARE @query varchar(1000)
SET
You are missing sinle quotes after the like I think. Use what you did
first.
-Original Message-
From: Allan Cliff - CFUG Spain [mailto:[EMAIL PROTECTED]
Sent: vrijdag 20 februari 2004 11:57
To: CF-Talk
Subject: Re: [cftalk] RE: Stored Procedures
I have simplified
try,
SET @query = @query +' AND Message LIKE '+ '% + @searchtext +
%'
basically you are missing the quote around the like
-Original Message-
From: Allan Cliff - CFUG Spain [mailto:[EMAIL PROTECTED]
Sent: Friday, February 20, 2004 10:57
To: CF-Talk
Subject: Re: [cftalk] RE
Subject: Re: [cftalk] RE: Stored Procedures
I have simplified this to:
But get error [Macromedia][SQLServer JDBC Driver][SQLServer]Line
1: Incorrect syntax near 'a'.
Any more help please?
Allan
--
CREATE PROC GetMessages2
@searchtext
IF @searchtext ''
SET @query = @query +' AND M.Message LIKE '''+ '%' + @searchtext + '%'''
was the solution. Single Quotes Only.
Thanks
Allan
- Original Message -
From: Mike Townend
To: CF-Talk
Sent: Friday, February 20, 2004 12:03 PM
Subject: RE: [cftalk] RE: Stored Procedures
I'm not sure there is much point in using a stored proc
to build a SQL string and execute it, you'll get no
speed/efficiency benefit at all, in fact it will probably
be slower.
This is true, but if you use stored procedures exclusively for all database
access, you may be able to tighten
6 matches
Mail list logo