Solved

Logic in IDC&HTX

Posted on 1997-03-13
1
175 Views
Last Modified: 2013-12-25
I want to use logic SQL (and,or,not)in my IDC file
ex. In the library,I want to search "microprocessor&computer"
or "Introduction NLP",but library'database has "Introduction  to NLP"
    my original source code is
    select *
    from book
    where call_no like '%%%call_no%%%'
   
    How can I do?
    Thank you...
     
   
0
Comment
Question by:Donald021997
1 Comment
 
LVL 4

Accepted Solution

by:
jshamlin earned 30 total points
ID: 1853875
The precise syntax depends on the server you're using (the examples below works on MS SQL Server, but may not work elsewhere)

For a simple if/else, it's ...
+if ([test_condition])
+[commands_to_perform]
+else
+[commands_to_perform]

if the logic depends on the content of the records, you need to

SELECT
+WHERE [condition]
+AND [condition]  --optional--

For a NOT, you can alter the syntax of the AND condition

To be honest, I've never found a need for an OR - but if OR doesn't work, you should be able to repeat the WHILE and add a different condition - the records should be used in addition to those selected by the first WHILE (which is, essentially, what an OR does)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now