473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

iSQL*Plus bug with substitution variable?! (9.2.0.1.0)

I am trying to learn iSQL*Plus for the 1Z0-007 exam. I am having a bit of
problems with the substitution variables. My understanding was that they
behave as in SQL*Plus, but my experiments beg to differ.

I log on to the sample schema 'hr' and enter the following statements:

-- statements begin
set verify on
define name = K%

select last_name
from employees
where last_name like '&name'
-- statements end

When I click the 'Execute'-button, I am prompted for the value of the 'name'
substitution variable. Regardless of what I enter, the result is:

-- iSQL*Plus output begin
old 3: where last_name like '&name'
new 3: where last_name like 'K%'
LAST_NAME
King
Kochhar
Khoo
Kaufling
King
Kumar

6 rows selected.
-- iSQL*Plus output end

So my entered value is discarded and the value explicitly defined is always
used, very strange! When executing the same statements in SQL*Plus, a prompt
does not appear.

I tried a few other experiments which showed other differences between
iSQL*Plus and SQL*Plus, so my question is: "Should iSQL*Plus and SQL*Plus
behave the same or are there subtle differences?". If this is a bug, how do
I report it to Oracle?

Best regards,
Jacob Grydholt Jensen

Jul 19 '05 #1
1 5125
"Jacob Grydholt Jensen .dk>" <jacob@rgrydholt.<REMOVE> wrote in message
news:40*********************@dread11.news.tele.dk. ..
| I am trying to learn iSQL*Plus for the 1Z0-007 exam. I am having a bit of
| problems with the substitution variables. My understanding was that they
| behave as in SQL*Plus, but my experiments beg to differ.
|
| I log on to the sample schema 'hr' and enter the following statements:
|
| -- statements begin
| set verify on
| define name = K%
|
| select last_name
| from employees
| where last_name like '&name'
| -- statements end
|
| When I click the 'Execute'-button, I am prompted for the value of the
'name'
| substitution variable. Regardless of what I enter, the result is:
|
| -- iSQL*Plus output begin
| old 3: where last_name like '&name'
| new 3: where last_name like 'K%'
|
|
| LAST_NAME
| King
| Kochhar
| Khoo
| Kaufling
| King
| Kumar
|
| 6 rows selected.
| -- iSQL*Plus output end
|
| So my entered value is discarded and the value explicitly defined is
always
| used, very strange! When executing the same statements in SQL*Plus, a
prompt
| does not appear.
|
| I tried a few other experiments which showed other differences between
| iSQL*Plus and SQL*Plus, so my question is: "Should iSQL*Plus and SQL*Plus
| behave the same or are there subtle differences?". If this is a bug, how
do
| I report it to Oracle?
|
| Best regards,
| Jacob Grydholt Jensen
|
|
|

interesting...

in standard sql*plus (which i'm pretty sure is invoked, or pipe to, by
iSQL*Plus) pre-defined variables are not prompted for

so, i'd say remove the DEFINE and you'll be ok (seems like a bug to me, but
have not researched)

if you're looking for a default value for &name, then use NVL() in your
WHERE clause (you'll most likely need the UPPER function, too), ie:

select last_name
from employees
where last_name like nvl(upper('&name'),'K%')

;-{ mcs
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rui Cunha | last post by:
Hi, i'm having some problems at work with isql*plus in what concerns with session timeouts... here is the scenario: a class with 30/40 students working on PL/SQL and requesting the database...
2
by: Ant | last post by:
Hi, I have an SQL assignment to do and at my school we use SQL *Plus there however I don't have Oracle at home, where I would like to do the work ,so I was wondering whats the easiest way to get...
4
by: sukh | last post by:
we have to enter URL address of the iSQL*Plus.i have gone into http.cof file but didn't file hostname how it is written in that file. i have port number 7778.the how to find the name of computer....
7
by: samayjain | last post by:
Dear , Please let me know the correct answer for the following 1.Which three statements about subqueries are true? (Choose three.) A. A single row subquery can retrieve only one column and...
2
by: subbarao1955 | last post by:
Hi If any body help me , what is the meaning of @@ in Oracle. regards SubbaRao
1
by: Jacob Grydholt Jensen | last post by:
I am trying to learn iSQL*Plus for the 1Z0-007 exam. I am having a bit of problems with the substitution variables. My understanding was that they behave as in SQL*Plus, but my experiments beg to...
4
by: mndprasad | last post by:
I am creating a jsp application . . . .I am retreiving some values from my database oracle 10g..my query taking time to execute even in isql plus..am uisng tomcat5 and oracle 10gR2..can anyone pls...
0
by: NewToOracle | last post by:
Hi All, Can anybody guide me for how to access isql* plus host variable and assigning them to the variable declared in PL/SQL ..?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.