Share via

Resulting SQLCODE from a SELECT - INTO CLAUSE (Transact-SQL).

Riccardo Bizzi (RVA-ONEM) 1 Reputation point
2022-05-20T12:09:01.317+00:00

In a COBOL program in VISUAL COBOL for Eclipse I create a temporary table as follow
EXEC SQL AT DBCT
SELECT TOP(1)
*
INTO ##table_name
FROM table_name
END-EXEC.
When the table is created I expected to have an SQLCODE equal to 0.
But when the table is created I received an SQLCODE +100.
Could you explain.

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.


1 answer

Sort by: Most helpful
  1. Olaf Helper 47,621 Reputation points
    2022-05-20T12:22:30.52+00:00

    VISUAL COBOL

    That's not a Microsoft product; you should better post to a more related forum.

    SQLCODE = 100, "no data" was found

    And that's correct, your query don't return a result set.

    https://www.ibm.com/docs/en/db2-for-zos/11?topic=codes-sql

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.