CFStoredProc stopped working

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

  1. #1

    Default CFStoredProc stopped working

    I am currently upgrading to CF MX7 Enterprise from CF MX Enterprise. I have a
    CFStoredProc tag that works on MX but does not work on MX 7. The CFML and
    Oracle function are included below. The database is Oracle 9i. I am calling an
    Oracle function located in a package. I get the following error:
    "[Macromedia][Oracle JDBC Driver]Incorrect parameter bindings for stored
    procedure call. Check your bindings against the stored procedure's parameters. "

    Any help would be greatly appreciated.

    CFML:
    <cfstoredproc procedure="pk_tom_project.find_sat" datasource="ultra"
    debug="yes">
    <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" value="#thedate#" null="no">
    <cfprocparam type="Out" cfsqltype="CF_SQL_VARCHAR" variable="v_sat">
    </cfstoredproc>

    Oracle:
    FUNCTION find_sat (t_date IN VARCHAR2)
    RETURN VARCHAR2
    IS
    v_dat VARCHAR2 (3);
    v_sat VARCHAR2 (15);
    BEGIN
    v_dat := TO_CHAR (TO_DATE (t_date), 'DY');
    IF v_dat = 'SAT'
    THEN
    v_sat := t_date;
    ELSE
    SELECT NEXT_DAY (t_date, 'SAT')
    INTO v_sat
    FROM DUAL;
    END IF;
    RETURN v_sat;
    END find_sat;


    mikedc16 Guest

  2. Similar Questions and Discussions

    1. Help stopped working in Acrobat 8
      Hi, I have Acrobat 8 Pro, in a Mac, and suddenly the Help is not working. When I try to open the Complete Adobe Acrobat 8 Professional Help,...
    2. #38816 [Opn]: PHP code that was working perfectly recently stopped working.
      ID: 38816 User updated by: mtoohee at gmail dot com -Summary: PHP code that was working perfectly recently stopped....
    3. ASP stopped working in IIS 5
      Take a look at the thread with almost the same subject from about an hour prior to yours. Also take a look at http://www.aspfaq.com/2109. Ray at...
    4. My PE2 stopped working on my E-Mac
      Hi can someone help out there ? I have E-mac with 768 MB RAM. My PE2 has approximately 5400 pictures and I have been tranferring this pictures to...
    5. ASP.NET pages stopped working
      Hi Group, I have a new Dell server that has the .NET Framework 1.1 installed on Windows 2000 SP 3. All was well until I installed Project...
  3. #2

    Default Re: CFStoredProc stopped working

    You cannot call an Oracle stored function from ColdFusion using cfstoredproc,
    as CF has no way of handling the "return value" of an Oracle function. You can
    only call Oracle stored procedures using cfstoredproc. This is how it has been
    since CF 4.5, unless something has changed recently. If you need a value
    returned from a procedure, it must be through a cfprocparam, unless you need a
    result set, in which case the data is returned via a reference cursor and
    cfprocresult.

    Phil

    paross1 Guest

  4. #3

    Default Re: CFStoredProc stopped working

    OK, it looks like "they" made some changes with MX that now allows you to call
    Oracle functions. Your return value will be contained in a variable called
    cfstoredproc.statusCode, so you would no longer use a cfprocparam of type OUT
    to retrieve this value. You would still have your IN cfprocparam, then capture
    your return value in cfstoredproc.statusCode.

    <cfstoredproc procedure="pk_tom_project.find_sat" datasource="ultra"
    debug="yes">
    <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" value="#thedate#"
    null="no"></cfstoredproc>

    <cfoutput>#cfstoredproc.statusCode#</cfoutput>

    Phil

    paross1 Guest

  5. #4

    Default Re: CFStoredProc stopped working

    Well, that got rid of that error, but exposed a new one "[Macromedia][Oracle
    JDBC Driver][Oracle]ORA-06502: PL/SQL: numeric or value error: character to
    number conversion error ORA-06512: at line 1 " which seems to indicate that the
    response from the function won't fit in the status code variable.

    mikedc16 Guest

  6. #5

    Default Re: CFStoredProc stopped working

    Well, there is always plan B - change the function to a procedure, and return
    the value as an OUT parameter instead of a RETURN value. That is what I have
    always done, since I have been using Oracle stored procedures for years, and
    had to do this with ColdFusion 4.5 anyway.

    Phil

    paross1 Guest

  7. #6

    Default Re: CFStoredProc stopped working

    Unless there is some reason that you need to use a function or proc, why not
    just use a sql statement like the following:
    select decode(TO_CHAR (TO_DATE ('t_date'), 'DY'), 'SAT', 't_date', NEXT_DAY
    ('t_date', 'SAT')) "V_SAT" from DUAL
    or even simpler
    select NEXT_DAY (to_date('t_date')-1, 'SAT') "V_SAT" from DUAL

    lxa91dw Guest

  8. #7

    Default Re: CFStoredProc stopped working

    We about 40 functions that we use that I would rather not have to rewrite as
    procedures. I was kind of hoping that someone would have some insight as to why
    the functionality has gone away with MX 7, when usually functionality is
    something that gets added with a new release. It's hard to believe that we are
    the only ones who are using functions.

    mikedc16 Guest

  9. #8

    Default Re: CFStoredProc stopped working

    Did you ever find a soltuion to your problem?
    jsantelli 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