Discussion:
informix 4gl Version 7.32.FC2 - "CASE" and "PIPE OPERATOR" cannot be used in the direct SQL conditional clause
(too old to reply)
g***@gmail.com
2006-06-22 08:29:37 UTC
Permalink
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.
Superboer
2006-06-22 08:44:35 UTC
Permalink
prepare and execute it.



Superboer.
Post by g***@gmail.com
-- IBM INFORMIX-4GL Version 7.32.FC2
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)
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'
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.
Obnoxio The Clown
2006-06-22 08:52:16 UTC
Permalink
Post by g***@gmail.com
-- IBM INFORMIX-4GL Version 7.32.FC2
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)
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'
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
g***@gmail.com
2006-06-22 09:09:19 UTC
Permalink
Thanks every Informix Guru, it works now.
Post by Obnoxio The Clown
Post by g***@gmail.com
-- IBM INFORMIX-4GL Version 7.32.FC2
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)
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'
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
Obnoxio The Clown
2006-06-22 09:27:27 UTC
Permalink
Post by g***@gmail.com
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
Loading...