ORA-01006: bind variable does not exist

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

  1. #1

    Default ORA-01006: bind variable does not exist

    I have an Oracle package with 2 procedures. The 1st one is just an insert
    statement and the 2nd one takes care of updates/deletes.

    I can run the 1st one without any problem. But on the 2nd one, I keep on
    getting ORA-10006 error on the variable "p_return_code" if I ran it using
    Coldfusion.

    I have checked the variable names several times and as you can see, the 1st
    "p_return_code" is exactly the same as the 2nd one. But the 2nd procedure just
    won't run.

    I can compile the package without any problems. and <b>I can run the 2nd
    procedure from an Oracle client without any problems</b>.

    Any ideas?

    Please see the code below. Thank you.
    ==========
    ONLY the header part so I wouldn't clutter my message.

    CREATE OR REPLACE PACKAGE MAINTAIN_CLASSES AS

    PROCEDURE ADD_CLASS (
    p_class IN celc.classes.class%TYPE,
    p_update_by IN celc.classes.updated_by%TYPE,

    p_return_code OUT INT);

    PROCEDURE UPDATE_DELETE_CLASS (
    p_class_id_list IN VARCHAR2,
    p_class_list IN VARCHAR2 DEFAULT NULL,
    p_updated_by IN celc.classes.updated_by%TYPE,

    p_return_code OUT INT);

    END MAINTAIN_CLASSES;
    ======================

    If my CFM file, I have the following cfstoredproc statements with
    corresponding cdprocparam statements

    <cfstoredproc procedure="MAINTAIN_CLASSES.ADD_CLASS" datasource="celc">
    <cfprocparam variable="p_class" type="in" cfsqltype="cf_sql_varchar"
    value="#form.class#">
    <cfprocparam variable="p_updated_by" type="in" cfsqltype="cf_sql_varchar"
    value="vill0042">
    <cfprocparam variable="p_return_code" type="out"
    cfsqltype="cf_sql_integer">
    </cfstoredproc>


    <cfstoredproc procedure="MAINTAIN_CLASSES.UPDATE_DELETE_CLASS"
    datasource="celc">
    <cfprocparam variable="p_class_id_list" type="in"
    cfsqltype="cf_sql_varchar" value="#classIDList#">
    <cfprocparam variable="p_class_list" type="in" cfsqltype="cf_sql_varchar"
    value="#classList#">
    <cfprocparam variable="p_updated_by" type="in" cfsqltype="cf_sql_varchar"
    value="vill0042">
    <cfprocparam variable="p_return_code" type="out"
    cfsqltype="cf_sql_integer">
    </cfstoredproc>


    jayel.villamin Guest

  2. Similar Questions and Discussions

    1. #39251 [NEW]: variable variable class array property is read only
      From: taskfreak at gmail dot com Operating system: mac os PHP version: 5.1.6 PHP Bug Type: Class/Object related Bug...
    2. is it possible to bind required property of thevalidator to some variable or return value from a function
      In my code I need to change the required property of validator change based on a selectedItem of a list component. I do not want validators to...
    3. can i use dynamic variable inside a dataadapter and bind to datagrid
      Hi I want to use a sql designed in the dataadapter and I want to pass a variable so it can retrieve related data by using "WHERE" clause in the...
    4. PARSING STEPS AND BIND VARIABLE : HELP, THOMAS, PLEASE !
      Thomas, You always repeat that the parsing steps and the use of bind variables are the most importants things to understand for developpers. I...
  3. #2

    Default ORA-01006: bind variable does not exist

    I have an Oracle package with 2 procedures. The 1st one is just an insert
    statement and the 2nd one takes care of updates/deletes.

    I can run the 1st one without any problem. But on the 2nd one, I keep on
    getting ORA-10006 error on the variable "p_return_code" if I ran it using
    Coldfusion.

    I have checked the variable names several times and as you can see, the 1st
    "p_return_code" is exactly the same as the 2nd one. But the 2nd procedure just
    won't run.

    I can compile the package without any problems. and <b>I can run the 2nd
    procedure from an Oracle client without any problems</b>.

    Any ideas?

    Please see the code below. Thank you.
    ==========
    ONLY the header part so I wouldn't clutter my message.

    CREATE OR REPLACE PACKAGE MAINTAIN_CLASSES AS

    PROCEDURE ADD_CLASS (
    p_class IN celc.classes.class%TYPE,
    p_update_by IN celc.classes.updated_by%TYPE,

    p_return_code OUT INT);

    PROCEDURE UPDATE_DELETE_CLASS (
    p_class_id_list IN VARCHAR2,
    p_class_list IN VARCHAR2 DEFAULT NULL,
    p_updated_by IN celc.classes.updated_by%TYPE,

    p_return_code OUT INT);

    END MAINTAIN_CLASSES;
    ======================

    If my CFM file, I have the following cfstoredproc statements with
    corresponding cdprocparam statements

    <cfstoredproc procedure="MAINTAIN_CLASSES.ADD_CLASS" datasource="celc">
    <cfprocparam variable="p_class" type="in" cfsqltype="cf_sql_varchar"
    value="#form.class#">
    <cfprocparam variable="p_updated_by" type="in" cfsqltype="cf_sql_varchar"
    value="vill0042">
    <cfprocparam variable="p_return_code" type="out"
    cfsqltype="cf_sql_integer">
    </cfstoredproc>


    <cfstoredproc procedure="MAINTAIN_CLASSES.UPDATE_DELETE_CLASS"
    datasource="celc">
    <cfprocparam variable="p_class_id_list" type="in"
    cfsqltype="cf_sql_varchar" value="#classIDList#">
    <cfprocparam variable="p_class_list" type="in" cfsqltype="cf_sql_varchar"
    value="#classList#">
    <cfprocparam variable="p_updated_by" type="in" cfsqltype="cf_sql_varchar"
    value="vill0042">
    <cfprocparam variable="p_return_code" type="out"
    cfsqltype="cf_sql_integer">
    </cfstoredproc>


    jayel.villamin Guest

  4. #3

    Default Re: ORA-01006: bind variable does not exist

    Please put code of 2nd procedure. Also, how did you provide IN parameters when tested in Oracle? What are their source in ColdFusion?
    CF_Oracle Guest

  5. #4

    Default Re: ORA-01006: bind variable does not exist

    Since you are declaring the OUT parameters in your PL/SQL as type INT (ANSI),
    which is actually a subtype of Oracle type NUMBER, you might try using
    CFSQLType = CF_SQL_DECIMAL instead of CF_SQL_INTEGER. Not sure if it will make
    a difference, but I'd give it a shot. (Also, you don't need the variable
    attribute in your cfprocparam tags for type="in", as this attribute is only
    required for OUT or INOUT types. )

    How does your 2nd PL/SQL procedure run if you EXECUTE it from SQL Plus? Are
    any of your IN parameters NULL?

    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