开发者

Compile time Error in ProC (Embedded sql in C)

开发者 https://www.devze.com 2022-12-15 05:53 出处:网络
Please tell me whats wrong with the query. I am using Pro C. EXEC SQL SELECT 1 INTO:db_count FROMsachin t

Please tell me whats wrong with the query. I am using Pro C.

EXEC SQL SELECT 1
        INTO    :db_count
        FROM    sachin t
     开发者_如何转开发   WHERE   t.serialno =   :serial_no
        AND     t.amount = (:db_inamount - (SELECT NVL(overrun_amount,0)
                                            FROM  sunny tovrun
                                            WHERE tovrun.serialno = :serial_no
                                            AND   tovrun.timestamp = t.timestamp
                                            AND   rownum < 2)
                            )
        AND     t.request_code = 11
        AND     t.reason_code = 0
        AND     t.reversed    = 0
        AND rownum < 2;

And getting the compilation errors

Syntax error at line 4487, column 42, file my_file.pc:
Error at line 4487, column 42 in file my_file.pc            AND             t.amount = (:db_inamount - (SELECT NVL(overrun_amount,0)


Use:

 AND t.amount = (SELECT :db_amount - NVL(overrun_amount, 0) ...

It's a standard computed column, where the value is calculated prior to the comparison to the t.amount value for equality.

0

精彩评论

暂无评论...
验证码 换一张
取 消