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 8993021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:06:01+00:00 2026-06-15T23:06:01+00:00

So here is my code: CREATE OR REPLACE PROCEDURE UPDATE_USER ( updateColumn IN USERS.column_name%type,

  • 0

So here is my code:

CREATE OR REPLACE PROCEDURE UPDATE_USER
(
  updateColumn IN USERS.column_name%type,
  changeStr IN VARCHAR2,
  unID IN VARCHAR2
)
IS
BEGIN
  EXECUTE IMMEDIATE
    'UPDATE
      users
    SET :1 = :2
    WHERE
      uniqueID = :3'
  USING updateColumn, changeStr, unID; 
END;
/

I’ve searched for other answers on this and as far as I can tell this should work. However I get the error:
‘Error(3,25): PLS-00302: component ‘COLUMN_NAME’ must be declared’

Thanks.

  • 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-15T23:06:02+00:00Added an answer on June 15, 2026 at 11:06 pm

    The error message specifies line 3, character 25, which points to column_name in the declaration of the updateColumn parameter. It appears that you are trying to pass the column name to update as a parameter, but that means that at compile time the column isn’t known, so its type can’t be known. This also doesn’t really make sense – if it’s a number column then you’d be trying to pass the column name into a numeric parameter, which wouldn’t work anyway. If you don’t want to declare it as a simple varchar2, you could instead use user_tab_columns.column_name%type.

    But you can’t dynamically set the column name in the update statement using a bind variable. It would compile, but would get an ORA-01747 on execution from the apparent name starting with a colon. You’d need to concatenate it, something like:

    CREATE OR REPLACE PROCEDURE UPDATE_USER
    (
      updateColumn IN user_tab_columns.column_name%type,
      changeStr IN VARCHAR2,
      unID IN VARCHAR2
    )
    IS
    BEGIN
      EXECUTE IMMEDIATE
        'UPDATE
          users
        SET ' || updateColumn || ' = :1
        WHERE
          uniqueID = :2'
      USING changeStr, unID; 
    END;
    /
    

    But you’d need to sanitise the column name to avoid SQL injection. APC’s answer to the question you linked to mentions using the DBMS_ASSERT package, for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code I'm trying to get working to no avail: CREATE DEFINER=`auser`@`localhost` PROCEDURE
Here is my procedure and it works through PL/SQL Developer: create or replace procedure
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here's some basic code to create a ListViewGroup, add it to the Groups collection
Here is the code I have to create an UIAlertView with a textbox. UIAlertView
Here's the code I'm using: // create a request HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
Here is the code, I defined two class named Father and Son, and create
So, first off here's my code to open the dotx and create a new
I want to create a dynamic Expression<Func<T,Y>> . Here is the code which works
Here is the javascript code I use to create the array and send it

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.