Hardcoded columns 
Author Message
 Hardcoded columns
I have a table with different date columns, ex: c2000_02, c2000_03, ...
I have a program that has the columns hardcoded depending on which
column to update, ex: update table set c2000_02 = "xoxoxo"
Instead of hardcoding the column in the update statement, I'd like to
have the c2000_02 as a variable so the statement would look like:
     update table set variable = "xoxoxo"

Nick



Wed, 18 Jun 1902 08:00:00 GMT
 Hardcoded columns

Can't be done, but you can simulate it using the dbms_sql package.

Or it can be done by constructing the sql
declare
mysql varchar2(500);
begin
mysql:='update table tname set '||variable||'='''xoxoxo'''
dbms_utility.exec_ddl_statement(mysql);
end;
/

--
Robert Fazio, Oracle DBA

remove nospam from reply address
http://24.8.218.197/


Quote:
> I have a table with different date columns, ex: c2000_02, c2000_03, ...
> I have a program that has the columns hardcoded depending on which
> column to update, ex: update table set c2000_02 = "xoxoxo"
> Instead of hardcoding the column in the update statement, I'd like to
> have the c2000_02 as a variable so the statement would look like:
>      update table set variable = "xoxoxo"

> Nick



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. hardcoded columns

2. System DSN question how to avoid hardcoding a UID and PWD into connection string

3. Hardcoding IPX address information in connection strings.

4. Preventing hardcoding the server name

5. How to address Database in SP without Hardcoding the Database name

6. DTS - executing sql job without it being hardcoded in the package

7. storing and retrieving hardcoded returns

8. Replace Hardcoded Server,DBName with Variable.

9. Hardcoding server_name.database_name.table_name in script

10. Hardcoding sa password

11. ADP presents the server a hardcoded machine name, not the real one


 
Powered by phpBB® Forum Software