Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread This query runs great until I use this parameter...
Tue, Feb 23 2016 5:58 PMPermanent Link

Allan Roberts


What is wrong with using the parameter ST2?  If I use a literal, then this query executes and returns the correct value in MVal.

Ref is a string parameter, all the others are integer type.

select Max(CAST(SubString(Ref From :ST2 for 20) as Integer)) as MVal from "MEMORY\AsmTest"  Where (Number = :Num) AND (LEFT(Ref for :ST) =  :Ref)

Aren't parms allowed within a substring function?  Thanks!
Wed, Feb 24 2016 11:26 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< What is wrong with using the parameter ST2?  If I use a literal, then this query executes and returns the correct value in MVal. >>

You can't use parameters in the SELECT clause, with the exception being sub-queries in a SELECT expression, where you *can* use parameters, but only in their JOIN/WHERE clauses.

Tim Young
Elevate Software
www.elevatesoft.com
Image