Home > database >  I ask if there is any update table set=variable specific examples
I ask if there is any update table set=variable specific examples

Time:09-21

I use cursor to cycle to the fields in the table when no error, can't afford to change is not

CodePudding user response:

Picture too took me the SQL type hand

Declare
Acc_id vchar2 (50);
Acc_name vchar2 (100);
Cursor update_name is the select acc_id, acc_name
The from aa where filler='cq';
The begin
The open update_name;
Loop
The fetch update_name
Into acc_id acc_name;
If update_name % NOTFOUND THEN
The EXIT
The UPDATE bb set ACC_NAME=ACC_NAME WHERE
FILLER2='cq and ACC_ID=ACC_ID;
End the if;
End loop;
commit;
The close update_name;
end;

CodePudding user response:

Variable names and field name

CodePudding user response:

 
- 1. The update syntax
The update table name set column name=new value where the column name=one value;

- 2. For example:
The update bb set acc_name='33837011' where filler2='cq' and acc_id='qq_33837011';

CodePudding user response:

The
reference 3 floor springs of water faint reply:
 
- 1. The update syntax
The update table name set column name=new value where the column name=one value;

- 2. For example:
The update bb set acc_name='33837011' where filler2='cq' and acc_id='qq_33837011';

The value is set a variable, I write the name of the variable and the name of the field can't change the same

CodePudding user response:

In your update statement are wrong: set acc_name=acc_name, not equal to didn't update?
Must set acc_name=not acc_name field or a subquery

CodePudding user response:

The
reference 5 floor springs of water faint reply:
in your update statement are wrong: set acc_name=acc_name, not equal to didn't update?
Must set acc_name=not acc_name fields or subquery

Is the name of the variable as well as the field name, it is considered a field? But when I print it, or the values in the variables

CodePudding user response:

Field itself is a variable, you can certainly print its value!

CodePudding user response:

refer to 7th floor springs of water faint reply:
field itself is a variable, you can certainly print its value,

Field in the update statement itself is variable, so the variable name and field name, understand it right

CodePudding user response:

refer to the eighth floor qq_33837011 response:
Quote: refer to 7th floor springs of water faint reply:
field itself is a variable, you can certainly print its value,

Field in the update statement itself is variable, so the variable name and field name, understand right

  • Related