Solved

Query Parameter for Oracle thru VB.net

Posted on 2006-07-06
2
1,124 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.

Join & Write a Comment

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 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

11 Experts available now in Live!

Get 1:1 Help Now