[V4MD] SELECT with AND syntax

Florian Bogeschdorfer fb at memedia.de
Sat Sep 20 13:33:47 CDT 2008


"HI" is a string and my guess would be to put it in '' :

... ='HI')"

best

Florian Bogeschdorfer
——————————————————————————————
e-mail  fb at memedia.de 
fon(E)  +34 680 75 19 77 (nur bei Aufenthalt in Spanien)
fon(D)  +49 173 58 44 26 0 (nur bei Aufenthalt außerhalb Spaniens)
skype   florian.bogeschdorfer
skype.in  +49 561 98 77 84 0
——————————————————————————————
m e m e d i a
Agentur für Neue Medien
Weinbauernstraße 12a
D-81539 München 

e-mail         info at memedia.de
fon            089 – 21 90 98 0 - 0 
fon direct     089 – 21 90 98 0 - 16 
fax            089 – 21 90 98 0 – 99
—————————————————————————————


>-----Original Message-----
>From: valentina-bounces at lists.macserve.net [mailto:valentina-
>bounces at lists.macserve.net] On Behalf Of Irv Kalb
>Sent: Saturday, September 20, 2008 8:29 PM
>To: Valentina Developers
>Subject: [V4MD] SELECT with AND syntax
>
>Hi,
>
>I need help with SQL syntax on what should be a simple SELECT
>statement.  I want to select all records from a table where one field
>equals one value and another field equals another value,  The value
>of the first field may have spaces in it, and I found though
>experimentation that I need to enclose such fields with single quote
>characters.  Here's what I am trying:
>
>on mMatchLabelAndMovie me, theCurrentLabel, theCurrentMovie
>
>   cursor = poDB.SqlQuery("SELECT * FROM Main where (FrameLabel = " &
>"'" & theCurrentLabel & "'" & ")" & " AND (MovieName = " &
>theCurrentMovie & ")")
>
>...
>end
>
>The specific query string that gets built from the first time this is
>called is this:
>
>"SELECT * FROM Main where (FrameLabel = '#E1_Goals: The Presence of
>the Past') AND (MovieName = HI)"
>
>This looks right to me, the values are exactly what I want to find,
>and I know that there is a single record that matches this criteria.
>
>But when I execute this, I get back this:
>
>[#errNumber: 333056, #errNumberHex: "0x51500", #errString:
>"Identifier "HI" is not found."]
>
>I'm hoping that someone can tell me what's wrong with my SQL syntax here.
>
>If it helps, I'm trying to convert this from V12, and my calls to get
>this information from V12 were like this:
>
>   --  mSetCriteria(pxTableMain, "FrameLabel", "=", theCurrentLabel)
>   --  CheckV12Error()
>   --  mSetCriteria(pxTableMain, "and", "MovieName", "=", theCurrentMovie)
>   --  CheckV12Error()
>   --  mSelect(pxTableMain)
>   --  CheckV12Error()
>
>
>Thanks,
>
>Irv
>
>--
>
>Multimedia R Us
>_______________________________________________
>Valentina mailing list
>Valentina at lists.macserve.net
>http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list