Solved

Query Parameter for Oracle thru VB.net

Posted on 2006-07-06
2
1,126 Views
Last Modified: 2008-03-17
Hi,

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.

Thanks,
Dee
0
Comment
Question by:dpozega
2 Comments
 
LVL 25

Expert Comment

by:jrb1
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;
0
 
LVL 14

Accepted Solution

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

0

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

776 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