Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
Does QODBC SQL support a CASE construct? |
Author |
Message |
|
Posted : 2006-04-29 08:07:33 |
I need a simple CASE construct. Does QODBC have such?
For example, in Microsoft SQL, I could simply say:
SELECT CASE WHEN IsPending = 0 THEN 'False' ELSE 'True' END as ISPENDING from InvoiceLine
If not, is there any other "conditional" that I could use in a select statement?
TIA!
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-04-29 09:16:05 |
The use of
CASE sql_expression WHEN sql_expression_value THEN return_value ELSE return_value
or
CASE WHEN sql_Boolean_expression THEN return_value ELSE return_value
is currently not supported by QODBC. You will need to build the construct around a WHERE, AND, OR. |
|
|
|
|
Posted : 2006-04-29 09:57:51 |
Thanks for the confirmation, Tom.
At least I know what my limits are. Unfortunately, this is very disheartening.
A valid CASE construct (or inline IF THEN ELSE) allows variable data to be returned for a given column, for whatever records are being returned.
Using a WHERE statement with AND and OR merely controls the records returned by the select statement, which is drastically different.
With this approach, I have to break-up my select statement into multiple select statements, which is not acceptable for this particular need, as I MUST have a single result set. This WOULD be acceptable if I could UNION the multiple result sets, but it doesn't appear UNION is supported by QODBC either.
Again, thanks for the confirmation.
|
|
|
|
|
Posted : 2007-10-22 16:15:57 |
In another thread, you say your request for this feature has fallen on deaf ears. Into whose ears do we need to scream, then? Without CASE, or at a minimum IIF, and no support for UNION, this product is limited to the point of being almost worthless. I echo the previous poster's comment about having to merge multiple result sets is not acceptable and in my specific case, it is not an option.
QODBC supports COS, TAN, SIN but not CASE/IIF? I find it extremely interesting that a package to access business data allows me to run trig functions but not CASE. I can't really recall ever having to find the COS of a total invoice amount. I can remember the last time I had to use one field if not blank, but a second field if the first one was blank.
I'm glad I realized that before I spent the money on purchasing the full version. And also so I can talk my client out of purchasing an upgrade to QB.
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-10-23 07:57:23 |
I've brought your comments to the attention of the President of FLEXquarters.com LLC. I agree with you that QODBC does need both UNION and CASE to be implemented and would like to see them too. |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-10-06 15:45:20 |
|
|
|
|