Make your own free website on Tripod.com

InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: single quote, double quotes frustration



Hi!

I'm struggling with my insert statement and I'm getting frustrated:

  String debugstmnt = "INSERT INTO lextable VALUES " + 
	"(" + eui + ",now,\'" + base + "\'," + "\'" + lexRec + "\')";

where base and lexRec might contain single quotes and double quotes as
well. What's the best way to handle that? I'm getting an error if I
delimit with one or the other: 

Enhydra InstantDB - Version 3.20 beta 1
The Initial Developer of the Original Code is Lutris Technologies Inc.
Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies, Inc.
All Rights Reserved.
.java.sql.SQLException: INSERT INTO lextable VALUES (EXXX9998,now,'sarah's cat','{base=sarah's cat
entry=EXXX9998
cat=noun
variants=reg
}')
 Don't understand SQL after: "INSERT"
 Expected: "}" found: "s"
	at org.enhydra.instantdb.db.SQLProg.execute(SQLProg.java:215)
	at org.enhydra.instantdb.jdbc.idbStatement.execute(idbStatement.java:235)
	at db.LexTable.tableInsert(LexTable.java:117)
	at db.LexTable.main(LexTable.java:71)
INSERT INTO lextable VALUES (EXXX9998,now,'sarah's cat','{base=sarah's cat
entry=EXXX9998
cat=noun
variants=reg
}')

or 

java.sql.SQLException: INSERT INTO lextable VALUES (EXXX9997,now,""cotton-roll" gingivitis","{base="cotton-roll" gingivitis
entry=EXXX9997
cat=noun
variants=glreg
variants=uncount
}")
 Don't understand SQL after: "INSERT"
 Expected: "}" found: "cotton"
	at org.enhydra.instantdb.db.SQLProg.execute(SQLProg.java:215)
	at org.enhydra.instantdb.jdbc.idbStatement.execute(idbStatement.java:235)
	at db.LexTable.tableInsert(LexTable.java:117)
	at db.LexTable.main(LexTable.java:71)
INSERT INTO lextable VALUES (EXXX9997,now,""cotton-roll" gingivitis","{base="cotton-roll" gingivitis
entry=EXXX9997
cat=noun
variants=glreg
variants=uncount
}")

Thanks,


-- 
                                          myriam

Go Proverb:

There are times when even a fight over nothing means something.
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.