Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete a record (syntax)

Status
Not open for further replies.

KingSlick

Programmer
Mar 9, 2007
45
US
Ok, I have a .dbf that I would like to delete some records out of it. The problem is that I need for it to remove based on several different strings that appear in the different fields.

I have the following below that keeps giving me errors...

Code:
delete for LOWER(laSortingOrder[zz,1]) $ LOWER(source) AND LOWER(laSortingOrder[zz,3]) $ LOWER(source) AND NOT LOWER(laSortingOrder[zz,1]) $LOWER(source)

any help would be great. Thanks in advance
 
Markros, Olaf
I was trying to troubleshoot what could have been wrong & to find the error.
I know the 3 delete commands is the exact same as the one posted. I was trying to Isolate the error to a specific part of the command.


David W. Grewe Dave
 
In my mind, these two commands

delete for LOWER(laSortingOrder[zz,1]) $ LOWER(source)

delete for NOT LOWER(laSortingOrder[zz,1]) + "0]" $ LOWER(source)

contradict one another. Once you deleted everything which has LOWER(laSortingOrder[zz,1]) in the Source, I can not figure out what the last command is supposed to do.
 
Ok everyone, there was no error in the syntax. I failed to scroll the screen over to the and notice that I had actually put an into table at the end of the line. Once that had been removed then everything was fine.

Thanks for every ones help.
 
It's good that the problem is solved, but I think that you can not substitute your original statement with 3 different delete statements as was suggested.
 
no, Dave just split the deletes to find the offending expression. To do that I'd rather would have suggested to just Evaluate or print these expressions, eg if a statement like

IF exp1 OR exp2 AND exp3

fails you can of course simply test
? exp1
? exp2
? exp3

It's a general strategy to cut something to smaller portions, not just only for debugging.

Bye, Olaf.

 
I agree, the point is, that doing 3 separate commands will result in (FirstCond And SecondCond and ThirdCond), not in OR. In this particular case FirstCond eliminates the third condition, or so it seems.
 
Markos you are right. The only way to have some result may be to revese the order i.e. first statement to execute at last. But still will not accomplish what the user wants.
It is just a pointer to the user to find where the problem is.

Nasib Kalsi



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top