newdevs:code:import_csv_into_db
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
newdevs:code:import_csv_into_db [2023/02/27 13:28] – [Finessing the Data Prior to Import] tlittle | newdevs:code:import_csv_into_db [2024/06/13 10:52] (current) – more resources sleary | ||
---|---|---|---|
Line 14: | Line 14: | ||
This assumes that Column A is the no-dupe column (name, in this case) and Column B is the org. So basically, count the number of times that the name in A2 appears with the same org that's in B2. Then if we fill that down the entire column, if you get anything above a 1 you have a dupe that you can filter for and remove. | This assumes that Column A is the no-dupe column (name, in this case) and Column B is the org. So basically, count the number of times that the name in A2 appears with the same org that's in B2. Then if we fill that down the entire column, if you get anything above a 1 you have a dupe that you can filter for and remove. | ||
- | **TIP:** If you're not sure if your table includes a uniqueness constraint, here's a grep of Evergreen for the word " | + | **TIP:** If you're not sure if your table includes a uniqueness constraint, here's a grep of the Evergreen |
===== Importing the Data ===== | ===== Importing the Data ===== | ||
Line 40: | Line 40: | ||
< | < | ||
- | Then if you do a select * from tlittle.acqprolist you'll see it's now populated with the data from our CSV file. | + | Then if you do a **select * from tlittle.acqprolist** you'll see it's now populated with the data from our CSV file. |
5. To get that data into our Evergreen table, we need to copy it over. | 5. To get that data into our Evergreen table, we need to copy it over. | ||
Line 60: | Line 60: | ||
So the second half is the SELECT--select all these from tlittle.acqprolist--which we then INSERT with the first portion. | So the second half is the SELECT--select all these from tlittle.acqprolist--which we then INSERT with the first portion. | ||
- | If it's successful, you'll get the INSERT 0 [NUMBER OF ROWS] message. You can then do a select * from acq.provider | + | If it's successful, you'll get the INSERT 0 [NUMBER OF ROWS] message. You can then do a **select * from [YOUR TABLE]** |
+ | |||
+ | ====== More Resources ====== | ||
+ | |||
+ | * [[https:// |
newdevs/code/import_csv_into_db.1677522537.txt.gz · Last modified: 2023/02/27 13:28 by tlittle