Modifying AcuXDBC table ownership

0 Likes

This article describes how to modify AcuXDBC table ownership with the provided batch files.

Problem:

Some ODBC front-end applications have trouble with the "public.tablename" format that is the default for AcuXDBC when it adds table information to the system catalog.  Frequently, when using Microsoft Access for example, an application cannot interpret the owner.tablename syntax, so an application error results.  Removing the "public" owner from the table specification is necessary for the desktop application.The AcuXDBC manual (section 5.3.1) indicates to use the -o "<space>" option of the XDBCUTIL script.  An example of how to automate the process when using script, demo.bat is provided below.

Resolution:

Here is a quick way to use the batch files provided with the software to make this change. In the bin directory, locate addfile.bat and open it in a text editor. There are two lines, which need to be edited by adding -o "".

A copy of addfile.bat is provided below. The two lines in bold text indicate the lines you should edit and what the edits should look like.

@echo off
rem
rem Copyright (c) 2001-2006 Acucorp, inc.
rem
rem ======================================================================
rem = addfile.bat
rem =
rem = Usage:
rem = addfile d catalog_directory] x xfd_directory] u user] filename
rem = addfile d catalog_directory] x xfd_directory] u user] -f listfile
rem = -d specifies optional directory name to use for the
rem = System Catalog
rem = -x specifies optional directory name to use for the
rem = XFD files
rem = -u table owner
rem = -f listfile
rem = Import an xfd file or list of xfd files into the system catalog
rem =
rem =
rem =
rem ======================================================================
rem
rem

set SVXDBC_BIN=%XDBC_BIN%
set SVCAT=%XDBC_CAT%
set SVXFD=%XDBC_XFD%
set SVFILE=%XDBC_FILE%
set SVLIST=%XDBC_LIST%
set SVUSER=%XDBC_USER%

rem ======================================================================
rem =
rem = You can set your own directory for the AcuXDBC scripts and
rem = executables.
rem = For example:
rem = set XDBC_BIN=c:\user1\bin\
rem =
rem =
rem ======================================================================

set XDBC_BIN="%GENESIS_HOME%"\bin\


rem ======================================================================
rem =
rem = You can set your own default catalog directory
rem = here. For example:
rem = set XDBC_CAT=c:\mycat
rem =
rem =
rem ======================================================================

set XDBC_CAT="%GENESIS_HOME%"\syscat
:set XDBC_CAT=m:\syscat


rem ======================================================================
rem =
rem = You can set your own default XFD directory
rem = here. For example:
rem = set XDBC_XFD=c:\myxfd
rem =
rem =
rem ======================================================================

set XDBC_XFD=.\
:set XDBC_XFD=m:\xfd

set XDBC_FILE=
set XDBC_LIST=
set XDBC_USER=

if "%1" == "" goto show_usage


:loop
if "%1" == "" goto startup
if "%1" == "-d" goto set_catalog
if "%1" == "-D" goto set_catalog
if "%1" == "-x" goto set_xfd
if "%1" == "-X" goto set_xfd
if "%1" == "-f" goto set_list
if "%1" == "-F" goto set_list
if "%1" == "-u" goto set_user
if "%1" == "-U" goto set_user
if "%1" == "-h" goto show_usage
if "%1" == "-H" goto show_usage
if "%1" == "-help" goto show_usage
if "%1" == "-HELP" goto show_usage
if "%1" == "/?" goto show_usage
set XDBC_FILE=%1
goto startup


:set_catalog
shift
set XDBC_CAT=%1
shift
goto loop

:set_xfd
shift
set XDBC_XFD=%1
shift
goto loop

:set_user
shift
set XDBC_USER=-o %1
shift
goto loop

:set_list
shift
set XDBC_LIST=%1
shift
%XDBC_BIN%xdbcutil -z -o "" -d %XDBC_CAT% -x %XDBC_XFD% %XDBC_USER% -v -f %XDBC_LIST%
goto end

:startup
%XDBC_BIN%xdbcutil -z -o "" -d %XDBC_CAT% -x %XDBC_XFD% %XDBC_USER% -v -a %XDBC_FILE%
goto end

:show_usage
echo.
echo Usage:
echo addfile d catalog_directory] x xfd_directory] u user] filename
echo addfile d catalog_directory] x xfd_directory] u user] -f file_list
echo.
goto end

:end

set XDBC_BIN=%SVXDBC_BIN%
set XDBC_CAT=%SVCAT%
set XDBC_XFD=%SVXFD%
set XDBC_FILE=%SVFILE%
set XDBC_LIST=%SVLIST%
set XDBC_USER=%SVUSER%

@echo on

Incident Number: 2267922

Old KB# 14275
Comment List
Anonymous
Related Discussions
Recommended