Extracting data from an Oracle database using TableAdapters

Discussion in 'ASP .Net' started by Steve Kershaw, Nov 9, 2006.

  1. 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!
     
    Steve Kershaw, Nov 9, 2006
    #1
    1. Advertising

  2. Steve Kershaw

    asflp Guest

    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!
     
    asflp, Nov 9, 2006
    #2
    1. Advertising

  3. 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!
     
    Steve Kershaw, Nov 9, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dbuchanan
    Replies:
    3
    Views:
    2,895
    dbuchanan
    Dec 16, 2005
  2. H5N1
    Replies:
    1
    Views:
    766
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2006
  3. Replies:
    0
    Views:
    340
  4. Vincent Le-Texier
    Replies:
    1
    Views:
    170
    Paul Lalli
    Dec 3, 2004
  5. Feyruz
    Replies:
    4
    Views:
    2,339
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page