informix 4gl Version 7.32.FC2 - "CASE" and "PIPE OPERATOR" cannot be used in the direct SQL conditional clause
Posted in 2006
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi friends: I am using the following version of informix 4gl: -- IBM INFORMIX-4GL Version 7.32.FC2 I tried to use "CASE" in the conditional clause: SELECT ... WHERE T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else T3.actual_qty_deliv END) but fail, it gave me this error message: AND T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else T3.actual_qty_deliv END) |_________________________________^ | | A grammatical error has been found on line 79, character 35. | The construct is not understandable in its context. | See error number -4373. |_________________________________^ ..... I then tried the other way (by using the pipe operator), SELECT ... WHERE (T1.test_pseudo || T7.name1 || T1.pkg_code) <> 'QS3125UNIQUESTDCG14' It failed as well (with this error message): AND (T1.test_pseudo || T7.name1 || T1.pkg_code) <> 'QS3125UNIQUESTDCG14' |_____________________^ | | A grammatical error has been found on line 79, character 23. | The construct is not understandable in its context. | See error number -4373. |________________________^ THe main purpose of my conditional clause is to exclude results where 1) T1.test_pseudo = QS3125 2) T7.name1 = UNIQUEST 3) T1.pkg_code = DCG14 Both my sqls can work well in the common sql editor/ sql client but not in the 4gl compilation. Can anyone please help me on this matter? Thanks a lot for your help.
prepare and execute it. Superboer. ggk517@gmail.com schreef: > Hi friends: > > I am using the following version of informix 4gl: > > -- IBM INFORMIX-4GL Version 7.32.FC2 > > I tried to use "CASE" in the conditional clause: > > SELECT ... WHERE > T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > T3.actual_qty_deliv END) > > but fail, it gave me this error message: > > AND T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > T3.actual_qty_deliv END) > |_________________________________^ > | > | A grammatical error has been found on line 79, character 35. > | The construct is not understandable in its context. > | See error number -4373. > |_________________________________^ > > ..... > > > I then tried the other way (by using the pipe operator), > > SELECT ... WHERE > (T1.test_pseudo || T7.name1 || T1.pkg_code) <> 'QS3125UNIQUESTDCG14' > > It failed as well (with this error message): > > AND (T1.test_pseudo || T7.name1 || T1.pkg_code) <> > 'QS3125UNIQUESTDCG14' > |_____________________^ > | > | A grammatical error has been found on line 79, character 23. > | The construct is not understandable in its context. > | See error number -4373. > |________________________^ > > THe main purpose of my conditional clause is to exclude results > where > > 1) T1.test_pseudo = QS3125 > 2) T7.name1 = UNIQUEST > 3) T1.pkg_code = DCG14 > > Both my sqls can work well in the common sql editor/ sql client but not > in the 4gl compilation. > Can anyone please help me on this matter? Thanks a lot for your help.
ggk517@gmail.com said: > Hi friends: > > I am using the following version of informix 4gl: > > -- IBM INFORMIX-4GL Version 7.32.FC2 > > I tried to use "CASE" in the conditional clause: > > SELECT ... WHERE > T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > T3.actual_qty_deliv END) > > but fail, it gave me this error message: > > AND T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > T3.actual_qty_deliv END) > |_________________________________^ > | > | A grammatical error has been found on line 79, character 35. > | The construct is not understandable in its context. > | See error number -4373. > |_________________________________^ > > ..... > > > I then tried the other way (by using the pipe operator), > > SELECT ... WHERE > (T1.test_pseudo || T7.name1 || T1.pkg_code) <> 'QS3125UNIQUESTDCG14' > > It failed as well (with this error message): > > AND (T1.test_pseudo || T7.name1 || T1.pkg_code) <> > 'QS3125UNIQUESTDCG14' > |_____________________^ > | > | A grammatical error has been found on line 79, character 23. > | The construct is not understandable in its context. > | See error number -4373. > |________________________^ > > THe main purpose of my conditional clause is to exclude results > where > > 1) T1.test_pseudo = QS3125 > 2) T7.name1 = UNIQUEST > 3) T1.pkg_code = DCG14 > > Both my sqls can work well in the common sql editor/ sql client but not > in the 4gl compilation. > Can anyone please help me on this matter? Thanks a lot for your help. Try wrapping it in the SQL / END SQL code. -- Bye now, Obnoxio "... no bill is required as no value was provided." -- Christine Normile
Thanks every Informix Guru, it works now. Obnoxio The Clown wrote: > ggk517@gmail.com said: > > Hi friends: > > > > I am using the following version of informix 4gl: > > > > -- IBM INFORMIX-4GL Version 7.32.FC2 > > > > I tried to use "CASE" in the conditional clause: > > > > SELECT ... WHERE > > T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > > T3.actual_qty_deliv END) > > > > but fail, it gave me this error message: > > > > AND T3.actual_qty_deliv=(CASE WHEN T1.test_pseudo='QS3125' and > > T7.name1='UNIQUEST' and T1.pkg_code='DCG14' THEN NULL else > > T3.actual_qty_deliv END) > > |_________________________________^ > > | > > | A grammatical error has been found on line 79, character 35. > > | The construct is not understandable in its context. > > | See error number -4373. > > |_________________________________^ > > > > ..... > > > > > > I then tried the other way (by using the pipe operator), > > > > SELECT ... WHERE > > (T1.test_pseudo || T7.name1 || T1.pkg_code) <> 'QS3125UNIQUESTDCG14' > > > > It failed as well (with this error message): > > > > AND (T1.test_pseudo || T7.name1 || T1.pkg_code) <> > > 'QS3125UNIQUESTDCG14' > > |_____________________^ > > | > > | A grammatical error has been found on line 79, character 23. > > | The construct is not understandable in its context. > > | See error number -4373. > > |________________________^ > > > > THe main purpose of my conditional clause is to exclude results > > where > > > > 1) T1.test_pseudo = QS3125 > > 2) T7.name1 = UNIQUEST > > 3) T1.pkg_code = DCG14 > > > > Both my sqls can work well in the common sql editor/ sql client but not > > in the 4gl compilation. > > Can anyone please help me on this matter? Thanks a lot for your help. > > Try wrapping it in the SQL / END SQL code. > > -- > Bye now, > Obnoxio > > "... no bill is required as no value was provided." > -- Christine Normile
ggk517@gmail.com said: > Thanks every Informix Guru, it works now. What worked, prepare and execute or SQL / END SQL? Or both? :o) -- Bye now, Obnoxio "... no bill is required as no value was provided." -- Christine Normile
Related threads
- Error executing statement.
- Re: Error executing statement.
- Re: Kshell Script to Compare One Database on One Server to the