Boolean with procparam?

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

  1. #1

    Default Boolean with procparam?

    :o

    Seems like I would have run into this in the years and years I've been writing
    CF, but alas, no. How does one pass a boolean with cfprocparam? I have to call
    a handful of stored procs in a new CF app. I do not have the option of changing
    the stored procedures because they are used by many other apps too.

    Thanks in advance!

    ploring Guest

  2. Similar Questions and Discussions

    1. Flex CFC Boolean
      Since days I try to do something within Flex that should be very simple (like in any other language): Calling a CFC function and use the returned...
    2. Stored procedure's Procparam maxlength
      I have been using a stored procedure in Coldfusion 6.1 that has <cfprocparam type="in" cfsqltype="cf_sal.decimal' maxlength="3" scale=2"...
    3. boolean BoundColumn
      Hello, I have bound a BoundColumn to a DataGrid, which is linked to a collection whose 1rst element is a bool. The DataGrid then displays...
    4. Converting Boolean into Bit
      Hi Can anybody help to to transfer a value from Controlbox (boolean) into an SQL-Server (saved as bit). How am I able to convert boolean to bit....
    5. boolean operation
      hi all, what is oposite of if ($_periode == NULL || $_periode == "") it is not if ($_periode != NULL || $_periode != "") kind regards
  3. #2

    Default Boolean with procparam?

    :o

    Seems like I would have run into this in the years and years I've been writing
    CF, but alas, no. How does one pass a boolean with cfprocparam? I have to call
    a handful of stored procs in a new CF app. I do not have the option of changing
    the stored procedures because they are used by many other apps too.

    Thanks in advance!

    ploring Guest

  4. #3

    Default Re: Boolean with procparam?

    It *should* be the same as cfqueryparam...cf_sql_bit
    HTH

    --
    Tim Carley
    [url]www.recfusion.com[/url]
    [email]info@NOSPAMINGrecfusion.com[/email]
    Mountain Lover Guest

  5. #4

    Default Re: Boolean with procparam?

    Naw, using a 0/1 with cf_sql_bit, passing it to a stored proc param in oracle
    defined like this:
    procedure myprocedure (p_mybooeanvariable in
    boolean default false)

    Fails with PLS-00306: wrong number or types of arguments in call to
    'myprocedure'

    ploring Guest

  6. #5

    Default Re: Boolean with procparam?

    The first thing that comes to mind, so it may not be the best, would be to
    create a different stored procedure to call the one you cannot change. Instead
    of boolean parameters, you could use something else in this procedure.

    JR


    jonwrob Guest

  7. #6

    Default Re: Boolean with procparam?

    Just for grins .... did you try cf_sql_bit with a "value" of "true" or "false"?
    mxstu Guest

  8. #7

    Default Re: Boolean with procparam?

    Hmm, the
    [url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/[/url]
    wwhelp.htm?context=ColdFusion_Documentation&file=0 0000317.htm doesn't show
    anything for Oracle and boolean. It's been a while since I've used Oracle, but
    is boolean a valid Oracle data type?


    mxstu Guest

  9. #8

    Default Re: Boolean with procparam?

    Yes boolean is a correct type. So try CF_SQL_BINARY. Reference source you linked to is incorrect anyway.

    CF_Oracle Guest

  10. #9

    Default Re: Boolean with procparam?

    Originally posted by: CF_Oracle
    Yes boolean is a correct type. So try CF_SQL_BINARY. Reference source you
    linked to is incorrect anyway.


    CF_Oracle - I'm assuming by your moniker that you've used Oracle more recently
    than I have ;-) Is boolean a true Oracle data type (not just PL/SQL)? Also,
    in what way are the livedocs wrong?


    mxstu Guest

  11. #10

    Default Re: Boolean with procparam?

    Boolean is a PL/SQL datatype, which is NOT supported by the Oracle RDBMS.
    Hence, there is no such thing as a column of type Boolean in an Oracle table.
    Per chapter 12 of Oracle PL/SQL Programming, 3rd edition (Feuerstein), "Because
    there is no counterpart for the PL/SQL Boolean in the Oracle RDBMS, you can
    neither SELECT into a Boolean variable nor insert a TRUE or FALSE value
    directly into a database column." This implies that you are unlikely to find an
    equivalent of a Boolean CFSQLType for your CFPROCPARAM.

    Phil

    paross1 Guest

  12. #11

    Default Re: Boolean with procparam?

    Thanks Phil. That's exactly what I was asking.

    Should have just looked at some of the JDBC documentation which spells it out
    pretty clearly...

    - Boolean is not a supported JDBC type. Accessing Boolean type from Java using
    JDBC is not possible as of now. So a mapping of Boolean to another SQL type
    that is understood by JDBC is required. Integer type is understood by JDBC and
    PL/SQL

    -Oracle JDBC drivers do not support calling arguments or return values of the
    PL/SQL TABLE, BOOLEAN, or RECORD types. This is a restriction of the OCI layer.

    As a work-around for booleans, you can define an additional PL/SQL stored
    procedure that accepts the BOOLEAN argument as a CHAR or NUMBER and passes it
    as a BOOLEAN to the original stored procedure. For more information on this
    topic, see "Boolean Parameters in PL/SQL Stored Procedures".



    mxstu Guest

  13. #12

    Default Re: Boolean with procparam?

    mxtu, cf_sql_date type does not work - see discussion at
    [url]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=6&thread[/url]
    id=1010746&highlight_key=y&keyword1=oracle.
    Also, cf_sql_date and cf_sql_time work fine at least in CF7 with Oracle 9i but
    it's not shown in the referenced table.

    CF_Oracle Guest

  14. #13

    Default Re: Boolean with procparam?

    See a good blog for workaround with stored procedures using boolean : [url]http://awads.net/wp/2005/08/25/coldfusion-to-oracle-via-a-boolean/[/url]
    CF_Oracle 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