Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2009
    Posts
    4

    Unanswered: Informix Database - Batch file to delete records

    Hi,
    I am very new to informix db ver 10. I have worked on Sqlserver before but not on informix.
    I have a informix database and I am able to make a sucessful ODBC connection to the database. Using Access Linked tables, i am able to view the records of the database.
    What I need is to create a batch file to delete certain records from a table and periodically run it. I want to know the content of the batch file.
    I know how to do the same in MS SQLServer db using the osql but not aware of it in informix.

  2. #2
    Join Date
    Feb 2009
    Posts
    51
    Operating system?

  3. #3
    Join Date
    Mar 2009
    Posts
    4
    Operating System is Win2k3 server

  4. #4
    Join Date
    Feb 2009
    Posts
    51
    Quote Originally Posted by jaisonlucas
    Hi,
    What I need is to create a batch file to delete certain records from a table and periodically run it. I want to know the content of the batch file.
    I know how to do the same in MS SQLServer db using the osql but not aware of it in informix.
    If I understood you.

    You need to create sql file with DELETE statement, for example,
    DELETE from my_table WHERE my_col='bla-bla-bla'
    Maybe you will have more complexer statement.

    And create batch file. This batch file should has Informix environment such as
    set INFORMIXDIR=your_dir
    set INFORMIXSERVER=your_server_name
    set ONCONFIG=ONCONFIG.your_server
    set PATH=c:\ISM\2.20\bin;C:\Informix\bin;%PATH%
    set CLIENT_LOCALE=your_locale
    set DB_LOCALE=your_locale

    maybe more
    and next string
    dbaccess your_database your_sql_file

    And you can add this batch file to Windows scheduler.

  5. #5
    Join Date
    Mar 2009
    Posts
    4
    Thanks for the reply. You r right.I tried the above. I was not able to find values for
    Set CLIENT_LOCALE=your_locale
    set DB_LOCALE=your_locale
    i ignored those two strings but then got a conenction error. I think there should be a string where the authentication to the server/database will be done like it is done while using DbAccess and accessing the table and deleting the required records.
    Please help.

  6. #6
    Join Date
    Feb 2009
    Posts
    51
    jaisonlucas, post your error by copy/paste.

  7. #7
    Join Date
    Mar 2009
    Posts
    4
    Attached batch file and the error msg shotscreen.

    Thanks.
    Attached Files Attached Files

  8. #8
    Join Date
    Feb 2009
    Posts
    51
    Error -387
    No connect permission.
    You cannot access the database that this statement requests because you have not been granted CONNECT privilege to it. Contact a person who has Database Administrator privilege to that database and ask to be granted CONNECT privileges to it.

    First of all you need connect privileges.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •