Solved

Query Parameter for Oracle thru VB.net

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

Suggested Solutions

Title # Comments Views Activity
Require data to appear on a single line 2 69
Create Index on a Materialized View 5 34
migration MS SQL database to Oracle 30 68
Oracle - Query link database loop 8 41
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

860 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