Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: "?" in select statement
jabailo_at_earthlink.net (john bailo) wrote in message news:<64fd0169.0206121404.30eec282_at_posting.google.com>...
> is the "?" a valid character in PL/SQL ?
>
Not usually. The is a variable substitution character in SQLPlus,
which is normally the '&', but you can change it with the 'set define
command'. When plsql is ran from sqlplus the ambersand variables are
prompted for and the value substituted into the text string before
SQLPlus processes them or passes them to the plsql engine.
> for instance, is this valid in oracle
>
> Select * from MyTable Where TableID = ?
>
Normally I would expect to see something like:
select * from MyTable where Tableid = '&variable'
varchar2 and char column datatypes values would be in sigle quotes
while numbers do not need them
>
> how about in jdbc, java.sql?
>
> i see it used in a java class file, but i cant understand how it could work
> for ms/sql
I have no idea about this last item.
I hope this helps, but if this is not the case you might try posting the code along with information on the Oracle version.