user3311539
user3311539

Reputation:

unfamiliar SQL syntax

I have come across an SQL statement designed for a DB2 database (iSeries) which is of the format below. What i don'y understand is the FROM clause. DATABASE.TABLE makes sense. But the part beginning from the Colon : is not familiar. Please can someone tell if this seems to be valid? The only place where I have seen Colon used in SQL is for host variables

SELECT DISTINCT FLD1,
                    FLD2,
                    FLD3,
                    FLD4
    FROM 
                    DATABASE.TABLE:TABLE1 TABLE1
    WHERE 
                    FLD5 = 'MFG'
                    AND FLD6= '1'

Upvotes: 2

Views: 90

Answers (1)

danny117
danny117

Reputation: 5651

It looks like compiled program SQL the :field is substituted at run time.

C+ UPDATE CORPDATA/EMPLOYEE
C+    SET SALARY = SALARY * :PERCNT
C+    WHERE COMM >= :COMMI
C/END-EXEC

Upvotes: 1

Related Questions