INSERT with zero SELECT
Posted in 1991
Path: emory!wuarchive!uunet!mcsun!ukc!vision!chris
From: chris@visionware.co.uk (Chris Davies)
Newsgroups: comp.databases
Message-ID: <1991Jul15.092908.26615@visionware.co.uk>
Date: 15 Jul 91 09:29:08 GMT
Organization: VisionWare Ltd., Leeds, UK
Hi all,
Consider, if you will, the following scenario. There are two tables,
TABLEA and TABLEB, with the same column definitions. The following SQL
statement is used to copy any rows from TABLEA to TABLEB (however,
TABLEA is empty).
INSERT INTO TABLEB SELECT ... FROM TABLEA
Under INFORMIX 4 (Turbo) the return value from sqlcode is 0, with a
qualifier, "No rows processed".
Under INGRES 6.2 (Ultrix/SQL 1.0) the return value from sqlcode = 100
(defined as SQL_NOTFOUND).
It appears that Informix returns an informational OK, whereas Ingres
returns an informational error/warning.
Which (if either) is "more correct"? I have an application which works
with both database systems, and I need to have a standard response to a
query regardless of which platform I'm using at the time.
For any non-SELECT statement, could I map any SQL_NOTFOUND code (value
100) back to a zero value (meaning everything's hunkydory)?
Chris
--
VISIONWARE LTD, 57 Cardigan Lane, LEEDS LS4 2LE, England
Tel +44 532 788858. Fax +44 532 304676. Email chris@visionware.co.uk
-------------- "VisionWare: The home of DOS/UNIX/X integration" -------------