Toad World® Forums

Object Search

I’m loving it. Very handy. J

Is there a way in the columns of check boxes to en masse check or uncheck them
all?

Thanks much,

Dan

Daniel B Madvig
Computer Technologies

Northwestern College & Northwestern Media
3003 Snelling Ave.
St. Paul, MN 55113
www.nwc.edu

651.631.5323

image001.jpeg
image001.jpeg

Right click.
image001.jpeg

Getting Missing Keyword and not sure what/ where ?

TO: 1 recipient

Show Details

Message body

DECLARE
outer_catalog1 hdsus_update.catalog1%TYPE;
inner_catalog1 hdsus_update.catalog1%TYPE;
inner_catalog2 hdsus_update.catalog2%TYPE;

CURSOR outer_cursor IS SELECT catalog1 FROM hdsus_update;

OPEN outer_cursor;
LOOP
FETCH outer_cursor INTO outer_catalog1;
EXIT WHEN outer_cursor%NOT_FOUND;
BEGIN
CURSOR inner_cursor IS SELECT catalog1, catalog2 FROM hdsus_update for UPDATE
OPEN inner_cursor;
index BINARY_INTEGER:=0;
LOOP
FETCH inner_cursor INTO inner_catalog1, inner_catalog2;
EXIT WHEN inner_cursor%NOT_FOUND;
if (inner_catalog2 == outer_catalog1)
BEGIN
if (inner_catalog1 != outer_catalog1)
BEGIN
index := index + 1;
END
inner_catalog2 = inner_catalog2 + index;
END
END LOOP;
END
CLOSE inner_cursor;
END LOOP;

CLOSE outer_cursor;

There are a lot of problems with this bit of PL/SQL code – at least I
assume it’s supposed to be PL/SQL; some of it looks more like Java.

… and, of course, if you’re writing PL/SQL rather than Java, you can
use some of the constructs that PL/SQL has and Java doesn’t, such as
cursor FOR loops:

DECLARE

inner_catalog2 hdsus_update . catalog2% TYPE;

indx BINARY_INTEGER;

begin

for outer_cursor IN (SELECT catalog1 FROM hdsus_update ) LOOP

indx := 0 ;

for inner_cursor in (SELECT catalog1 , catalog2 FROM hdsus_update

WHERE catalog2 = outer_cursor . catalog1

AND catalog1 <> outer_cursor . catalog1 ) LOOP

indx := indx + 1 ;

inner_catalog2 := inner_catalog2 + indx ;

END LOOP;

END LOOP;

end;

Nate Schroeder

Enterprise Services - Data Management Team

Monsanto Company

800 N. Lindbergh Blvd. LC4D - Saint Louis, MO - 63167

314-694-2592

Well knock me over with a feather! How could it be so simple?

Embarrassed yes, but now enlightened.

Thanks much,

Dan

Daniel B Madvig
Computer Technologies

Northwestern College & Northwestern Media
3003 Snelling Ave.
St. Paul, MN 55113
www.nwc.edu

651.631.5323
image001.jpeg