> >
> > Surinder had the right direction. You are using single quotes throughout. For your "CHATROOM" string literal, use double quotes"
> >
> > _SQL = 'SELECT * FROM TRN1250 WHERE UPPER( ProName ) = "CHATROOM" '
> >
> >
> > Note the way I add spaces in this command - makes it easier to spot this kind of error.
> >
> > Ken
> > You shall know the truth - and the truth shall set you free. (John 8:33)
>
> Ken,
> Using parameters is the way to go IMHO. FOr example if backend was SQL server this 'corrected' version would fail. You need single quotes for string constants. I don't know if Oracle accepts double quotes. It's better not to think of what provider support is and use parameters IMHO.
>
> Cetin Basoz
I stand corrected. This should work though:
_SQL = "SELECT * FROM TRN1250 WHERE UPPER( ProName ) = 'CHATROOM' "
My preference would be similar to yours:
LOCAL lnHndl AS Integer, ;
lcTextVar AS Character, ;
lnResult AS Integer, ;
lcSQL AS Character
lnHndl = SQLCONNECT(...)
lcTextVar = "CHATROOM"
TEXT TO lcSQL NOSHOW TEXTMERGE PRETEXT 15
SELECT * FROM TRN1250 WHERE UPPER( ProName ) = << lcTextVar >>
ENDTEXT
lnResult = SQLEXEC(lnHndl,lcSQL,"MyResultCursor")
Ken
You shall know the truth - and the truth shall set you free. (John 8:33)