cfprocparam and ORACLE

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

  1. #1

    Default cfprocparam and ORACLE

    I need help with an error I am getting;

    I am calling an Oracle DB procedure in a package(people)

    PROCEDURE version_info (version OUT VARCHAR2) IS
    BEGIN
    version := people.ask_version;
    END version_info;
    *****The procedure calls a function which also returns a VARCHAR2*****

    On calling the procedure from my CF page

    <cfstoredproc procedure="people.version_info" datasource="#thedsn#">
    <cfprocparam cfsqltype="CF_SQL_VARCHAR" type="out" variable="version">
    </cfstoredproc>

    I get the following error:

    Error Executing Database Query. - ORA-01008: not all variables bound

    I have just read live docs (6.1) and the binding should work. Can anyone help
    please

    tee4 Guest

  2. Similar Questions and Discussions

    1. CFProcParam - MX7
      Well, you don't have to abandon using them if you don't mind providing the unused parameters with null="no". I've been doing this for years (since...
    2. Problem with cfsqltype attribute of cfprocparam
      I am using Microsoft SQL server 2000. The cfsqltype attribute of cfprocparam supports the following as shown below (extract from in its...
    3. GUID and CFProcParam
      I have a new client who is using GUID's as the primary key of their Customer table rather than the integer that most of my other clients use. When...
    4. Max number of decimal places in cfprocparam?
      It appears that the maximum number of decimal places that cfprocparam will return is 12, using this syntax: <cfprocparam type="Out"...
    5. cfprocparam sending "???????" to SQL Server
      I have a SQL Server stored procedure that expects an nvarchar parameter. The cfprocparam is sending Russian characters, but the stored proc seems...
  3. #2

    Default cfprocparam and ORACLE

    I need help with an error I am getting;

    I am calling an Oracle DB procedure in a package(people)

    PROCEDURE version_info (version OUT VARCHAR2) IS
    BEGIN
    version := people.ask_version;
    END version_info;
    *****The procedure calls a function which also returns a VARCHAR2*****

    On calling the procedure from my CF page

    <cfstoredproc procedure="people.version_info" datasource="#thedsn#">
    <cfprocparam cfsqltype="CF_SQL_VARCHAR" type="out" variable="version">
    </cfstoredproc>

    I get the following error:

    Error Executing Database Query. - ORA-01008: not all variables bound

    I have just read live docs (6.1) and the binding should work. Can anyone help
    please

    tee4 Guest

  4. #3

    Default Re: cfprocparam and ORACLE

    Nothing obvious, but a couple of things to consider. Does this procedure return
    the correct value when called from SQL Plus? Also, what happens if you replace
    the function call in your procedure with a constant, so that you are setting
    the value of version with a known value? Is the function inside the procedure
    being called accross a dblink? When I searched Oracle Metalink I got quite a
    few hits on this error, and below ia just one sample:

    Symptoms
    A stored procedure calls an overloaded function that is in a package. Some of
    the tables use a dblink to access data in an 8.1.7.4 remote database. The first
    time the stored procedure calls the function, it works fine. Subsequent calls
    to the same function results in the error:

    ORA-01008: not all variables bound

    In the absence of very much information, if the answer to my first question is
    no, and the procedure returns a good value when using a constant, then I would
    suspect the function call as being the problem area.

    Phil

    paross1 Guest

  5. #4

    Default Re: cfprocparam and ORACLE

    See [url]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=6&threadid=1151346&enterthre ad=y[/url]

    Phil
    paross1 Guest

  6. #5

    Default Re: cfprocparam and ORACLE

    Many thanks for your response.

    I have actually written another procedure that calls the same function, but it
    returns a VARCHAR instead of a VARCHAR2 and it works!

    PROCEDURE get_version (p_version OUT VARCHAR) IS
    BEGIN
    p_version := cfi_person_org.ask_version;
    END get_version;

    INSTEAD OF

    PROCEDURE get_version (p_version OUT VARCHAR2) IS
    BEGIN
    p_version := cfi_person_org.ask_version;
    END get_version;

    But isn't VARCHAR deprecated in ORACLE

    tee4 Guest

  7. #6

    Default Re: cfprocparam and ORACLE

    VARCHAR is technically a subtype of VARCHAR2, but I would consider it
    depricated and not use it if possible. Perhaps the cfi_person_org.ask_version
    function is old and uses the VARCHAR data type. If you can't alter the
    function, then try casting its return value to VARCHAR2 before setting p_version

    Does this work?

    PROCEDURE get_version (p_version OUT VARCHAR2) IS
    BEGIN
    p_version := CAST(cfi_person_org.ask_version AS VARCHAR2);
    END get_version;

    Phil

    paross1 Guest

  8. #7

    Default Re: cfprocparam and ORACLE

    Sorry, what I was actually trying to point our is that the version of the
    procedure that returns a VARCHAR2 doesn't work but the version that returns a
    VARCHAR works but the problem is VARCHAR is deprecated.

    I can' t understand why there is a binding error with the version that returns
    VARCHAR2 though!

    tee4 Guest

  9. #8

    Default Re: cfprocparam and ORACLE

    Well, it looks like the data type of cfi_person_org.ask_version is VARCHAR, and
    for whatever reason, something is objecting to that value being passed as an
    OUT parameter of your procedure as a VARCHAR2. My suggestion is just to CAST
    the return value of cfi_person_org.ask_version to a VARCHAR2 so that your
    procedure can return a VARCHAR2. If that isn't what you want to do, then
    whatever.

    Phil

    paross1 Guest

  10. #9

    Default Re: cfprocparam and ORACLE

    Thanks
    tee4 Guest

  11. #10

    Default Re: cfprocparam and ORACLE

    ....or you could "fix" cfi_person_org.ask_version, you know, find out why its return value datatype is VARCHAR.

    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