Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Extracting data from an Oracle database using TableAdapters

Reply
Thread Tools

Extracting data from an Oracle database using TableAdapters

 
 
Steve Kershaw
Guest
Posts: n/a
 
      11-09-2006
I have a need to extract data from an Oracle database using an SQL
query. The problem is that I need to insert a parameter into the query.
For example:

SELECT EMPLOYEE, DED_CODE FROM QUARTDED WHERE STATE = @STATE

The problem is that the "@STATE" Dosen't work. When I try to execute
the query in Query Builder I get a Invalid column error.

Further the query changes from WHERE STATE = @STATE to WHERE STATE =
"@STATE".

I'm a SQL Server guy and this works on SQL Server 2005. Can anybody
help please!

 
Reply With Quote
 
 
 
 
asflp
Guest
Posts: n/a
 
      11-09-2006
Hi Steve

Oracle uses a colon to bind variables, try substituting a colon for the
@ sign.


Steve Kershaw wrote:
> I have a need to extract data from an Oracle database using an SQL
> query. The problem is that I need to insert a parameter into the query.
> For example:
>
> SELECT EMPLOYEE, DED_CODE FROM QUARTDED WHERE STATE = @STATE
>
> The problem is that the "@STATE" Dosen't work. When I try to execute
> the query in Query Builder I get a Invalid column error.
>
> Further the query changes from WHERE STATE = @STATE to WHERE STATE =
> "@STATE".
>
> I'm a SQL Server guy and this works on SQL Server 2005. Can anybody
> help please!


 
Reply With Quote
 
 
 
 
Steve Kershaw
Guest
Posts: n/a
 
      11-09-2006
Thanks that worked just fine!!!

Steve

asflp wrote:
> Hi Steve
>
> Oracle uses a colon to bind variables, try substituting a colon for the
> @ sign.
>
>
> Steve Kershaw wrote:
> > I have a need to extract data from an Oracle database using an SQL
> > query. The problem is that I need to insert a parameter into the query.
> > For example:
> >
> > SELECT EMPLOYEE, DED_CODE FROM QUARTDED WHERE STATE = @STATE
> >
> > The problem is that the "@STATE" Dosen't work. When I try to execute
> > the query in Query Builder I get a Invalid column error.
> >
> > Further the query changes from WHERE STATE = @STATE to WHERE STATE =
> > "@STATE".
> >
> > I'm a SQL Server guy and this works on SQL Server 2005. Can anybody
> > help please!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
tableadapters and database default values neilmcguigan@gmail.com ASP .Net 0 06-14-2006 09:47 PM
Preferred way to do "update row, or insert if it doesn't exist" using TableAdapters in dataset designer H5N1 ASP .Net 1 04-12-2006 06:03 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM



Advertisments