AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PreparedStatement

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Roedy Green
Guest





PostPosted: Sat Jun 12, 2004 3:45 am    Post subject: PreparedStatement Reply with quote



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?

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Back to top
Joe Weinstein
Guest





PostPosted: Sat Jun 12, 2004 6:09 am    Post subject: Re: PreparedStatement Reply with quote





Roedy Green wrote:

Quote:
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



Back to top
Chuck Simpson
Guest





PostPosted: Sat Jun 12, 2004 6:11 pm    Post subject: Re: PreparedStatement Reply with quote



On Sat, 12 Jun 2004 03:45:33 +0000, Roedy Green wrote:

Quote:
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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.