cfstoredproc with REF Cursor as out param

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

  1. #1

    Default cfstoredproc with REF Cursor as out param

    Hi all,

    I am trying to call a stored procedure which has 3 input params and 1 out
    apram which is a refcursor.
    I am using CF MX 7

    I am getting this error -
    "PLS-00306: wrong number or types of arguments in call to 'GET_METADATA'
    ORA-06550: line 1, column 7"

    This is my CF Code for calling the Stored Procedure :-
    I get the same error even if I use only OUT or or only CFPROCRESULT (and not
    both)
    ===
    <CFSTOREDPROC procedure = "METADATA.get_Metadata"
    dataSource = "mydatasource"
    returnCode = "No">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_NUMERIC"
    value = "pageid">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_VARCHAR"
    value = "myFormName">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_VARCHAR"
    value = "myfieldName">

    <CFPROCPARAM type = "OUT"
    CFSQLType = "CF_SQL_REFCURSOR"
    variable = "METADATA_CURTYPE">
    <CFPROCRESULT name = "metadataResult">
    </CFSTOREDPROC>
    ========


    Below is the PACKAGE definition :-
    PACKAGE METADATA
    IS

    TYPE metadata_recordtype IS RECORD
    (
    fieldName FORMINPUTCONTROL.FIELDNAME%TYPE,
    fieldValue DATA_FIELDVALUE.fieldvalue%TYPE
    ) ;

    TYPE metadata_curtype IS REF CURSOR RETURN metadata_recordtype;


    PROCEDURE get_metadata(
    PAGEID IN Data_FieldValue.PageId%Type,
    FORMNAME IN FORMCONTROL.FormName%Type,
    INHERIT_FIELDNAME IN FormInputControl.fieldname%Type,
    METADATA_CURVAR OUT metadata_curtype
    );
    END Metadata;


    Please help !

    Thanks in advance,
    kn


    qgh Guest

  2. Similar Questions and Discussions

    1. cfstoredproc: PL/SQL: Statement ignored
      Hoping someone can tell me what I'm doing wrong. I'm getting the error: ORA-06550: line 1, column 13: PLS-00306: wrong number or types of...
    2. Help with cfstoredproc
      OK I have huge problem with my cfstored proc I have stored procedure which retrieve lost password when you provide email. Stored procedure is...
    3. cfquery vs cfstoredproc
      In my experience, the SPs execute a little faster then the queries. you can use to test on your own. <CFSET start=GetTickCount()> ... some CFML code...
    4. cfstoredproc
      Any chance you're interested in emailing with me about CF coding related to a Informix db back-end? Please email me off-list at...
    5. 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...
  3. #2

    Default Re: cfstoredproc with REF Cursor as out param

    You should not include the CFPROCPARAM tag for the OUT ref cursor, the result
    set is captured in the CFPROCRESULT tag.

    [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-b17.htm#wp1102246[/url]

    CFML supports Oracle 8 Reference Cursor type, which passes a parameter by
    reference. Parameters that are passed this way can be allocated and deallocated
    from memory within the execution of one application. To use reference cursors
    in packages or stored procedures, use the cfprocresult tag. This causes the
    ColdFusion JDBC database driver to put Oracle reference cursors into a result
    set. (You cannot use this method with Oracle's ThinClient JDBC drivers.)

    Phil

    paross1 Guest

  4. #3

    Default Re: cfstoredproc with REF Cursor as out param

    I still get the "PLS-00306: wrong number or types of arguments in call to
    'GET_METADATA' ORA-06550: line 1, column 7"

    I using only CFPROCRESULT below and not cfprocparam for the out variable
    anymore
    ANy ideas?

    <CFSTOREDPROC procedure = "METADATA.get_Metadata"
    dataSource = "mydatasource"
    returnCode = "No">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_NUMERIC"
    value = "pageid">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_VARCHAR"
    value = "myFormName">

    <CFPROCPARAM type = "IN"
    CFSQLType = "CF_SQL_VARCHAR"
    value = "myfieldName">


    <CFPROCRESULT name = "metadataResult">
    </CFSTOREDPROC>

    qgh Guest

  5. #4

    Default Re: cfstoredproc with REF Cursor as out param

    What kind of drivers are you using? Live docs states "You cannot use this
    method with Oracle's ThinClient JDBC drivers.", so if you are using ThinClient
    JDBC drivers, you appear to be out of luck.

    Phil

    paross1 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