Mario Vargas Llosa won the Nobel Prize

Leave a comment

I just find out that one of my favorite authors won an well deserved Nobel Prize. I’m talking about Mario Vargas Llosa, an author that never disappointed me.

I like all the books written by him I read.

Mario Vargas Llosa

Mario Vargas Llosa


About three years ago I read In Praise of the Stepmother and I was shocked by the calmness of the language, by the naturalness of the language, by the ease with which the author deals with sensitive subjects and by the contrast between the age, the behavior and the opinions of others about the main character.

Second book of Mario Vargas Llosa I read was The Bag Girl. This book is the reason I think the author is a master of novel composition and a genius. It’s one of my favorite books ever! I started the book with curiosity, by the time I reach the middle, I was charmed by it and when I got at the last quarter of it, I couldn’t let the book from my hand. Truly amazing! Even now, when I think of it I can feel the emotion of reading it!

The third book I read is Aunt Julia and the Scriptwriter a book that did’t impressed me as the first two, but I’d still recommend anyone to read.

These days I’ll start The Storyteller. Can’t hardly wait!

Can you recommend other books by him?

PL\SQL function return table

1 Comment

I tried today to return a table from a PL\SQL function and than use the result in Java, using JDBC.

First, create a temporary table:

CREATE GLOBAL TEMPORARY TABLE CLIENTS
(
    FILE_LINE_NUMBER INTEGER, 
    CIF INTEGER
) ON COMMIT DELETE ROWS ;

Than we have to define a type, using the created table columns and a table, for the defined type:

CREATE TYPE CLIENTS_TYPE AS OBJECT (FILE_LINE_NUMBER INTEGER, CIF INTEGER);
CREATE TYPE CLIENTS_TABLE AS TABLE OF CLIENTS_TYPE;

And of course, define the function:

CREATE OR REPLACE FUNCTION GET_CIFS RETURN CLIENTS_TABLE PIPELINED AS 
TYPE T_REF_CURSOR IS REF CURSOR;    
LC_CIFS        T_REF_CURSOR;
LR_OUT_REC             CLIENTS_TYPE := CLIENTS_TYPE(NULL, NULL);
    
BEGIN
    OPEN LC_CIFS FOR 
        SELECT 
            FILE_LINE_NUMBER,
            CIF 
        FROM CLIENTS;
        
        LOOP
            FETCH LC_CIFS 
            INTO 
                LR_OUT_REC.FILE_LINE_NUMBER,    
                LR_OUT_REC.CIF;
            EXIT WHEN LC_CIFS%NOTFOUND;
            PIPE ROW(LR_OUT_REC);
        END LOOP;
    CLOSE LC_CIFS;
    RETURN;
END;

For testing the function from PL\SQL we may use:

INSERT INTO CLIENT_FOR_PROMO VALUES(10, 10);
INSERT INTO CLIENT_FOR_PROMO VALUES(100, 100);
INSERT INTO CLIENT_FOR_PROMO VALUES(43, 32);
SELECT * FROM TABLE(GET_CIFS());

Now, in Java we just have to create a JDBC statement containing the SELECT * FROM TABLE(GET_CIFS()); code, and iterate through the ResultSet.