I have 20 tables which have the same declaration
for example:
EXEC SQL DECLARE
Produktion TABLE
( ContainerGuid uniqueidentifier(36)
NOT NULL
,BelegId bigint(19) NOT NULL
,BelegJahr bigint(19) NOT NULL
,BelegNummer bigint(19) NOT NULL
,BelegPositionId bigint(19) NOT NULL
,BelegPositionsNummer int(10) NOT NULL
) END-EXEC.
Is it possible do create the select statement where the table-name is variable like:
move "Produktion" to sql-text
EXEC SQL
SELECT DISTINCT
ContainerGuid
INTO :guid-field
FROM :sql-text
* FROM Produktion
WHERE (BelegNummer = :dat-sql-belegnr
AND BelegPositionsNummer = :dat-sql-belegpos)
END-EXEC
move guid-field to dat-sql-cguid-Produktion.




