Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete blank row from cursor
Message
From
15/11/2006 10:45:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/11/2006 10:35:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01169824
Message ID:
01169838
Views:
7
>Hi there,
>
>I create a cursor with a number of rows to populate a combobox. A blank row always gets in and I want to get rid of it. Here is my code.
>
>SELECT DISTINCT cWorkType FROM c_list INTO CURSOR c_WorkTypes readwrite
>INSERT INTO c_WorkTypes VALUES ('All')
>DELETE FOR cWorkType == ""
>
>Instead of "" I tried null but the blank is always there.
>
>Any hep would be much appreciated,
SELECT DISTINCT cWorkType FROM c_list INTO CURSOR c_WorkTypes readwrite where !(cWorkType == "")
INSERT INTO c_WorkTypes VALUES ('All')
PS: If you wnat to go delete way then:
DELETE from c_list where cWorkType == ""
Behavior of == is not same for ansi and exact. With delete for it should be:

Delete for trim(cWorktype) == ""
or:
Delete for cWorktype == space(fsize('cWorkType'))
or:
delete for empty(cWorkType)
etc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform