Parameter Problem - What am I doing wrong? 
Author Message
 Parameter Problem - What am I doing wrong?

The following SP(which Does Not use parameters) returns 8 rows which is the
desired result.
================================
CREATE PROCEDURE [sp_keyword]
AS
Select distinct A.articleid, A.title, I.papername, I.dt, A.page,
dat = convert (varchar(12), I.dt, 107)
From Article A, Issue I
Where A.issue = I.issueid
and((A.articleid IN (Select articleid
From about where subject like '% hungary%'
or subject like 'hungary%'))
or Contains(title, 'hungary')
or Contains (summary, 'hungary'))
order by I.dt desc;
========================================


hungary" does not return any rows.  What am I doing wrong.

===============================
CREATE PROCEDURE [sp_keyword]

AS
Select distinct A.articleid, A.title, I.papername, I.dt, A.page,
dat = convert (varchar(12), I.dt, 107)
From Article A, Issue I
Where A.issue = I.issueid
and((A.articleid IN (Select articleid




order by I.dt desc;

John Wynstra
Library Information Systems Specialist
University of Northern Iowa



Sun, 29 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?

It looks like a syntax issue...






HTH
--
Patrick Logan, MCSD
Senior Technical Development Advisor
McKessonHBOC -- Extended Care Solutions Group

Opinions expressed are my own and not necessarily those of McKessonHBOC.



Sun, 29 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
Any ideas why the syntax checker would be unhappy about not having quotes in
the Contains clause?  I get an error 170 pointing to this line


Thanks by the way.

John





Sun, 29 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
Got me on that one.... haven't used the CONTAINS function.

Did the rest of the LIKE statements work based on my suggestions?  I did
that off the top of my head, which is why I qualified "at least something
like above"....

--
Patrick Logan, MCSD
Senior Technical Development Advisor
McKessonHBOC -- Extended Care Solutions Group

Opinions expressed are my own and not necessarily those of McKessonHBOC.



Sun, 29 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
John,

I think that you have to build the whole statement in a string variable

The FT engine doesn't work with TSQL variables and parameters.
--
Tibor Karaszi, Cornerstone Sweden AB
MCDBA, MCSE, MCSD, MCT, SQL Server MVP
Please reply to the newsgroup only, not by email.


Quote:
> Any ideas why the syntax checker would be unhappy about not having quotes
in
> the Contains clause?  I get an error 170 pointing to this line


> Thanks by the way.

> John










Mon, 30 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
OK, I think you're on to something here, but when I try to Execute it


way the syntax checker seems happy with it.

Thanks for any additional help on this.  I appreciate your willingness to
take the time to respond to this.

John Wynstra
=============================

CREATE PROCEDURE [sp_keyword]

AS


A.page,
dat = convert (varchar(12), I.dt, 107)
From Article A, Issue I
Where A.issue = I.issueid
and (A.articleid IN (Select articleid




order by I.dt desc;"



Quote:
> John,

> I think that you have to build the whole statement in a string variable

> The FT engine doesn't work with TSQL variables and parameters.
> --
> Tibor Karaszi, Cornerstone Sweden AB
> MCDBA, MCSE, MCSD, MCT, SQL Server MVP
> Please reply to the newsgroup only, not by email.



> > Any ideas why the syntax checker would be unhappy about not having
quotes
> in
> > the Contains clause?  I get an error 170 pointing to this line


> > Thanks by the way.

> > John










Mon, 30 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
Try just running :

sp_keyword Hungary


Quote:
> OK, I think you're on to something here, but when I try to Execute it




the
> way the syntax checker seems happy with it.

> Thanks for any additional help on this.  I appreciate your willingness to
> take the time to respond to this.

> John Wynstra
> =============================

> CREATE PROCEDURE [sp_keyword]

> AS


I.dt,
> A.page,
> dat = convert (varchar(12), I.dt, 107)
> From Article A, Issue I
> Where A.issue = I.issueid
> and (A.articleid IN (Select articleid




> order by I.dt desc;"




> > John,

> > I think that you have to build the whole statement in a string variable

> > The FT engine doesn't work with TSQL variables and parameters.
> > --
> > Tibor Karaszi, Cornerstone Sweden AB
> > MCDBA, MCSE, MCSD, MCT, SQL Server MVP
> > Please reply to the newsgroup only, not by email.



> > > Any ideas why the syntax checker would be unhappy about not having
> quotes
> > in
> > > the Contains clause?  I get an error 170 pointing to this line


> > > Thanks by the way.

> > > John










Mon, 30 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
Same problem

Server: Msg 137, Level 15, State 2, Line 6

John Wynstra


Quote:
> Try just running :

> sp_keyword Hungary



> > OK, I think you're on to something here, but when I try to Execute it


resolving

section"

> the
> > way the syntax checker seems happy with it.

> > Thanks for any additional help on this.  I appreciate your willingness
to
> > take the time to respond to this.

> > John Wynstra
> > =============================

> > CREATE PROCEDURE [sp_keyword]

> > AS


> I.dt,
> > A.page,
> > dat = convert (varchar(12), I.dt, 107)
> > From Article A, Issue I
> > Where A.issue = I.issueid
> > and (A.articleid IN (Select articleid




> > order by I.dt desc;"




> > > John,

> > > I think that you have to build the whole statement in a string
variable

> > > The FT engine doesn't work with TSQL variables and parameters.
> > > --
> > > Tibor Karaszi, Cornerstone Sweden AB
> > > MCDBA, MCSE, MCSD, MCT, SQL Server MVP
> > > Please reply to the newsgroup only, not by email.



> > > > Any ideas why the syntax checker would be unhappy about not having
> > quotes
> > > in
> > > > the Contains clause?  I get an error 170 pointing to this line


> > > > Thanks by the way.

> > > > John










Mon, 30 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?
John,

In the example given the entire SET is using one pair of "double

concatentated into the string.  Also, double quotes are reserved for
use around "quoted identifiers"; while they usually work that is not
guaranteed to always be the case.  Use single quotes around strings,
and to embedd a single quote use two in place of one.

I think this is more like what you need.  If you paste it into Query

it is not embedded into the string.


AS


    'Select distinct A.articleid, A.title, I.papername, I.dt,
            A.page, dat = convert (varchar(12), I.dt, 107)
      From Article A, Issue I
     Where A.issue = I.issueid
       and (A.articleid IN (Select articleid FROM About
                             WHERE Subject LIKE (''% ' +




  order by I.dt desc'


Roy



Mon, 30 Sep 2002 03:00:00 GMT
 Parameter Problem - What am I doing wrong?

the query is larger that 255 characters.

John Wynstra

Quote:
> John,

> In the example given the entire SET is using one pair of "double

> concatentated into the string.  Also, double quotes are reserved for
> use around "quoted identifiers"; while they usually work that is not
> guaranteed to always be the case.  Use single quotes around strings,
> and to embedd a single quote use two in place of one.

> I think this is more like what you need.  If you paste it into Query

> it is not embedded into the string.

> CREATE PROCEDURE sp_keyword

> AS


>     'Select distinct A.articleid, A.title, I.papername, I.dt,
>             A.page, dat = convert (varchar(12), I.dt, 107)
>       From Article A, Issue I
>      Where A.issue = I.issueid
>        and (A.articleid IN (Select articleid FROM About
>                              WHERE Subject LIKE (''% ' +




>   order by I.dt desc'


> Roy



Tue, 01 Oct 2002 03:00:00 GMT
 
 [ 10 post ] 

 Relevant Pages 

1. Another date problem - What am I doing wrong?

2. Update Problem, What am I doing wrong?

3. What am I doing wrong?

4. TSQL question - what am I doing wrong?

5. Simple one what am i doing wrong

6. What in the world am I doing wrong?

7. What am I doing wrong ? (Win32 API - GetActiveWindow)

8. What am I doing wrong?

9. what i am doing wrong?

10. What am I doing wrong?

11. What am I forgetting or doing wrong

12. HELP - What Am I Doing Wrong


 
Powered by phpBB® Forum Software