Index
2001-09-25 15:42Lam K Le : RE: INLIST not liking constants -- gives error
2001-09-25 16:17Michael Babcock : INLIST not liking constants -- gives error
2001-09-25 16:33Ed Leafe : Re: INLIST not liking constants -- gives error
2001-09-25 16:42Michael Babcock : Re: INLIST not liking constants -- gives error (DISREGARD!)
2002-11-07 16:51Dan Neuman : Remote View Inlist Parameterized where clause
2002-11-07 16:57Paul McNett : Re: Remote View Inlist Parameterized where clause
2002-11-07 17:54Dan Neuman : RE: Remote View Inlist Parameterized where clause
2002-11-07 21:14Dan Neuman : RE: Remote View Inlist Parameterized where clause
2002-11-07 22:11Mike McCann : Re: Remote View Inlist Parameterized where clause
2002-11-08 08:20Mike McCann : Re: Remote View Inlist Parameterized where clause
Back to top
RE: INLIST not liking constants -- gives error

Author: Lam K Le

Posted: 2001-09-25 15:42:20   Link

#define APPROVE "approve"

#define APPROVED "approved"

#define MET "met"

#define NOTMET "not met"

inlist(lcRCAD,APPROVE,APPROVED,NOTMET)

***********

That's odd. I put the above in a PRG and I don't get that error with VFP6

SP5.

Can you elaborate? What version of VFP and OS, etc.

___

Lam

©2001 Lam K Le
Back to top
INLIST not liking constants -- gives error

Author: Michael Babcock

Posted: 2001-09-25 16:17:37   Link

Error msg: "Command contains unrecognized phrase/keyword=2E"

Guess I can't do this, assuming parms 2+ are constants, because it can't

identify the type?

#define APPROVE "approve"

#define APPROVED "approved"

#define MET "met"

#define NOTMET "not met"

inlist(lcRCAD,APPROVE,APPROVED,MET)

I suppose I'll change them back to variables instead=2E :-(

Michael J=2E Babcock, MCP

Keystone Peer Review Organization

vfpmcp@hotmail=2Ecom

www=2Evfpdevassoc=2Eorg

"Work smarter; not harder=2E"

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

©2001 Michael Babcock
Back to top
Re: INLIST not liking constants -- gives error

Author: Ed Leafe

Posted: 2001-09-25 16:33:13   Link

On Tuesday 25 September 2001 04:17 pm, Michael Babcock supposedly said:

> Error msg: "Command contains unrecognized phrase/keyword."

>

> Guess I can't do this, assuming parms 2+ are constants, because it can'=

t

> identify the type?

>

> #define APPROVE "approve"

> #define APPROVED "approved"

> #define MET "met"

> #define NOTMET "not met"

>

> inlist(lcRCAD,APPROVE,APPROVED,MET)

>

> I suppose I'll change them back to variables instead. :-(

I just tried it, and it worked without an error.

=09

Do you have any other #DEFINEs or #INCLUDEs that could be messing things=

up?

___/=A0

/=A0

__/=A0

/=A0

____/=A0

Ed Leafe=A0

http://leafe.com/

©2001 Ed Leafe
Back to top
Re: INLIST not liking constants -- gives error (DISREGARD!)

Author: Michael Babcock

Posted: 2001-09-25 16:42:18   Link

Forget it=2E=2E=2E=2EI got it=2E=2E=2E=2E=2Esilly typo in declaration in code!

>>> "mbabcock@kepro=2Eorg" 09/25/01 04:34PM >>>

Error msg: "Command contains unrecognized phrase/keyword=2E"

Guess I can't do this, assuming parms 2+ are constants, because it can't

identify the type?

#define APPROVE "approve"

#define APPROVED "approved"

#define MET "met"

#define NOTMET "not met"

inlist(lcRCAD,APPROVE,APPROVED,MET)

I suppose I'll change them back to variables instead=2E :-(

Michael J=2E Babcock, MCP

Keystone Peer Review Organization

vfpmcp@hotmail=2Ecom www=2Evfpdevassoc=2Eorg "Work smarter; not harder=2E"

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

=20=

©2001 Michael Babcock
Back to top
Remote View Inlist Parameterized where clause

Author: Dan Neuman

Posted: 2002-11-07 16:51:32   Link

I have a question for the SQL Server remote view gurus.

I need to create a remote view to a SQL database, and in the where clause I

would like to provide a list of values. And if the field matches one of

those values, then return the record.

Is there a way to do that?

Something like:

Local vp_List

vp_List = ["A","B","C"]

Use RemoteViewName

Remote View SQL Statement:

Select Table.* from dbo.Tablename where inlist(Tablename.Field, ?vp_List)

©2002 Dan Neuman
Back to top
Re: Remote View Inlist Parameterized where clause

Author: Paul McNett

Posted: 2002-11-07 16:57:20   Link

On Thursday 07 November 2002 04:51 pm, Dan Neuman wrote:

> I have a question for the SQL Server remote view gurus.

Only if someone tells me why my combobox isn't working <g>...

> I need to create a remote view to a SQL database, and in the where clau=

se

> I would like to provide a list of values. And if the field matches one

> of those values, then return the record.

>

>

> Is there a way to do that?

>

>

> Something like:

> Local vp_List

> vp_List =3D ["A","B","C"]

> Use RemoteViewName

>

>

>

> Remote View SQL Statement:

> Select Table.* from dbo.Tablename where inlist(Tablename.Field, ?vp_Lis=

t)

try this (works with spt, not sure about remote views):

private vp_List

vp_list =3D [("A","B","C")]

* remote view:

select table.* from dbo.tablename where tablename.field in ?vp_list

--=20

Paul McNett - p@ulmcnett.com

Hollister, California, USA

©2002 Paul McNett
Back to top
RE: Remote View Inlist Parameterized where clause

Author: Dan Neuman

Posted: 2002-11-07 17:54:01   Link

Paul,

Thanks for your reply, I have already tried it, and I get the following

Error message when I try to open the view.

"Connectivity error: [Microsoft][ODBC SQL Server Driver]

[SQL Server]Line 1:Incorrect syntax near '@P1'."

Does this make sense to anyone?

Here is the actual Remote View generation script.

*********** View Definition

CREATE SQL VIEW "PCVPRJTemp" ;

REMOTE CONNECTION "pcadata" ;

AS select pcaprj.* ;

from dbo.pcaprj ;

where pcaprj.cprjid in ?vp_clist

=DBSetProp('PCVPRJTemp', 'View', 'UpdateType', 1)

=DBSetProp('PCVPRJTemp', 'View', 'WhereType', 4)

=DBSetProp('PCVPRJTemp', 'View', 'FetchMemo', .T.)

=DBSetProp('PCVPRJTemp', 'View', 'SendUpdates', .T.)

=DBSetProp('PCVPRJTemp', 'View', 'UseMemoSize', 255)

=DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

=DBSetProp('PCVPRJTemp', 'View', 'MaxRecords', -1)

=DBSetProp('PCVPRJTemp', 'View', 'Tables', 'dbo.pcaprj')

=DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

=DBSetProp('PCVPRJTemp', 'View', 'Comment', "")

=DBSetProp('PCVPRJTemp', 'View', 'BatchUpdateCount', 1)

=DBSetProp('PCVPRJTemp', 'View', 'ShareConnection', .T.)

=DBSetProp('PCVPRJTemp', 'View', 'Prepared', .F.)

=dbsetprop('pcvprjtemp', 'view', 'parameterlist', "vp_clist,'c'")

=DBSetProp('PCVPRJTemp', 'View', 'CompareMemo', .T.)

=DBSetProp('PCVPRJTemp', 'View', 'FetchAsNeeded', .F.)

**************** End of View Definition

Then I try to use the view with:

Public vp_cList

vp_cList = [("SP","SC","CA")] && Which I know are in the data.

USE PCAView!PcvPrjTemp && This is where I get the connectivity error.

***************************

Thanks for your help.

Dan Neuman

-----Original Message-----

From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Paul McNett

Sent: Thursday, November 07, 2002 4:57 PM

To: Multiple recipients of ProFox

Subject: Re: Remote View Inlist Parameterized where clause

On Thursday 07 November 2002 04:51 pm, Dan Neuman wrote:

> I have a question for the SQL Server remote view gurus.

Only if someone tells me why my combobox isn't working <g>...

> I need to create a remote view to a SQL database, and in the where clause

> I would like to provide a list of values. And if the field matches one

> of those values, then return the record.

>

>

> Is there a way to do that?

>

>

> Something like:

> Local vp_List

> vp_List = ["A","B","C"]

> Use RemoteViewName

>

>

>

> Remote View SQL Statement:

> Select Table.* from dbo.Tablename where inlist(Tablename.Field, ?vp_List)

try this (works with spt, not sure about remote views):

private vp_List

vp_list = [("A","B","C")]

* remote view:

select table.* from dbo.tablename where tablename.field in ?vp_list

--

Paul McNett - p@ulmcnett.com

Hollister, California, USA

©2002 Dan Neuman
Back to top
RE: Remote View Inlist Parameterized where clause

Author: Dan Neuman

Posted: 2002-11-07 21:14:33   Link

Mike,

Thanks for the reply.

tried that. same error message.

-----Original Message-----

From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Mike McCann

Sent: Thursday, November 07, 2002 8:11 PM

To: Multiple recipients of ProFox

Subject: Re: Remote View Inlist Parameterized where clause

Dan Neuman <dneuman@pclv.com> wrote:

[("SP","SC","CA")]

try

[('SP','SC','CA')]

SQL Server does not like double quotes

--

Mike

|| Paul,

|| Thanks for your reply, I have already tried it, and I get the

|| following Error message when I try to open the view.

||

|| "Connectivity error: [Microsoft][ODBC SQL Server Driver]

|| [SQL Server]Line 1:Incorrect syntax near '@P1'."

||

|| Does this make sense to anyone?

||

||

|| Here is the actual Remote View generation script.

|| *********** View Definition

|| CREATE SQL VIEW "PCVPRJTemp" ;

|| REMOTE CONNECTION "pcadata" ;

|| AS select pcaprj.* ;

|| from dbo.pcaprj ;

|| where pcaprj.cprjid in ?vp_clist

||

|| =DBSetProp('PCVPRJTemp', 'View', 'UpdateType', 1)

|| =DBSetProp('PCVPRJTemp', 'View', 'WhereType', 4)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchMemo', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'SendUpdates', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'UseMemoSize', 255)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'MaxRecords', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'Tables', 'dbo.pcaprj')

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'Comment', "")

|| =DBSetProp('PCVPRJTemp', 'View', 'BatchUpdateCount', 1)

|| =DBSetProp('PCVPRJTemp', 'View', 'ShareConnection', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'Prepared', .F.)

|| =dbsetprop('pcvprjtemp', 'view', 'parameterlist', "vp_clist,'c'")

|| =DBSetProp('PCVPRJTemp', 'View', 'CompareMemo', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchAsNeeded', .F.)

|| **************** End of View Definition

||

|| Then I try to use the view with:

|| Public vp_cList

|| vp_cList = [("SP","SC","CA")] && Which I know are in the data.

|| USE PCAView!PcvPrjTemp && This is where I get the connectivity

|| error. ***************************

||

|| Thanks for your help.

|| Dan Neuman

||

|| -----Original Message-----

|| From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Paul

|| McNett Sent: Thursday, November 07, 2002 4:57 PM

|| To: Multiple recipients of ProFox

|| Subject: Re: Remote View Inlist Parameterized where clause

||

||

|| On Thursday 07 November 2002 04:51 pm, Dan Neuman wrote:

||

||| I have a question for the SQL Server remote view gurus.

||

|| Only if someone tells me why my combobox isn't working <g>...

||

||

||| I need to create a remote view to a SQL database, and in the where

||| clause I would like to provide a list of values. And if the field

||| matches one of those values, then return the record.

|||

|||

||| Is there a way to do that?

|||

|||

||| Something like:

||| Local vp_List

||| vp_List = ["A","B","C"]

||| Use RemoteViewName

|||

|||

|||

||| Remote View SQL Statement:

||| Select Table.* from dbo.Tablename where inlist(Tablename.Field,

||| ?vp_List)

||

|| try this (works with spt, not sure about remote views):

||

|| private vp_List

|| vp_list = [("A","B","C")]

||

|| * remote view:

|| select table.* from dbo.tablename where tablename.field in ?vp_list

||

|| --

|| Paul McNett - p@ulmcnett.com

|| Hollister, California, USA

||

©2002 Dan Neuman
Back to top
Re: Remote View Inlist Parameterized where clause

Author: Mike McCann

Posted: 2002-11-07 22:11:01   Link

Dan Neuman <dneuman@pclv.com> wrote:

[("SP","SC","CA")]

try

[('SP','SC','CA')]

SQL Server does not like double quotes

--

Mike

|| Paul,

|| Thanks for your reply, I have already tried it, and I get the

|| following Error message when I try to open the view.

||

|| "Connectivity error: [Microsoft][ODBC SQL Server Driver]

|| [SQL Server]Line 1:Incorrect syntax near '@P1'."

||

|| Does this make sense to anyone?

||

||

|| Here is the actual Remote View generation script.

|| *********** View Definition

|| CREATE SQL VIEW "PCVPRJTemp" ;

|| REMOTE CONNECTION "pcadata" ;

|| AS select pcaprj.* ;

|| from dbo.pcaprj ;

|| where pcaprj.cprjid in ?vp_clist

||

|| =DBSetProp('PCVPRJTemp', 'View', 'UpdateType', 1)

|| =DBSetProp('PCVPRJTemp', 'View', 'WhereType', 4)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchMemo', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'SendUpdates', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'UseMemoSize', 255)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'MaxRecords', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'Tables', 'dbo.pcaprj')

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchSize', -1)

|| =DBSetProp('PCVPRJTemp', 'View', 'Comment', "")

|| =DBSetProp('PCVPRJTemp', 'View', 'BatchUpdateCount', 1)

|| =DBSetProp('PCVPRJTemp', 'View', 'ShareConnection', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'Prepared', .F.)

|| =dbsetprop('pcvprjtemp', 'view', 'parameterlist', "vp_clist,'c'")

|| =DBSetProp('PCVPRJTemp', 'View', 'CompareMemo', .T.)

|| =DBSetProp('PCVPRJTemp', 'View', 'FetchAsNeeded', .F.)

|| **************** End of View Definition

||

|| Then I try to use the view with:

|| Public vp_cList

|| vp_cList = [("SP","SC","CA")] && Which I know are in the data.

|| USE PCAView!PcvPrjTemp && This is where I get the connectivity

|| error. ***************************

||

|| Thanks for your help.

|| Dan Neuman

||

|| -----Original Message-----

|| From: profox@leafe.com [mailto:profox@leafe.com]On Behalf Of Paul

|| McNett Sent: Thursday, November 07, 2002 4:57 PM

|| To: Multiple recipients of ProFox

|| Subject: Re: Remote View Inlist Parameterized where clause

||

||

|| On Thursday 07 November 2002 04:51 pm, Dan Neuman wrote:

||

||| I have a question for the SQL Server remote view gurus.

||

|| Only if someone tells me why my combobox isn't working <g>...

||

||

||| I need to create a remote view to a SQL database, and in the where

||| clause I would like to provide a list of values. And if the field

||| matches one of those values, then return the record.

|||

|||

||| Is there a way to do that?

|||

|||

||| Something like:

||| Local vp_List

||| vp_List = ["A","B","C"]

||| Use RemoteViewName

|||

|||

|||

||| Remote View SQL Statement:

||| Select Table.* from dbo.Tablename where inlist(Tablename.Field,

||| ?vp_List)

||

|| try this (works with spt, not sure about remote views):

||

|| private vp_List

|| vp_list = [("A","B","C")]

||

|| * remote view:

|| select table.* from dbo.tablename where tablename.field in ?vp_list

||

|| --

|| Paul McNett - p@ulmcnett.com

|| Hollister, California, USA

||

©2002 Mike McCann
Back to top
Re: Remote View Inlist Parameterized where clause

Author: Mike McCann

Posted: 2002-11-08 08:20:19   Link

Dan

The only way I can make it work is like this.

pcparam = [ ( 'Berlin','London','Madrid' ) ]

? sqlexec(1,[SELECT * FROM customers WHERE city IN ] + pcparam ,[c1])

Mike

©2002 Mike McCann