Results 1 to 2 of 2
  1. #1
    MrMarmite is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    8

    Question renaming linked tables

    Hi,

    I amusing ODBC to connect to a number of ODBC linked PostgreSQL dBs. They all have the same table names and as such they import themselves as something like:
    public.accounts
    public.accounts1
    public.accounts2

    I have renamed these locally and manually, so they now read:
    client1.accounts
    client2.accounts
    client3.accounts

    Does anyone know if there is a bulk or automated way to rename the local names of these linked tables?

    Cheers



    James

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Code:
    dim tdf as tabledef
    dim vName
    
    for each tdf in tabledefs
      if instr(tdf.name, "public.")>0 then
          vName = tdf.name
         tdf.name = replace(vName, "public","client")
      end if
    next

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 04-18-2018, 06:56 AM
  2. Replies: 17
    Last Post: 04-09-2018, 04:39 PM
  3. Replies: 1
    Last Post: 02-07-2016, 02:41 PM
  4. Replies: 4
    Last Post: 11-22-2013, 11:20 AM
  5. Replies: 5
    Last Post: 02-02-2012, 06:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums