Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL+ question

Re: SQL+ question

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 6 Jun 2006 09:27:58 -0800
Message-ID: <4485ad0e$1@news.victoria.tc.ca>


dean (deanbrown3d_at_yahoo.com) wrote:
: Hello all,

: 9.2i/10g on Windows.

: I use select statements in an application, which use bind variables.
: Sometimes I like to take a look at the result set by inspecting the sql
: string in the code at runtime and then pasting it into sql+. But I have
: to declare and assign the variables before I can run it:

: var Col1 number;
: exec :Col1 := 1234;
: select * from T where Col1 = :Col1;

: Is there a short cut to this? Is it possible to use 'USING' (or
: something else) here and not declare the variables?

One trick is to set up a test ahead of time and put that as a comment in the code with the sql. That doesn't help you this time, but if you figure out the bind variables then you can add that in for the next programmer. Even in things like forms and reports, you can embed all sorts of comments in the query itself. If that seems too odd then add a dummy function full of test cases as comments and include a reference to that in the sql.

Then just cut and paste the test code into sqlplus when you need it.

$0.10 Received on Tue Jun 06 2006 - 12:27:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US