jueves, 15 de abril de 2010

oracle

DECLARE
CADE VARCHAR2(30);
BEGIN
CADE:='@INPUT';
IF 1>1 THEN
DBMS_OUTPUT.PUT_LINE(CADE);
ELSE
DBMS_OUTPUT.PUT_LINE('NADA QUE MOSTRAR');
END IF;

CASE 3>5
WHEN 1!=1 THEN
DBMS_OUTPUT.PUT_LINE('1 ES IGUAL A 1');
ELSE
DBMS_OUTPUT.PUT_LINE('SE DESCONOCE LA RESPUESTA');
END CASE;

FOR I IN 1..20 LOOP
DBMS_OUTPUT.PUT_LINE(I);
END LOOP;

END;


otras

DECLARE
CURSOR c IS SELECT item_title FROM item;
BEGIN
FOR i IN c LOOP
dbms_output.put_line('The title is ['||i.item_title||']');
END LOOP;
END;

BEGIN
FOR i IN (SELECT item_title FROM item) LOOP
dbms_output.put_line('The title is ['||i.item_title||']');
END LOOP;
END;

OPEN cursor_name [(parameter1,parameter(n+1))];
LOOP
FETCH cursor_name
INTO row_structure_variable | column_variable1 [,column_variable(n+1)];
EXIT WHEN cursor_name%NOTFOUND;
statement;
END LOOP;
CLOSE cursor_name;

No hay comentarios: