Mailing List Archive



Back to the month index Back to the list index

Anderson, Hans (hans@marsweb.com)
Mon, 09 Sep 1996 08:08:55 -0700


Message-Id: <32343307.E36@marsweb.com>
Date: Mon, 09 Sep 1996 08:08:55 -0700
From: "Anderson, Hans" <hans@marsweb.com>
Subject: Re: [mSQL] mSQL/Java Query Exception

bonsai@net5.co.jp wrote:
>
> My first attempt at using the Java/mSQL programming interface isn't going as
> planned.
>
> I execute the following :
>
> result = msql.Query("insert into cdiusers
> values (nameval, emailval, usernameval, passwdval,
> URLval)");
>
> Which appears to be a valid SQL Statement to me, but it throws the exception :
>
> oops: QUERY: QUERY: :syntax error near "nameval"
>
> The variables I'm trying to insert are strings, and they are being inserted
> into character fields within the database. I've stared at it long enough,
> maybe I'm just overlooking something obvious ?
>
> Any hints?
>
> Byron (a.k.a Bonsai)
>
> - who thought Java was going to be a problem, not SQL.

Actually, perhaps it is you. I may be wrong (it's Monday, and I'm
starting off with a fresh quota), but you may need to enclose those
string inserts with a '. Try:

result = msql.Query("insert into cdiusers values
('nameval','emailval','usernameval','passwdval',
                                 'URLval')");

Hans

-- 
Hans Anderson  -- Hans Anderson  -- M@RSweb 
hans@marsweb.com -- eieio@marsweb.com
http://www.marsweb.com | http://www.ism.net
(406) 721-MARS | 288 Expressway | Missoula, MT  59802

Too much of a good thing makes it a great thing -------------------------------------------------------------------------- To remove yourself from the Mini SQL mailing list send a message containing "unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing "info msql-list" to majordomo@bunyip.com for info on monthly archives of the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!