Query Parameter for Oracle thru

Posted on 2006-07-06
Last Modified: 2008-03-17

I am trying to convert a VB report written for SQL database to work against Oracle db.  The SQL db statement was:

select t1.a, t1.b, t2.c
from table1 t left outer join table2 t2 on t1.a=t2.a
where t1.a = @Parameter1

When I try to use the same syntax for the Oracle backend, I get a missing expression error, ORA-00936.  Is there an alternative way I have to define parameters for Oracle (rather than the @)?  

I did take case sensitivity into account for field names.

Question by:dpozega
LVL 25

Expert Comment

ID: 17053178
Where are you running this?  From a program, or just in SQL*PLUS?

If just in SQL*PLUS, then run:

select t1.a, t1.b, t2.c
from table1 t left outer join table2 t2 on t1.a=t2.a
where t1.a = &Parameter1;
LVL 14

Accepted Solution

sathyagiri earned 250 total points
ID: 17053274

select t1.a, t1.b, t2.c
from table1 t left outer join table2 t2 on t1.a=t2.a
where t1.a = :parameter1


Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now