0

I have following plsql script that prints record parameters. Is there a way to print all column values just passing country_record. I mean I do not want to write all column name like country_record.country_id

 DECLARE
       country_record   countries%ROWTYPE;
       countryid        countries.country_id%TYPE;
    BEGIN
       countryid := &countryid;

       SELECT *
         INTO country_record
         FROM countries
        WHERE country_id = countryid;

       DBMS_OUTPUT.put_line ('id: ' || country_record.country_id);
    END;
1

1 Answer 1

1

If printing it all you wanted, you can try out this. Using SQL*Plus

VARIABLE MYCUR SYSREFCURSOR;

 DECLARE
       country_record   countries%ROWTYPE;
       countryid        countries.country_id%TYPE;
       plsql_cursor SYS_REFCURSOR;
    BEGIN
       countryid := &countryid;

       OPEN :MYCUR for 
       SELECT *
         FROM countries
        WHERE country_id = countryid;

    END;
  /

  print mycur;
Sign up to request clarification or add additional context in comments.

2 Comments

I am using TOAD,Is there a similar solution for it?
Same concept, an answer here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.