Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Ref Cursor and type

    Hi all

    I finally got the Ref Cursor stored procedure working but am stuck on the
    following. I have this package body:

    CREATE OR REPLACE PACKAGE BODY PACK_MYCURSOR AS
    PROCEDURE REFCUR (
    theuserid IN OUT users.user_id%type,
    userfirstname OUT users_TableRows) IS
    BEGIN
    OPEN userfirstname FOR
    select * from users
    where user_id = theuserid
    ;
    END REFCUR ;
    END PACK_MYCURSOR ;
    /

    Now this is working fine, but I would need to have explisit fields in the
    select statement, like "select user_id from users", but when I do this then I
    get error messages of "expression is of wrong type". Anybody know how to solve
    this?

    Thank you.

    nitai_co Guest

  2. Similar Questions and Discussions

    1. Problem with character palette and Tracking field: can't type zero after type is modified
      System: Illustrator CS, Panther 10.3.3 Try this: Create a few characters of type. Select some letters and change their tracking (Option + Command...
    2. Illustrator CS type cursor, character & formatting
      Has anyone else had a problem with the text cursor in a text box in Illustrator CS not being visible? It does not matter where you try to position it...
    3. cursor 200-problem on mac but not pc? how to swap cursor image?
      Hi, I want to hide the cursor in my projector. I've been using "cursor 200" for some time now and it works fine. But now, when I try my projector...
    4. Change the "web hand" cursor in normal arrow cursor?
      Visit my page at http://www.frenchberliner.com and see the swap image...when you fly over it to see the effecct the cursor changes in a small hand as...
    5. Locking a single row - what type of a cursor to use?
      Hi, What's the best way to keep a record locked while you are modifying it so that nobody else can change the record (reading it should be...
  3. #2

    Default Re: Ref Cursor and type

    Declare your refererence cursor as WEAK type instead of STRONG. In other words,
    do not specify RETURN rowtype%ROWTYPE in your declaration in the spec.

    Declare as:
    TYPE users_TableRows IS REF CURSOR;

    Phil

    paross1 Guest

  4. #3

    Default Re: Ref Cursor and type

    You don't know how many hours I spend on this...Thank you. I am in the middle of reading a PL/SQL Book but some things are just not so easy to crasp :-)
    nitai_co Guest

  5. #4

    Default Re: Ref Cursor and type

    Just another quick question in this regard.

    We are using quite a lot of stored procedures with "Execute immediate" which
    allows us to create dynamic SQL. Now is this possible with the package specs
    too?

    I have this:

    CREATE OR REPLACE PACKAGE similar AS
    TYPE users_TableRows IS REF CURSOR;
    PROCEDURE img_colour (
    theimgid IN OUT users.user_id%type,
    thecur OUT users_TableRows);
    END similar ;
    /

    We would need to have the "users" table to be dynamic, since some use the
    tables with "test_users" and others with "demo_users". Is this even possible?



    nitai_co Guest

  6. #5

    Default Re: Ref Cursor and type

    If you want a GREAT PL/SQL reference, read Oracle PL/SQL Programming by Steven
    Feuerstein from O'Reilly. In my opinion, Feuerstein is the guru of gurus for
    PL/SQL, and he is easy to read and follow.

    Phil

    paross1 Guest

  7. #6

    Default Re: Ref Cursor and type

    Hi Phil

    That's the one I am reading :-)
    nitai_co Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139