Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / June 2004

Tip: Looking for answers? Try searching our database.

PreparedStatement

Thread view: 
Roedy Green - 12 Jun 2004 04:45 GMT
In PreparedStatement, are ? only for replacing data values is there
some way to use them to modify operators e.g. swap < for > or insert
keywords such as DESC?

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Joe Weinstein - 12 Jun 2004 07:09 GMT
> In PreparedStatement, are ? only for replacing data values is there
> some way to use them to modify operators e.g. swap < for > or insert
> keywords such as DESC?

Only for single data values. The intention is that the SQL be complete
enough that the DBMS can compile it and decide on the correct query plan
for repeated execution with whatever values are plugged in, like a stored
procedure with parameters. '?'s can't be used (though many try) to swap
in various parts of the actual SQL syntax, but this would define/alter the
query plan, so there would be no precompilation for reuse, so there would
be no advantage over simply constructing the SQL string at the client and
sending it fresh for every execution.
Joe Weinstein at BEA
Chuck Simpson - 12 Jun 2004 19:11 GMT
> In PreparedStatement, are ? only for replacing data values is there some
> way to use them to modify operators e.g. swap < for > or insert keywords
> such as DESC?

The bind markers, ?, are only for data values. They can be used in a
where clause, in a select expression list, on the RHS of a set expression
and in a procedure or function call for input values. Also as a function
return value marker and OUT parameter markers in stored function or
procedure calls. You have to register OUT parameters including any return
value in a stored procedure or function call so these are markers for
output data or input and output data if a parameter is IN OUT.

Chuck


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.