Home > database >  Could you tell me how to batch under you Daniel PL/SQL query and modify the data
Could you tell me how to batch under you Daniel PL/SQL query and modify the data

Time:09-17

I am novice, oracle has a student table, column (student id) 1, column 2, column 3 (achievement).,,,,,,, and so on, now I have some students excel student number (column 1) data, I want to put these data all grades (column 3) 0, how can I achieve more convenient





My idea is to excel import and then query out the update, if this possible, could you tell me how to operate under,

If not you still have what good way to


The more detailed, the better thank you Daniel

CodePudding user response:

Excel data import oracle first, generate a table student_t1, then update statement to batch change
Update student set grades=0 where student id in (select student id from student_t1) t;

CodePudding user response:

The key is to see the building Lord what ultimately want results, if want to tables in the oracle, you will excel import oracle, and then the update, if you want to excel file, it is ok to clear the result column content directly,

CodePudding user response:

reference 1st floor js14982 response:
Excel data import oracle first, generate a table student_t1, then update statement to batch change
Update student set grades=0 where student id in (select student id from student_t1) t;
could you tell me how to generate new after import under the table?

CodePudding user response:

reference 1st floor js14982 response:
Excel data import oracle first, generate a table student_t1, then update statement to batch change
Update student set grades=0 where student id in (select student id from student_t1) t;
could you tell me how to generate the new watch

CodePudding user response:

refer to the second floor lhdz_bj response:
the key is to see the building Lord what ultimately want results, if want to tables in the oracle, you will excel import the oracle, and then the update, if you want to excel file, it is ok to clear the result column content directly,
thank eldest brother, the import after how to generate a new table?

CodePudding user response:

Tools - ODBC import, the import source interface, file selection you Excel file to import, DSN Excel Files, the user password by default, connect

CodePudding user response:

You don't put one table, figure out, he said in the dry

CodePudding user response:

See you on the number of records in excel file, record number has little to build a new table directly update empty table, then shear in the excel data into the new table, then according to the new table in the STUDENT list updates records corresponding to STUDENT id column 3, if large amount of data, using ODBC import,

The create table sutdent_id # temp (student_id varchar (50));

Select * from sutdent_id # temp for update;

Update student st set grades='0' where the exists (select 1 from sutdent_id # temp ste where st. student id=ste. Student_id);

commit;