| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

04-28-10, 05:27
|
|
Registered User
|
|
Join Date: May 2006
Posts: 5
|
|
Paradox sql if or case statement
|
|
Is there a Paradox equivalent to SQL IF or CASE statements?
Thanks,
karimk
|
|

04-28-10, 06:36
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 282
|
|
there is IF - ELSE - ENDIF and SWITCH - CASE - ENDSWITCH.. both can be found in the OPAL Help without effort..
__________________
--
Steven Green - Myrtle Beach, South Carolina USA
http://www.OasisTradingPost.com
Oasis Trading Post
- Collectibles and Memorabilia
- Vintage Lego Sets and Supplies
|
|

04-28-10, 07:46
|
|
Registered User
|
|
Join Date: May 2006
Posts: 5
|
|
|
Paradox sql if or case statement
|
|
I mean SQL statements rather than ObjectPAL. In SQL Server, for example, you can have:
SELECT
FullName,
CASE Dept
WHEN 'Marketing' THEN 'Sales'
WHEN 'Customer Care' THEN 'Post Sales'
ELSE 'Admin'
END,
CompanyName
FROM myTable
You can also use IF... ELSE in an SQL statement.
Is there anything like this in Paradox?
Thanks,
Karimk
|
|

04-28-10, 08:11
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 282
|
|
__________________
--
Steven Green - Myrtle Beach, South Carolina USA
http://www.OasisTradingPost.com
Oasis Trading Post
- Collectibles and Memorabilia
- Vintage Lego Sets and Supplies
|
|

04-28-10, 08:16
|
|
Registered User
|
|
Join Date: May 2006
Posts: 5
|
|
|
Paradox sql if or case statement
Your replies are completely pointless! Why don't we all forget about this forum and just use Paradox help!!
|
|

04-28-10, 08:22
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 282
|
|
ok, you can't figure this out yourself.. sorry about that..
you're using a dead platform, with almost no global support available anymore.. I keep an eye on this forum simply because nobody else with a serious paradox background does, but I haven't touched it myself for several years.. if you need specific assistance with paradox, go to the paradox community web site.. Home - Paradox Community
__________________
--
Steven Green - Myrtle Beach, South Carolina USA
http://www.OasisTradingPost.com
Oasis Trading Post
- Collectibles and Memorabilia
- Vintage Lego Sets and Supplies
|
|

04-28-10, 08:27
|
|
Registered User
|
|
Join Date: May 2006
Posts: 5
|
|
|
Paradox sql if or case statement
Yes that's why I posted the question Sherlock...
|
|

04-28-10, 09:46
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 282
|
|
wow, great attitude.. no, Sherlock Holmes won't know what you're thinking, if you don't bother to explain or ask correctly..
the BDE's Local SQL does most common SQL stuff.. did you actually try your code first? did it fail? did you look at the help at all? do you have any experience with Paradox, or are going into this cold?
you're gonna get the same questions on the community forum.. there are people willing to help, but they'll always need to know *your* knowledge level, too..
__________________
--
Steven Green - Myrtle Beach, South Carolina USA
http://www.OasisTradingPost.com
Oasis Trading Post
- Collectibles and Memorabilia
- Vintage Lego Sets and Supplies
|
|

04-29-10, 10:15
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 2
|
|
|
SQL queries
Try not to be abusive. The people on this site don't get paid to help you and frankly I'm surprised at how many people continue to offer support!
Create your query in queries and then go to View on the menu bar and show SQL.
Your pushbutton should use something like this:
var
mySql sql
endvar
my sql
paste your code here
endsql
MySql.executesql(db,":alias:file name")
You can then use the results in the database file.
Works for simple SQL instructions.
|
|

12-01-11, 10:54
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 1
|
|
Having the same problem.
if then else appears to be reserved keywords in the sql window (and case does not, nor iif), but I'm struggling with the syntax as well, the 10 part local sql in the paradox forum linked above does not mention if then else that I see.
Curious if you figured this out or went another route.
I tried if then else as well as if(conditional,true, false) neither seemd to work
select *
if subdiv="$$"
then substring(a."DESC" from 11 for 7)
else cast(cast(DIV as int) as char(10)) +"/"+ subdiv
from "upldje.db" a
|
|

12-01-11, 11:10
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 282
|
|
Ceetar.. if the examples you found on the community site don't help, you need to ask more questions THERE.. you're trying to use BDE Local SQL for your SQL side, so only folks working with BDE will be able to answer correctly (usually Paradox or Delphi folks).. your best bet for help is Home - Paradox Community
__________________
--
Steven Green - Myrtle Beach, South Carolina USA
http://www.OasisTradingPost.com
Oasis Trading Post
- Collectibles and Memorabilia
- Vintage Lego Sets and Supplies
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|