Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9139223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:21:35+00:00 2026-06-17T09:21:35+00:00

I have an Oracle 11g table with the following column names and types: ID

  • 0

I have an Oracle 11g table with the following column names and types:

ID VARCHAR2(32 BYTE)
VERSION VARCHAR2(12 BYTE)

I am trying to get bind variables to work in an Oracle parameterized command for Update statements on this table using ODP.NET and C#, but I’m having no luck. Here is the code I am using:

string constr = gconstr + "; Data Source=" + db;
OracleConnection con = new OracleConnection(constr);
con.Open();
ddiId = "WS_5043";
ddiVer = "1.0.3";

string UPDATE_CLOB_QUERY = "UPDATE :ddiTable SET version=:ddiVer WHERE id=:ddiId";

Oracle.DataAccess.Types.OracleXmlType ret;
OracleCommand oracleCommand2 = new OracleCommand(UPDATE_CLOB_QUERY, con);
oracleCommand2.Parameters.Clear();
oracleCommand2.Parameters.Add("ddiId", OracleDbType.Varchar2, ParameterDirection.Input).Value = ddiId;
oracleCommand2.Parameters.Add("ddiTable", OracleDbType.Varchar2, ParameterDirection.Input).Value = ddiTable;
oracleCommand2.Parameters.Add("ddiVer", OracleDbType.Varchar2, ParameterDirection.Input).Value = ddiVer;
oracleCommand2.ExecuteNonQuery();
oracleCommand2.Dispose();

When I run the above code in VS2010, I get the following Oracle error:

ORA-01036: illegal variable name/number

However, when I remove the bind variable declarations in the SQL then the above works i.e.

string UPDATE_CLOB_QUERY = "UPDATE wstable SET version='1.0.2' WHERE id='WS_5043'";

What am I doing wrong?

I need to know how to get bind variables and parameterized Oracle commands working with SQL Update commands such as the one above as a requirement, because I will begin eventually updating large clobs in other tables (and concatenating the clobs as strings in SQL will of course cause size limit errors). So getting this to work will be the first victory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:21:35+00:00Added an answer on June 17, 2026 at 9:21 am

    In this line;

    oracleCommand2.Parameters.Add("ddiTable", OracleDbType.Varchar2, ParameterDirection.Input).Value = ddiTable;
    

    You actually try to add as a parameter your table name (ddiTable). You can’t do that. And there is no point to add your query table name as a parameter. And If you want to use Parameters.Add() method with 3 parameters, you must use as parameters like;

    public OracleParameter Add(
        string parameterName,
        OracleType dataType,
        int size
    )
    

    That’s the only fits overloading method. There is no overloading for taking third parameter type of ParameterDirection.Input of Parameters.Add() method.

    I need to know how to get bind variables and parameterized Oracle
    commands working with SQL Update commands such as the one above as a
    requirement.

    May I suggest you to read these;

    • OracleCommand class from MSDN.
    • Oracle Update Statements
    • Oracle update SQL Tips
    • Sql Commands Update
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using oracle 11g sql developer I have a varchar2 column with dates as
We are using Oracle 11g and we have a table with a timestamp column
I have the following tables in Oracle 11g: Table A SITE_ID SITE_NAME VECTOR .........MANY
I work with Oracle 11g. I have one table: create table test (one number(2),
I have successfully installed Oracle 11g R2 version. I don't have good knowledge about
I have been trying to install Oracle 11g R2 on Centos 6.2 for a
I have a oracle table A which contains a column A.a which used to
I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table
We have an Oracle 11g database table with around 35 million rows. We are
I have a table, demo_fact in Oracle 11g and it has several virtual columns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.