简体   繁体   中英

how can I change values inside a variable?

I am creating a procedure that is reading from a table called tab with column( col1 ).
The col1 contain such data:

Select test from dual.

I have in the procedure :

select col1 into var1 from tab

so the data is in the var1 , how can I change the word test in the var1 ?

I want var1 contain such data : select changed from dual.

I know I can you use substr , is there another way ?

Edit.
var1 is like this . Var1 = ' select test from dual'

I want to change the value of var1 to become like this

var1 = 'select CHANGED from dual'

because later on I want to insert var1 into another table.

Do you mean you want to assign the variable a new value? If so just use an assignment statement:

var1 := 'changed';

it will be var1 := 'select CHANGED from dual';

or

select changed into var1 from dual;

or

still your question is not clear

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM