Advertisement
Pandaaaa906

Untitled

Aug 24th, 2021
1,758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.54 KB | None | 0 0
  1. DROP SERVER IF EXISTS lims_db CASCADE;
  2. CREATE SERVER lims_db
  3. FOREIGN DATA WRAPPER odbc_fdw
  4. OPTIONS (
  5. odbc_DRIVER 'MySQL ODBC 8.0 Unicode Driver',
  6. odbc_SERVER '192.168.5.247'
  7. );
  8.  
  9.  
  10. CREATE USER MAPPING FOR postgres
  11. SERVER lims_db
  12. OPTIONS (odbc_UID 'cato', odbc_PWD 'Cato2020');
  13.  
  14. CREATE FOREIGN TABLE
  15.   lims_report (
  16.     id INTEGER,
  17.     report_no text
  18.   )
  19.   SERVER lims_db
  20.   OPTIONS (
  21.     odbc_DATABASE 'cato',
  22.     sql_query 'select id, report_no from `bv_report_index`',
  23.     sql_count 'select count(id) from `bv_report_index`'
  24.   );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement