Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9213589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:47:02+00:00 2026-06-18T01:47:02+00:00

I have a table (in informix ) which stores two columns :empId and status

  • 0

I have a table (in informix ) which stores two columns :empId and status (Y/N). There are some other scripts which, when run, update the status of these employeeIDs based on certain conditions.
The task at hand is , a user provides a path to a file containing employee-IDs. I have a script which then looks at this file and does a “load from user_supplied_file insert into employeeStatusTable”.
All the employeeIDs mentioned in this file are to be inserted in this table with the status ‘N’. Th real issue is the user-supplied file may contains an employeeId that is already present in the table with the status updated to ‘Y’ (by some other script or job). In this case, the existing entry should get overwritten. In short, the entry in the table should read “empId”, “N”.

Is there any way to acheive this? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:47:03+00:00Added an answer on June 18, 2026 at 1:47 am

    As far I know , the LOAD statement is limited to use together of INSERT statement.
    I pretty sure there a lot of ways to do this , I will suggest two way:

    In both cases, is supported only for database version >= 11.50 and have certain limitations like:

    • The Merge works only if the two tables have 1 to 1 relationship
    • The external table is limited to Database Server file system, not will access anything on client machine

    SUGGESTION 1

    Load into a temporary table and then use the MERGE statement.

    create temp table tp01 ( cols.... ) with no log ; 
    load from xyz.txt insert into tp01 ; 
    merge into destTable as A
      using tp01 as B 
      ON A.empID = B.empID
      WHEN MATCHED THEN UPDATE SET status = 'N'
      WHEN NOT MATCHED THEN INSERT (empid, status) values ( b.empid, 'N');
    drop table tp01;
    

    SUGGESTION 2

    Create a external table to you TXT file and then just use the MERGE or UPDATE using this table when needed.

    create external table ex01 .... using ( datafile('file:/tmp/your.txt'), delimited ...);
    merge into destTable as A
      using ex01 as B 
      ON A.empID = B.empID
      WHEN MATCHED THEN UPDATE SET status = 'N'
      WHEN NOT MATCHED THEN INSERT (empid, status) values ( b.empid, 'N');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table with two columns (varchar from, varchar to). This table represents connections
I have table with following details Table name EMPLOYEE and columns EMPID (PK smallint
I have a SQL which I am trying to run in Informix but it
Informix 11.70.TC4: I have an SQL dimension table which is used for looking up
I have table with around 70 000 rows. There is 6000 rows that i
I have table in which I am inserting rows for employee but next time
I have table and this table contain result column with some entries. I just
INFORMIX-SE 7.32: I have a transaction table with about 5,000 nrows. The transaction.ticket_number[INT] is
I have problem when I try insert some data to Informix TEXT column via
INFORMIX-SQL or any other SQL-based DB: Suppose I have an app where depending on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.