> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:perl-
> [EMAIL PROTECTED] On Behalf Of Hsu, David
> Sent: Wednesday, October 12, 2005 09:18
> To: $Bill Luebkert
> Cc: [email protected]
> Subject: RE: escaping characters
>
> I used the html syntax: '<' for <,
> But used just '>' and it produced the results that I was looking for:
> '<tag>'
> Using '>' for '>' also works. ????
>
>
> $SQL = " SELECT ParameterValues.ParameterValue
> FROM Targets INNER JOIN (PrintSamples INNER JOIN
> ((DigitalImages INNER JOIN
> PrintSampleAnalyses ON DigitalImages.ImageID =
> PrintSampleAnalyses.ImageID) INNER JOIN
> (Measurements INNER JOIN ParameterValues ON
> Measurements.MeasurementID = ParameterValues.MeasurementID)
> ON PrintSampleAnalyses.psaID =
> Measurements.psaID) ON PrintSamples.PrintSampleID =
> DigitalImages.PrintSampleID)
> ON Targets.TargetID = Measurements.TargetID
> WHERE
> (((PrintSampleAnalyses.psaTicket)='$sessionID') AND
> ((PrintSamples.PrintCopyID)='$sampleID') AND
> ((Measurements.msmTag)='<tag>') AND
> ((Targets.TargetID)=187) AND ((ParameterValues.ParameterID)=31))";
>
>
>
> -----Original Message-----
> From: $Bill Luebkert [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 11, 2005 9:32 PM
> To: Hsu, David
> Cc: [email protected]
> Subject: Re: escaping characters
>
> Hsu, David wrote:
> > Hi all,
> > I'm having trouble formatting a SQL statement.
> > Here's what I have:
> > $SQL = " ...
> > ((Measurements.msmTag)=\'<tag>\')
> > AND(Targets.TargetID)=187) ...";
>
> "\'" is the same as "'".
>
> > When I do a screen print I get:
> > ... ((Measurements.msmTag)='<>') ...
> >
> > If I escape the <>
> > $SQL = " ...
> > ((Measurements.msmTag)=\'\<tag\>\')
> > AND(Targets.TargetID)=187) ...";
>
> Same with <>.
>
> > When I do a screen print I still get:
> > ... ((Measurements.msmTag)='<>') ...
> >
> > I tried this:
> > $SQL = " ...
> > ((Measurements.msmTag)=\'\<\ttag\>\')
> > AND(Targets.TargetID)=187) ...";
> >
> > When I do a screen print I get:
> > ... ((Measurements.msmTag)='< tag>') ...
>
> You added a tab in there.
>
> > Any insights would be appreciated.
>
> You stated a few observations, but what are you trying to do ?
>
> If you want a \ in there, just double it up "\\".
David,
David,
I was not able to duplicate the problem you're having. The following
code worked just fine.
====== begin source ===========
#!c:\perl\bin\perl.exe -w
use strict;
my $sessionID = 'foo';
my $sampleID = 'bar';
my $SQL = " SELECT ParameterValues.ParameterValue
FROM Targets INNER JOIN (PrintSamples INNER JOIN
((DigitalImages INNER JOIN
PrintSampleAnalyses ON DigitalImages.ImageID =
PrintSampleAnalyses.ImageID) INNER JOIN
(Measurements INNER JOIN ParameterValues ON
Measurements.MeasurementID = ParameterValues.MeasurementID)
ON PrintSampleAnalyses.psaID =
Measurements.psaID) ON PrintSamples.PrintSampleID =
DigitalImages.PrintSampleID)
ON Targets.TargetID = Measurements.TargetID
WHERE
(((PrintSampleAnalyses.psaTicket)='$sessionID') AND
((PrintSamples.PrintCopyID)='$sampleID') AND
((Measurements.msmTag)='<tag>') AND
((Targets.TargetID)=187) AND ((ParameterValues.ParameterID)=31))";
print ("\n\n", $SQL, "\n\n");
====== end source ===========
If you want the literal strings $sessionID and $sampleID to appear in
the output then you have to escape the $ so they wont be interpolated.
===== begin source ====
#!c:\perl\bin\perl.exe -w
use strict;
my $SQL = " SELECT ParameterValues.ParameterValue
FROM Targets INNER JOIN (PrintSamples INNER JOIN
((DigitalImages INNER JOIN
PrintSampleAnalyses ON DigitalImages.ImageID =
PrintSampleAnalyses.ImageID) INNER JOIN
(Measurements INNER JOIN ParameterValues ON
Measurements.MeasurementID = ParameterValues.MeasurementID)
ON PrintSampleAnalyses.psaID =
Measurements.psaID) ON PrintSamples.PrintSampleID =
DigitalImages.PrintSampleID)
ON Targets.TargetID = Measurements.TargetID
WHERE
(((PrintSampleAnalyses.psaTicket)='\$sessionID') AND
((PrintSamples.PrintCopyID)='\$sampleID') AND
((Measurements.msmTag)='<tag>') AND
((Targets.TargetID)=187) AND ((ParameterValues.ParameterID)=31))";
print ("\n\n", $SQL, "\n\n");
===== end source ====
keith
--
Keith R. Watson GTRI/ISD
Systems Support Specialist III Georgia Tech Research Institute
[EMAIL PROTECTED] Atlanta, GA 30332-0816
404-894-0836
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs