Inference of Boolean Dbtype

Is Inference of the Boolean type going to be supported in the final release of ODP.NET? This is going to be a big hit against us if this is not supported since many of our strong typed datasets have booleans in them for fields, and need to be passed into stored procedures through table adapters.

Hi Chris,
I'm not able to reproduce what you are seeing. Not that it is really necessary for me to be able to, I guess, but I am curious all the same. Plus, I'm a DBA by day...
The Microsoft Oracle adapter supports boolean. You have to manually set it through the designer but it works.
If I follow what you are saying, you might have some very simple code like this:
SQL> create or replace function bool_test(p_in boolean) return varchar2 is
  2    l_retval varchar2(32);
  3  begin
  4    if (p_in = TRUE) then
  5      l_retval := 'true';
  6    else
  7      l_retval := 'false';
  8    end if;
  9    return l_retval;
10  end;
11  /
Function created.So with the above, you are able to use the Microsoft .NET Framework Provider for Oracle and correctly invoke that code? Simple tests I have done throw an "invalid type" error for the boolean parameter.
The designer doesn't display a dropdown of the OracleDbTypes when looking at the properties of a parameter for the beta version of the Oracle Data adapter.
This appears to be working correctly for me, but I have a non-public version of the code at the moment so it might be an issue that is present in the version you have.
- Mark

Similar Messages

  • OracleParameter type inference

    The type inference described in section 3 of the production ODP.NET documentation (table 3.8) seems to be enforced when setting a value directly using OracleCommand.Parameters.Add(), but not when assigning OracleParameter.Value and then adding that parameter to the command. Am I missing something here?
    DateTime thingDateTime = DateTime.Now;
    OracleCommand cmdOne = new OracleCommand();
    OracleParameter paramTemp = new OracleParameter();
    cmd.Parameters.Add("one", thingDateTime);
    paramTemp.ParameterName = "two";
    paramTemp.Value = thingDateTime;
    cmd.Parameters.Add(paramTemp);
    Console.WriteLine("one - Value.GetType:{0}", cmd.Parameters["one"].Value.GetType());
    Console.WriteLine("one - OracleDbType:{0}", cmd.Parameters["one"].OracleDbType.ToString());
    Console.WriteLine("one - DbType:{0}", cmd.Parameters["one"].DbType.ToString());
    Console.WriteLine("");
    Console.WriteLine("two - Value.GetType:{0}", cmd.Parameters["two"].Value.GetType());
    Console.WriteLine("two - OracleDbType:{0}", cmd.Parameters["two"].OracleDbType.ToString());
    Console.WriteLine("two - DbType:{0}", cmd.Parameters["two"].DbType.ToString());
    Console.WriteLine("");
    Console.WriteLine("temp - Value.GetType:{0}", paramTemp.Value.GetType());
    Console.WriteLine("temp - OracleDbType:{0}", paramTemp.OracleDbType.ToString());
    Console.WriteLine("temp - DbType:{0}", paramTemp.DbType.ToString());
    Result:
    one - Value.GetType:System.DateTime
    one - OracleDbType:TimeStamp
    one - DbType:DateTime
    two - Value.GetType:System.DateTime
    two - OracleDbType:Varchar2
    two - DbType:String
    temp - Value.GetType:System.DateTime
    temp - OracleDbType:Varchar2
    temp - DbType:String

    This issue has been identified as a bug in the production release and would be fixed in the next version.

  • Problem With Booleans and Threads

    Since using the .stop() and .resume() properties of a thread are dangerous, I resorted to using Booleans....
    I can get it to stop just fine by setting "keepGoing" to false. That works...
    But when I set the boolean to true... nothing happens. I think the while loop is broken when I set it to false and can't be fixed when the boolean is set back to true.
    There's some deep process I'm not getting with while loops and/or threads.
    Thanks for any help. The first segment of code is what's wrong. Post if it would help to see the rest.
    class startUpdatingThread extends Thread {
          public void run() {
              System.out.println("THREAD STARTING TO RUN!");
            while (keepGoing == true) {
                if (keepGoing == true) {
                Long nextGoAbout = imgTime + 5000;//five seconds more
                if ( ((nextGoAbout - connection.getDate()) < 10000) ) {
                    getnewPicture();
                    imgCanvas.repaint();
    }

    Still a missing }, and you'll still fall out the end of the thread. Something like this:
    class StartUpdatingThread extends Thread
         private volatile boolean     keepGoing = true;
         public void run()
              System.out.println("THREAD STARTING TO RUN!");
              for (;;)
                   synchronized (this)
                        while (!keepGoing)
                             try
                                  this.wait();
                             catch (InterruptedException exc)
                   Long nextGoAbout = imgTime + 5000;//five seconds more
                   if ( ( (nextGoAbout - connection.getDate()) < 10000) )
                        getnewPicture();
                        imgCanvas.repaint();
         public void pause()
              this.keepGoing = false;
         public synchronized void unpause()
              this.keepGoing = true;
              notifyAll();
    }//<--end of StartUpdatingThread()

  • Boolean in a bean

    I have a bean which has a method called isValid() this method returns either true or false.
    public class MyBean{
    //other methods here.............
    public boolean isValid(){
                    //...SQL STATEMENT
              if(result.next())
                   return true;
                   return false;
    }in my JSP page if the method returns false I want to write:
    "Incorrect information entered"
    but if it's true it will say:
    "Information is correct"
    I know how to get properties using the <jsp:getProperty... />
    but not how to get a return value from a method.
    how can I do this in my JSP page?
    Thanks for any help

    yes, but what is the tag for it:
    <jsp:useBean id="test" class="myPackage.MyBean" />
    <jsp:getProperty name="test" Property="What goes here??" />
    Thanks for your help

  • Need to convert a string to boolean

    i have string true, false, i need to convert them to boolean, is it good to use String.equals(true/false) or is it good to use Boolean.valueOf(true/false)
    Regards,
    Surya

    See http://forum.java.sun.com/thread.jsp?forum=54&thread=455788&tstart=0&trange=30.
    Remember, '=' is assignment, '==' is equals...

  • Type def boolean button.

    hi, i'm korean.
    my english is it' too bad. that why i'm sorry.
    first i wanna make type def boolean button.
    it's not problem. but make triangle shape.
    happen problem. like that
    red box is notihing. but if i click there, that is change to true or false.
    i don't know how to make flexible area setting.
    plz help me
    GOOD
    Solved!
    Go to Solution.

    Here is one way to do what you are asking: link
    This thread has a VI (post # 12) that uses triangle butons that may be a good start for you.

  • BOOLEAN DEFAULT FALSE NOT NULL for key-column

    Hello,
    These statements show an unexpected behavior when a column is added to a table as 'BOOLEAN DEFAULT FALSE NOT NULL' and added afterward to the table's primary key column set:
    create table test_1 (a char(1))
    insert into test_1 values('A')
    alter table test_1 add b boolean default false not null
    alter table test_1 add primary key (a,b)
    create table test_2 (a char(1), b boolean default false not null)
    insert into test_2 (a) values('A')
    alter table test_2 add foreign key f_test_1 (a,b) references test_1 (a,b)
          -> [350]: Referential integrity violated
    update test_1 set b=false
    alter table test_2 add foreign key f_test_1 (a,b) references test_1 (a,b)
          -> success
    delete from test_2
    delete from test_1
    insert into test_1 (a,b) values('A',false)
    insert into test_2 (a) values('A')
          -> success
    I think the error message '[350] Referential integrity violated' should not happen because the column 'b' really contains 'false'. But there obviously seem to be a difference before and after setting the column 'b' explicitly to 'false'. I can imagine that this depends on the way how the index for the primary key is updated. Probably the index is not properly updated in this context(?)
    Gabriel

    Hi Gabriel,
    you're right, this is a bug and indeed seems to caused by the way the DEFAULT boolean is stored in the page.
    (There is no separate index for the primary key in MaxDB as all data is stored in B*trees - basically the table is the primary key).
    This is how the record looks like when column b is 'false' only due to the change of the DEFAULT value:
    ROOT/LEAF 460  perm       entries : 1         [block 0]
         bottom  : 93         filevers: 14888     convvers: 83
                                                  writecnt: 1
      1: (pos 00081)
    00001      recLen      : 12                recKeyLen   : 4
    00005      recVarcolOff: 0                 recVarcolCnt: 0
         record
          1  2  3  4  5  6  7  8  9 10 11 12
         81 82 83 84 85 86 87 88 89 90 91 92
    dec: 12  0  4  0  0  0  0  0 32 65  0  0
    hex: 0C 00 04 00 00 00 00 00 20 41 00 00
    chr:                             A
    And this is how it looks like after the explicit UPDATE:
    ROOT/LEAF 460  perm       entries : 1         [block 0]
         bottom  : 93         filevers: 14888     convvers: 84
                                                  writecnt: 2
      1: (pos 00081)
    00001      recLen      : 11                recKeyLen   : 3
    00005      recVarcolOff: 0                 recVarcolCnt: 0
         record
          1  2  3  4  5  6  7  8  9 10 11
         81 82 83 84 85 86 87 88 89 90 91
    dec: 11  0  3  0  0  0  0  0 32 65  0
    hex: 0B 00 03 00 00 00 00 00 20 41 00
    chr:                             A
    Little difference but this leads to the problems during the foreign key validation.
    I'll inform the developers next week about this.
    As a workaround you'll have to explicitly update the columns for which you change the default setting.
    regards,
    Lars

  • Page Validation - Function Returning Boolean - Check for NULL

    I have 3 Page Validations which all fire on "When Button Pressed" = "Submit".
    <br><br>
    Number 1 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT1".
    <br>
    Number 2 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT2".
    <br>
    Number 3 is of type "Function Returning Boolean" and has the following code:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NOT NULL, I get the Error from Validation 1. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NULL, I get the Error from Validation 2. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NOT NULL, I don't get an Error Message. Perfect.
    <br><br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NULL, I get Error Message 1 & 2, <strong>but nothing from 3.</strong>
    <br><br>
    If I change the code to:
    <br><br>
    IF :P199_BUSINESS_UNIT1 = '01'   AND
       :P199_BUSINESS_UNIT2 = '01'  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    and change both values to '01', I get the appropriate Error Message.
    <br><br>
    What is going on? Is there some reason I can't check for NULL in a Function Returning Boolean?

    Scott,
    <br><br>
    Instead of adding the Validations, I changed my code from:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;
    <br>to the following and got the desired results:
    <br><br>
    IF  REPLACE(:P199_BUSINESS_UNIT1,<strong>'%null'</strong> || '%',NULL) IS NULL   AND
        REPLACE(:P199_BUSINESS_UNIT2,<strong>'%null'</strong> || '%',NULL) IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    Note that I changed the word REPLACE to upper case and the second occurrence of the word NULL to upper case to accentuate the fact that the '%null' is case sensitive, using "%NULL' does not work, it has to be "%null' in lower case.
    <br><br>
    <strong>Thanks for your help.</strong>

  • Boolean troublesho​oting

    Hello every body
    I am trying to make a loop, and i got stuck at the following part. please suggest an appropriate solution:
    I want to make a loop which starts saving data when it recieves a 'True' from a boolean control and then bypasses the loop itself and keeps on collecting data irrespective of the boolean output. I am attaching my 'vi'
    Attachments:
    TEST2.11.vi ‏396 KB

    To latch a Boolean, you just need a shift register as shown below. Also, from what I can tell, you have no way to stop the program unless you use the Abort Button on the toolbar. Wire a stop button to the stop input of the DAQ Assistant. For clarity, you might also want to convert the output of your Greater Than function to a single Boolean. I thoroughly despise dynamic data because it just makes it harder to see the actual data type.
    Message Edited by Dennis Knutson on 06-13-2008 01:28 PM
    Message Edited by Dennis Knutson on 06-13-2008 01:31 PM
    Attachments:
    Latch a Boolean.PNG ‏4 KB

  • Problem with Booleans and events

    I have an event structure inside a while loop. I have several buttons each of which triggers one event. Now no matter what latch action I try with these at any point of time only one of the events run. So if I want to run another event I have to stop the main vi run it again and then go to the next event. I guess what this means is that the events are not being terminated by value change. But I have tried to reset the value of the boolean as well in order to terminate but event this doesnt seem to work.There is some fundamental problem somewhere but I am unable to figure it out. Can somebody please help me.
    I am attaching a sample vi and sub vis that demonstrate this problem. In this case I need to have the booleans h
    ave the switch when released action. i.e as long as the button is pressed the camera i control moves left and as soon as I release it it shud stop.
    Attachments:
    CamInte.vi ‏108 KB
    Left.vi ‏190 KB
    Right.vi ‏190 KB

    You need to decide whether you want things controlled by events, or by loop polling.
    Some things to consider:
    Inside each event you have a loop where you read the booleans the events react to. That means the events will be fired over and over again inside the loop, and you'll have a stack of old events to be fired when the while loop has exited...events you don't really want to do anything about (use events for all the button clicks, or loops - not a mix).
    Events are still flow controlled so when the left event fires and it enters the while loop it won't handle any other events until that while loop has finished.
    When an event fires the button value if read at the same time is not the value the event fired on. So when you have an event that fires when
    you press the button, if you wire the button value to something inside that even it won't be true, it will be false. Use the new value output of the event case to read the value you really want.
    MTO

  • Problem with getAttribute() for Booleans

    Hi
    We have an Application which has undergone all the migration path from JDeveloper 9i beta up to JDeveloper 9.0.5.2 (in several steps certainly :-) ) . Now we try do the next step: we want to upgrade from 9.0.5.2 to 10.1.3.
    But there is a problem with Boolean attributes:
    Since there were some problems with Booleans in elder versions of JDeveloper all our Booleans are stored in Attributes of type VARCHAR2(1) ("1" is TRUE, "0" is FALSE). This worked well since 9.0.5.2. But now in JDeveloper 10.1.3 all Boolean Attributes return FALSE, no matter of the content of the database. Since we do not want to convert our data in the database I am now looking for a way, how I can enable this Application to correctly read Booleans from VARCHAR2(1) .
    I've already found some classes like "TypeFactory" and "TypeMapEntries", and I've found the Property "jbo.TypeMapEntries". But I've found no clue, how to use them for my problem.
    Can anyone give me a hint?
    Thanks in advance
    Frank Brandstetter

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • Cannot create a VI equivalent of a boolean front panel indicator/​switch directly connected (subscribi​ng) to a datasocket

    I am attempting to create a boolean output from a simple boolean datasocket source the VI's is attempting to subscribe too. But for some reason it does not seem to be able to determine the boolean value from the data received. This VI was designed from the standard example DS Reader with Attributes.vi. Although I have tried many other approaches and can't get it to work. I'm not sure if i'm handling the datatype correctly. I'm pretty new to Labview too!
    Attachments:
    DS_Boolean_Reader.vi ‏37 KB

    I finally worked it out myself! Silly me...I just had to put the indicator inside the loop so it was constantly updated I guess! The learning curve can be steep for this no structured text language. I'm still not convinced it is faster than coding the old way. :-)
    Attachments:
    DS_Boolean_Reader.vi ‏37 KB

  • I created boolean references in my main vi block diagram and copied them to my sub vi front panel. when wire my reference in my main vi to one the input node of the sub vi the wire is broken. the error says its a class conflict why?

    i created boolean references in my main vi block diagram and copied them to my sub vi front panel. when wire my reference in my main vi to one the input node of the sub vi the wire is broken. the error says its a class conflict why?

    Expanding and clarifying what BJD said;
    After you create the temporary sub-VI that BJD mentioned, open its front panel and copy the reference control that LV created when it created the sub-VI.
    This reference control will be correct class etc that you need. Use the control to replace the original control that you were attempting to wire up.
    The technique of "create sub-VI...copy" always works for me.
    There is one more thing that you should watch out for.
    The mechanical action of the boolean can not be set for latch action when attempting to read the value using a value property node.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Creating a user prompt when a boolean control is first lached but not contiuousl​y showing while it is lached.

    Greetings,
    I need a boolean control that will write measured data to a text file while it is lached and do nothing while it is unlached (which is simple).  However, I also need it to display a dialog box when it is first lached to prompt the user to either append to an existing file or create a new file.  It should not contiously prompt the user to select new or append while it is lached.  It should only reprompt if the boolean has been unlached and relached.
    Any ideas?  I have tried several different approaches but everything that I have done has either not worked at all or contiuously prompts while lached.
    I know it will involve a shift register and at least one boolean comparison but I cannot figure out the arrangement.
    Thanks in advance.
    Solved!
    Go to Solution.

    Hi BB,
    looked at the Pt-by-Pt functions. There you will find a ready-to-use VI to detect edges of a boolean signal!
    Or use that boolean math: RisingEdge = signal[n] AND NOT(signal[n-1]). (Here you need the already mentioned boolean function with a shift register...)
    All you need is opening the dialog for rising edges of the boolean signal...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Boolean button changes color briefly when pressed

    Hi, I am using Boolean button as a toggle, so I only want text changes when it is pressed with no changes to button appearance.
    I am able to change the color for On in properties to match the Off color (I am using the Silver palette so normally On is yellow), however when the boolean button is changes to On, there's a brief changes of color still. Is there any way I can get rid of it? 
    In fact some of my buttons blink black while others blink yellow. I have no idea where that is set.
    Thak you very much.
    Solved!
    Go to Solution.

    There are 4 colors for booleans ON and OFF plus going from ON to OFF and going from OFF to ON
    You only see the transition color when you have the Mech latching set to "latch when released"
    Set it to "Latch when pressed" and you will not see the transition colors
    You can set all 4 colors by using the Colors [4] Property
    Colors [4] Property
    Short Name: Colors[4]
    Requires: Base Development System
    Class: Boolean Properties
    To Use: Create a property.
    Array of up to 4 (Foreground Color, Background Color) pairs, where Foreground Color is the foreground color of the Boolean control and Background Color is the background color of the Boolean control. Color pairs include False, True, True to False, and False to True.
    You can set the color of the front panel object by wiring a hexadecimal number with the form RRGGBB or by wiring the color box constant to the property.
    This property is similar to the Colors option on the Appearance page of the Boolean Properties dialog box.
    If the Boolean control has four (Foreground Color, Background Color) pairs for the four states, this property always returns an array of four (Foreground Color, Background Color) pairs when reading. When writing, you can pass in an array of length 1, 2 or 4. If you pass in only one element, this property uses that element value for all four states. If you pass in two elements, this property uses the first element value for the False and True to False states. Similarly, this property uses the second element for the True and False to True states.
    If the Boolean control has only one (Foreground Color, Background Color) pair for all four states, this property returns an array of one (Foreground Color, Background Color) pair when reading, and uses the first array element when writing. You cannot change a Boolean control with one (Foreground Color, Background Color) pair to a Boolean control with multiple (Foreground Color, Background Color) pairs.
    This property only uses the True to False and False to True states when you set the Boolean control to latch or switch when released. You can get and set these (Foreground Color, Background Color) pairs even if you do not have the control set to latch or switch when released; they just are not used.
    Because this property does not change the data of the Boolean control, you can set it at any time.
    You can use the this property for Boolean controls on the Classic, Express, Modern, and Silver palettes. You cannot use this property for Boolean controls on the System palette.
    Omar

Maybe you are looking for