Hi,

Have you tried putting the <@getparam scid> in a variable and use the
variable in the sql statement with encoding=sql?

Ted

-----Original Message-----
From: Dale Graham [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 08, 2004 8:42 AM
To: Witango-Talk list
Cc: Mike Arace
Subject: Witango-Talk: SQL question in Witango


We tried to run a fairly complex SQL statement in direct DBMS, but were  
having a problem with the quoting and couldn't figure out where we were  
going astray. (Tip, the quotes occur at the very end of the statement.)

We tried using single quotes (they ended up being single quoted, so we  
ended up with double single quotes, and an error); using the <@sq> tag,  
same error as before, and no quotes (invalid column name error) ...

How can we correctly specify the quotes in a direct DBMS statement?

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

select distinct queryscid, SCID, FNAME, MNAME, LNAME, SUFFIX, DEGREE,
ADDRESS1, SCIONAME, I_E, ORID, ONAME, ABBREV  from ( SELECT S1.SCID
queryscid,
P1.SCID,S2.FNAME,S2.MNAME,S2.LNAME,S2.SUFFIX,S2.DEGREE,S2.ADDRESS1,S2.ON 
AME
scioname,S2.I_E,O3.ORID,O3.ONAME,O3.ABBREV
     FROM NSD.PUID_ORID_SCID P1,NSD.SCIENTISTS S2, NSD.ORGS O3,
NSD.SCIENTISTS S1
     WHERE (P1.PUID in (
         SELECT PUID
             FROM NSD.PUID_ORID_SCID
             WHERE (SCID=S1.SCID)
         )
     AND P1.SCID <> S1.SCID) AND ((O3.ORID=P1.ORID) AND  
(S2.SCID=P1.SCID))

UNION

SELECT S1.SCID queryscid,
I1.SCID,S2.FNAME,S2.MNAME,S2.LNAME,S2.SUFFIX,S2.DEGREE,S2.ADDRESS1,S2.ON 
AME
scioname,S2.I_E,O3.ORID,O3.ONAME,O3.ABBREV
     FROM NSD.IPID_ORID_SCID I1,NSD.SCIENTISTS S2,NSD.ORGS O3,  
NSD.SCIENTISTS
S1
     WHERE (I1.IPID in (
         SELECT IPID
             FROM NSD.IPID_ORID_SCID
             WHERE (SCID=S1.SCID)
         )
     AND I1.SCID <> S1.SCID) AND ((O3.ORID=I1.ORID) AND  
(S2.SCID=I1.SCID))
) where queryscid = '<@getparam scid>'

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to