? in primary key
Hello! I have a table with one field that is a varchar & primary key. Can the ? be added/updated/deleted to this varchar primary key? Thank you for your help. Sincerely, Tiffany __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ? in primary key
Hello, It seems that the following preparedStatement is changing the character ? to null. PreparedStatement selectLocation = conn.prepareStatement("select location, addressLine1, addressLine2, addressLine3, addressLine4, addressLine5, addressLine6, addressLine7, addressLine8, addressLine9, addressLine10, uniqueNumber from location WHERE region = "testing?" order by location ASC"); ResultSet resultLocation = selectLocation.executeQuery(); The region "testing" will become "testingnull" before the preparedStatement is executed. How can I reform this preparedStatement to work? Thanks. Sincerely, Tiffany --- Paul DuBois <[EMAIL PROTECTED]> wrote: > At 7:37 -0800 1/28/02, Tiffany C. wrote: > > > >Hello! > > > >I have a table with one field that is a varchar & > >primary key. Can the ? be added/updated/deleted to > >this varchar primary key? > > What does this mean? You want to add a literal "?" > character to the > end of the column value? > > > > >Thank you for your help. > > > >Sincerely, > >Tiffany __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ? in primary key
Hello Paul, Thanks for your help! The new preparedStatement that you sent works. Sincerely, Tiffany --- Paul DuBois <[EMAIL PROTECTED]> wrote: > At 8:52 -0800 1/28/02, Tiffany C. wrote: > >Hello, > > > >It seems that the following preparedStatement is > >changing the character ? to null. > > > >PreparedStatement selectLocation = > >conn.prepareStatement("select location, > addressLine1, > >addressLine2, addressLine3, addressLine4, > >addressLine5, addressLine6, addressLine7, > >addressLine8, addressLine9, addressLine10, > >uniqueNumber from location WHERE region = > "testing?" > >order by location ASC"); > >ResultSet resultLocation = > >selectLocation.executeQuery(); > > > >The region "testing" will become "testingnull" > before > >the preparedStatement is executed. How can I > reform > >this preparedStatement to work? > > ? signifies a placeholder. Either use a Statement > object instead > of a PreparedStatement object, or rewrite your code > like this: > > PreparedStatement selectLocation = > conn.prepareStatement("select location, > addressLine1, > addressLine2, addressLine3, addressLine4, > addressLine5, addressLine6, addressLine7, > addressLine8, addressLine9, addressLine10, > uniqueNumber from location WHERE region = ? > order by location ASC"); > > selectLocation.setString(1, "testing?"); > > ResultSet resultLocation = > selectLocation.executeQuery(); > > > > > >Thanks. > > > >Sincerely, > >Tiffany > __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php