Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHtjm-0003pd-Up for pgsql-odbc@arkaria.postgresql.org; Mon, 05 Jun 2017 15:16:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dHtjm-0002Bi-HH for pgsql-odbc@arkaria.postgresql.org; Mon, 05 Jun 2017 15:16:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dHtjm-0002BW-5e for pgsql-odbc@postgresql.org; Mon, 05 Jun 2017 15:16:10 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dHtjj-0006aC-U1 for pgsql-odbc@postgresql.org; Mon, 05 Jun 2017 15:16:09 +0000 Received: by mail-wm0-x236.google.com with SMTP id x70so15337034wme.0 for ; Mon, 05 Jun 2017 08:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=BvFGsoSNg3v87mUMIUGrq5EErx1UG37umrMIzW27Htw=; b=H6WtTF/VSnBOKFXbF/yplMzF9V5UMaJ7QgpMvuDsECdziR0pbMruGBhooba2pt9PiK SI8dBRryRDeFh9kDo9D5oq+OBZeL3uUvODganCcLJxixeCqFLHbMTCTAFakQkR3QlVkW gH9AKtfRwkOtxS9H4d6u7UZjQlOYhmwzyaW/XVWnhpk48KPBs3d4aAp6ccIYiXGRP0Kh zwB1qPaovRXO0tsLI07BNMjUR4a9b6uLEDTh0X0n5XuT50wUXRrdxpa/C7U/mG9jqTgm U7cZ7r7fB5t+0Qgq1iSY25k66aBA8/AJizU64Tw0lGU2h4iFs3J0B0MNWfJEr7gBwy1l 65iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=BvFGsoSNg3v87mUMIUGrq5EErx1UG37umrMIzW27Htw=; b=RKcnQ6FKgKlceHZJHyBRRjaLIBmgHXWxasSI9csLKKMc0XoieYIg7AV0xQk9aa07ii KzELO/s6xKz6s47w1k+Z5uVRcEu7Qu6XglUUCnLV8ier497+NGg+s5HLUan9ANKiFWhl VXVxQzZoSDSVwpQ0iLQyV0MPRWuBKWwZ4B6TMHZxM0wKrUCMAbL82eNWIW6HzzIK5+6p KPWeUF05n7TF9R/k5GCU7zlGHGOk0BK9vEQ5NjqjobuDM3Rqwk7FSffFCguZwc9Ixja1 otcVNSXPKk4gIkISfz10tMv3OlHSaR962714K3Rfa804Mg/d6uYaWCbQgCiKZmbm6gQb IuTA== X-Gm-Message-State: AODbwcAHzgpWxo4hp8A6up1ida4MmQOulLsjYIXxcIszGE3mPO5zDFsH R/3z8eQ8afPu3Rl2 X-Received: by 10.28.86.194 with SMTP id k185mr8493988wmb.35.1496675765515; Mon, 05 Jun 2017 08:16:05 -0700 (PDT) Received: from [192.9.200.119] ([194.78.170.35]) by smtp.googlemail.com with ESMTPSA id y17sm42153988wrb.39.2017.06.05.08.16.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 08:16:04 -0700 (PDT) To: pgsql-odbc@postgresql.org From: Alain Reymond Subject: Update Message-ID: <12c0ed39-08a0-6f19-f47b-caee35bc0b5b@gmail.com> Date: Mon, 5 Jun 2017 17:16:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hello, We are using psqlodbc to update a Postgresql database from embedded sql for cobol. We have a strange behaviour : the first time we update, the update is correct (sqlcode 0). I we try the same update, the system return sqlcode = 100 and sqlstate = 2000. postgresql.x86_64 9.2.18-1.el7 postgresql-odbc.x86_64 09.03.0100-2.el7 unixODBC.x86_64 2.3.1-11.el7 under Centos 7.2 64 bits. Here an example to simulaute an upsert : exec sql UPDATE testtable SET num = :testtable-num , libelle = :testtable-libelle:testtable-libelle-NULL WHERE num = :testtable-num; end-exec if sqlcode = 100 then exec sql INSERT into testtable ( num , libelle ) SELECT :testtable-num , :testtable-libelle:testtable-libelle-NULL WHERE NOT EXISTS (SELECT 1 FROM testtable WHERE num = :testtable-num); end-exec end-if if sqlcode = 0 then exec sql commit end-exec end-if If I call two times the above code with the same content of testtable-num and testtable-libelle, the first attempt is successful and all other attempts, even changing the content of the variables, fails. It was working good under Centos 5.9 32 bits, and Postgres 9.2. Any idea why ? Kind regards, Alain -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc