Skip to content

Instantly share code, notes, and snippets.

@Fusion86
Created September 4, 2017 09:03
Show Gist options
  • Save Fusion86/4a91ddfbe1de804c3a1cae11a67b63cd to your computer and use it in GitHub Desktop.
Save Fusion86/4a91ddfbe1de804c3a1cae11a67b63cd to your computer and use it in GitHub Desktop.
Oracle iAcademy
// Get list of tables
var tables = [];
$("td > a").each((k, v) => tables.push(v.innerText));
// Create backups
var tables = ["DEPARTMENTS", "D_CDS", "D_CLIENTS", "D_EVENTS", "D_JOB_ASSIGNMENTS", "D_PACKAGES", "D_PARTNERS", "D_PLAY_LIST_ITEMS", "D_SONGS", "D_THEMES", "D_TRACK_LISTINGS", "D_TYPES", "D_VENUES", "EMPLOYEES", "F_CUSTOMERS", "F_FOOD_ITEMS", "F_ORDERS", "F_ORDER_LINES", "F_PROMOTIONAL_MENUS", "F_REGULAR_MENUS", "F_SHIFTS", "F_SHIFT_ASSIGNMENTS", "F_STAFFS", "JOBS", "JOB_GRADES", "JOB_HISTORY", "LOCATIONS", "REGIONS"]
var queries = [];
tables.forEach((table) => {
queries.push("CREATE TABLE XBACKUP_"+table+" AS (SELECT * FROM "+table+");");
});
console.log(queries.join("\n"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment