Jim,

 

That certainly works!

 

Emmitt Dove

Manager, Converting Applications Development

Evergreen Packaging, Inc.

[email protected]

(203) 214-5683 m

(203) 643-8022 o

(203) 643-8086 f

[email protected]

 

From: [email protected] [mailto:[email protected]] On Behalf Of James
Bentley
Sent: Tuesday, April 07, 2009 4:15 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Row Check

 

Emmitt,
I am curious why not the following all in one solution:
 CREATE TEMPORARY VIEW testview (keycol,mytotc) AS +
    SELECT keycol,+
          ((IFNULL(textcol,0,1)) ++
           (IFNULL(intcol,0,1)) ++
           (IFNULL(dtcol,0,1)) ++
           (IFNULL(realcol,0,1)))+
      FROM testtable
Also if this is need all the time why not add a single computed column type
INTEGER using above concepts to the original table.
If you wanted the computed column to resolve to a 0 or 1 value just add
(IFGT((abovecode),0,1,0)) to the computed col def.

 

Jim Bentley
American Celiac Society
[email protected]
tel: 1-504-737-3293

 

 

  _____  

From: Emmitt Dove <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Tuesday, April 7, 2009 2:25:17 PM
Subject: [RBASE-L] - RE: Row Check

Jan,

 

Again, there might be a better way, but here is an illustration of my
suggestion.  Run this against any database.

 

  CREATE TEMPORARY TABLE testtable +

    (keycol INTEGER,+

     textcol TEXT (8),+

     intcol INTEGER,+

     dtcol DATETIME,+

     realcol REAL)

 

  INSERT INTO testtable (keycol) VALUES (1)

  INSERT INTO testtable (keycol,textcol) VALUES (2,'testtext')

  INSERT INTO testtable (keycol,textcol,intcol) VALUES (3,'testtext',8898)

  INSERT INTO testtable (keycol,textcol,intcol,dtcol) VALUES +

                        (4,'testtext',8898,'04/07/2009 12:43:56')

  INSERT INTO testtable (keycol,textcol,intcol,dtcol,realcol) VALUES +

                        (5,'testtext',8898,'04/07/2009 12:43:56',88.4456)

 

  CREATE TEMPORARY VIEW testview (keycol,myc01,myc02,myc03,myc04) AS +

    SELECT keycol,+

           (IFNULL(textcol,0,1)),+

           (IFNULL(intcol,0,1)),+

           (IFNULL(dtcol,0,1)),+

           (IFNULL(realcol,0,1)) +

      FROM testtable

 

  CREATE TEMPORARY VIEW testview2 (keycol,mytotc) AS +

    SELECT keycol,+

           (myc01 + myc02 + myc03 + myc04) +

      FROM testview

 

  RETURN

 

Now observe the data in testview2.  Only the first row has a zero in the
computed column and would therefore be editable in your scenario.

 

Emmitt Dove

Manager, Converting Applications Development

Evergreen Packaging, Inc.

[email protected]

(203) 214-5683 m

(203) 643-8022 o

(203) 643-8086 f

[email protected]

 

From: [email protected] [mailto:[email protected]] On Behalf Of jan johansen
Sent: Tuesday, April 07, 2009 1:58 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Row Check

 

Group, 

  

Any one got a shortcut for checking if there is data in columns in a row? 

While I can do this easily for one column I need to see if there is any 

data in like 40 columns in a row. If any of these columns has data 

then I need to disable the EDIT function. 

  

Jan 

 

Reply via email to