Boolean type

I'm trying to create a new table as follows:
create table enderecos
(trabalhador number primary key,
Rua varchar2(50),
numero number,
Bairro varchar2(50),
Cidade varchar2(40),
uf varchar2(2),
casa BOOLEAN,
num_apt number);
And when I try to run this statement I get the error: Invalid datatype.
My question is, I have never done this before in pl/sql, but isn't it possible to define boolean variables in pl/sql? If it is, what might be happening?

I use the following boolean utility functions quite a bit.
   *  FUNCTION to_boolean
  FUNCTION to_boolean (p_char IN VARCHAR2)
    RETURN BOOLEAN
  IS
  BEGIN
    IF UPPER (p_char) NOT IN ('Y', 'N', 'T', 'F', '0', '1')
    THEN
      raise_application_error
                       (-20000,
                        'Only Y/N or T/F or 0/1 may be converted to Boolean.');
    END IF;
    RETURN UPPER (p_char) IN ('Y', 'T', '1');
  END to_boolean;
   *  FUNCTION to_01
  FUNCTION to_01 (p_boolean IN BOOLEAN)
    RETURN NUMBER
  IS
  BEGIN
    IF p_boolean
    THEN
      RETURN 1;
    ELSIF NOT p_boolean
    THEN
      RETURN 0;
    ELSE
      RETURN NULL;
    END IF;
  END to_01;
   *  FUNCTION to_01
  FUNCTION to_01 (p_char IN VARCHAR2)
    RETURN NUMBER
  IS
  BEGIN
    RETURN to_01 (to_boolean (p_char));
  END to_01;
   *  FUNCTION to_yn
  FUNCTION to_yn (p_boolean IN BOOLEAN)
    RETURN VARCHAR2
  IS
  BEGIN
    IF p_boolean
    THEN
      RETURN 'Y';
    ELSIF NOT p_boolean
    THEN
      RETURN 'N';
    ELSE
      RETURN NULL;
    END IF;
  END to_yn;
   *  FUNCTION to_yn
  FUNCTION to_yn (p_char IN VARCHAR2)
    RETURN VARCHAR2
  IS
  BEGIN
    RETURN to_yn (to_boolean (p_char));
  END to_yn;
   *  FUNCTION to_tf
  FUNCTION to_tf (p_boolean IN BOOLEAN)
    RETURN VARCHAR2
  IS
  BEGIN
    IF p_boolean
    THEN
      RETURN 'T';
    ELSIF NOT p_boolean
    THEN
      RETURN 'F';
    ELSE
      RETURN NULL;
    END IF;
  END to_tf;
   *  FUNCTION to_tf
  FUNCTION to_tf (p_char IN VARCHAR2)
    RETURN VARCHAR2
  IS
  BEGIN
    RETURN to_tf (to_boolean (p_char));
  END to_tf;

Similar Messages

  • How to map Boolean Types in Import Manager

    Hi,
    I have a issue in Import Manager for mapping Boolean Types.
    I have a field which has a single KEY and multilple values(for different languages).
    I want to map it to a field in a Tuple.
    I can map the Key to field name.
    But the values, I am not able to map. Could you help me here please.
    Thanks a lot in advance.
    Regards,
    Rashmi

    Hi Anton
    Format your GM Time source as YYYY:MM:DD:HH:NN:SS:TTT (e.g. 2010:02:19:14:34:28:000). Deviations from this format seem to confuse the IM.
    HTH,
    Mark

  • Problem with boolean type in Informix via ODBC

    Hello,
    I'm connecting to an Informix database from an Oracle database via the ODBC Gateway. The connection works fine.
    However, when I select a boolean type column from a table in the Informix database, nothing is returned and I get the following error:
    SQL> select "stat" from bt@informix;
    ERROR:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Informix][Informix ODBC Driver]Restricted data type attribute violation.
    {07006,NativeErr = -11013}
    ORA-02063: preceding 2 lines from INFORMIX
    no rows selected
    Selecting a boolean type column with isql works fine. Other column types work from Oracle.
    Can anyone help me resolve this issue? Please find configuration details and traces below.
    Software stack:
    Informix Database: Enterprise Edition 12.10 for Linux x86_64
    Informix ODBC driver: Informix Client SDK Developer Edition 4.10 for Linux 64-bit
    Oracle Database: Enterprise Edition 11.2.0.1.0 64-bit (Oracle Linux 6.6 64-bit)
    UnixODBC: 2.3.2 x86_64
    odbcinst.ini:
    [Informix]
    Driver=/opt/IBM/informix/lib/cli/libifcli.so
    Setup=/opt/IBM/informix/lib/cli/libifcli.so
    APILevel=1
    ConnectFunctions=YYY
    DriverODBCVer=03.51
    FileUsage=0
    SQLLevel=1
    smProcessPerConnect=Y
    [ODBC]
    TraceFile=/tmp/odbc.log
    Trace = Yes
    odbc.ini:
    [ol_informix1210]
    Driver=Informix
    Description=Test connection
    Database=sysutils
    LogonID=informix
    pwd=informix
    Servername=ol_informix1210
    CursorBehavior=0
    DB_LOCALE=en_us.8859-1
    TRANSLATIONDLL=/opt/IBM/informix/lib/esql/igo4a304.so
    [ODBC]
    UNICODE=UCS-2
    ; Trace file Section
    Trace=1
    TraceFile=/tmp/odbctrace.out
    InstallDir=/opt/IBM/informix
    TRACEDLL=idmrs09a.so
    Oracle Gateway init.ora:
    HS_FDS_CONNECT_INFO=ol_informix1210
    HS_FDS_SHAREABLE_NAME=/usr/local/lib/libodbc.so
    HS_FDS_TRACE_LEVEL=debug
    HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
    Oracle Gateway trace:
    Entered hgoftch, cursor id 1 at 2015/04/14-12:22:03
    hgoftch, line 130: Printing hoada @ 0x2007fe0
    MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
    hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
    DTY     NULL-OK  LEN  MAXBUFLEN   PR/SC  CST IND MOD NAME
    -7 BIT Y          1          1   0/  0    0   0  20 stat
    Performing delayed open.
    SQLBindCol: column 1, cdatatype: -28, bflsz: 1
    Entered hgopoer at 2015/04/14-12:22:03
    hgopoer, line 233: got native error -11013 and sqlstate 07006; message follows...
    [Informix][Informix ODBC Driver]Restricted data type attribute violation. {07006,NativeErr = -11013}
    Exiting hgopoer, rc=0 at 2015/04/14-12:22:03
    hgoftch, line 730: calling SQLFetch got sqlstate 07006
    0 rows fetched
    Exiting hgoftch, rc=28500 at 2015/04/14-12:22:03 with error ptr FILE:hgoftch.c LINE:730 FUNCTION:hgoftch() ID:Fetch resultset data
    ODBC trace:
    [ODBC][11041][1429005970.973443][SQLPrepare.c][196]
                    Entry:
                            Statement = 0x276ecb0
                            SQL = [SELECT A1. stat  FROM  BT  A1][length = 29]
    [ODBC][11041][1429005970.973914][SQLPrepare.c][371]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.973940][SQLNumResultCols.c][156]
                    Entry:
                            Statement = 0x276ecb0
                            Column Count = 0x26f5868
    [ODBC][11041][1429005970.973970][SQLNumResultCols.c][248]
                    Exit:[SQL_SUCCESS]
                            Count = 0x26f5868 -> 1
    [ODBC][11041][1429005970.974097][SQLDescribeCol.c][247]
                    Entry:
                            Statement = 0x276ecb0
                            Column Number = 1
                            Column Name = 0x7fffc3ff2d90
                            Buffer Length = 31
                            Name Length = 0x7fffc3ff2ed4
                            Data Type = 0x7fffc3ff2ed8
                            Column Size = 0x7fffc3ff2e70
                            Decimal Digits = 0x7fffc3ff2edc
                            Nullable = 0x7fffc3ff2ee0
    [ODBC][11041][1429005970.974140][SQLDescribeCol.c][501]
                   Exit:[SQL_SUCCESS]               
                            Column Name = [stat]               
                            Data Type = 0x7fffc3ff2ed8 -> -7               
                            Column Size = 0x7fffc3ff2e70 -> 1               
                            Decimal Digits = 0x7fffc3ff2edc -> 0               
                            Nullable = 0x7fffc3ff2ee0 -> 1
    [ODBC][11041][1429005970.974192][SQLSetStmtAttr.c][265]
                    Entry:
                            Statement = 0x276ecb0
                            Attribute = SQL_ATTR_ROW_ARRAY_SIZE
                            Value = 0x64
                            StrLen = 0
    [ODBC][11041][1429005970.974218][SQLSetStmtAttr.c][925]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.974230][SQLSetStmtAttr.c][265]
                    Entry:
                            Statement = 0x276ecb0
                            Attribute = SQL_ATTR_ROW_BIND_TYPE
                            Value = (nil)
                            StrLen = -5
    [ODBC][11041][1429005970.974249][SQLSetStmtAttr.c][925]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.974837][SQLExecute.c][187]
                    Entry:
                            Statement = 0x276ecb0
    [ODBC][11041][1429005970.975231][SQLExecute.c][348]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.975255][SQLSetStmtAttr.c][265]
                    Entry:
                            Statement = 0x276ecb0
                            Attribute = SQL_ATTR_ROW_STATUS_PTR
                            Value = 0x27f5b78
                            StrLen = -4
    [ODBC][11041][1429005970.975280][SQLSetStmtAttr.c][925]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.975291][SQLSetStmtAttr.c][265]
                    Entry:
                            Statement = 0x276ecb0
                            Attribute = SQL_ATTR_ROWS_FETCHED_PTR
                            Value = 0x26f5850
                            StrLen = -4
    [ODBC][11041][1429005970.975311][SQLSetStmtAttr.c][925]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.975326][SQLBindCol.c][236]
                    Entry:
                            Statement = 0x276ecb0
                            Column Number = 1
                            Target Type = -28 SQL_C_UTINYINT
                            Target Value = 0x27f5af8
                            Buffer Length = 1
                            StrLen Or Ind = 0x27f5eb8
    [ODBC][11041][1429005970.975349][SQLBindCol.c][341]
                    Exit:[SQL_SUCCESS]
    [ODBC][11041][1429005970.975367][SQLFetch.c][162]
                    Entry:
                            Statement = 0x276ecb0
    [ODBC][11041][1429005970.975455][SQLFetch.c][348]
                    Exit:[SQL_ERROR]
                    DIAG [07006] [Informix][Informix ODBC Driver]Restricted data type attribute violation.
    [ODBC][11041][1429005970.975574][SQLGetDiagRec.c][758]
                   Entry:
                            Statement = 0x276ecb0
                            Rec Number = 1
                            SQLState = 0x7fffc3ff2e20
                            Native = 0x7fffc3ff2c14
                            Message Text = 0x7fffc3ff2c20
                            Buffer Length = 510
                            Text Len Ptr = 0x7fffc3ff2e70
    [ODBC][11041][1429005970.975615][SQLGetDiagRec.c][795]
                    Exit:[SQL_SUCCESS]
                            SQLState = 07006
                            Native = 0x7fffc3ff2c14 -> -11013
                            Message Text = [[Informix][Informix ODBC Driver]Restricted data type attribute violation.]
    [ODBC][11041][1429005970.975642][SQLGetDiagRec.c][758]
                    Entry:
                            Statement = 0x276ecb0
                            Rec Number = 2
                            SQLState = 0x7fffc3ff2e20
                            Native = 0x7fffc3ff2c14
                            Message Text = 0x7fffc3ff2c20
                         Message Text = 0x7fffc3ff2c20
                            Buffer Length = 510
                            Text Len Ptr = 0x7fffc3ff2e70
    [ODBC][11041][1429005970.975667][SQLGetDiagRec.c][795]
                    Exit:[SQL_NO_DATA]

    Here are my findings after consulting the unixODBC mailing list and the IBM documentation.
    There are several levels of data types at play here: native Informix SQL types, Informix ODBC driver SQL types and Informix ODBC driver C types (as well as standard C types).
    According to the Informix documentation (http://www-01.ibm.com/support/knowledgecenter/SSGU8G_11.70.0/com.ibm.odbc.doc/ids_odbc_108.htm), the ODBC driver SQL type for the native boolean type is SQL_BIT.
    The traces show that the ODBC SQL type is SQL_BIT (type code -7) and that this should be converted into the SQL_C_UTINYINT ODBC C type (type code -28).
    Oracle ODBC Gateway trace:
    DTY    NULL-OK  LEN  MAXBUFLEN  PR/SC  CST IND MOD NAME
    -7 BIT Y          1          1  0/  0    0  0  20 stat
    Performing delayed open.
    SQLBindCol: column 1, cdatatype: -28, bflsz: 1
    unixODBC trace:
    ODBC][11041][1429005970.975326][SQLBindCol.c][236]
                    Entry:
                            Statement = 0x276ecb0
                            Column Number = 1
                           Target Type = -28 SQL_C_UTINYINT
                            Target Value = 0x27f5af8
                            Buffer Length = 1
                            StrLen Or Ind = 0x27f5eb8
    [ODBC][11041][1429005970.975349][SQLBindCol.c][341]
    Oracle tries to bind the SQL_BIT type column to a buffer of SQL_C_UTINYINT type, which requires a conversion from SQL_BIT to SQL_C_UTINYINT  that is apparently not supported by the Informix ODBC Driver.
    According to the documentation (http://www-01.ibm.com/support/knowledgecenter/SSGU8G_11.70.0/com.ibm.odbc.doc/ids_odbc_108.htm) the Informix ODBC driver can only convert the SQL_BIT ODBC SQL type into SQL_C_BINARY, SQL_C_BIT and SQL_C_CHAR ODBC C types. (The ODBC C types are in turn converted into standard C types, for example the SQL_C_BIT type is converted into UCHAR which is a typedef for the standard C type unsigned char.)
    A possible workaround could be to tell Informix to present boolean as a different ODBC SQL type, for example SQL_CHAR (as it would be possible with PostgreSQL by setting BoolAsCharater=1 in odbc.ini), but Informix only seems to supports the SQL_BIT ODBC SQL type.
    A cumbersome workaround is to use the Gateway's pass-through feature that allows a query to be passed to Informix as is, which in turn allows us to cast the boolean field into a character field:
    SQL> set serveroutput on
    SQL> r
      1  DECLARE
      2    val  VARCHAR2(1);
      3    c    INTEGER;
      4    nr  INTEGER;
      5  BEGIN
      6    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@informix;
      7    DBMS_HS_PASSTHROUGH.PARSE@informix(c,'select cast (stat as character) from bt');
      8    LOOP
      9    nr := DBMS_HS_PASSTHROUGH.FETCH_ROW@informix(c);
    10    EXIT WHEN nr = 0;
    11    DBMS_HS_PASSTHROUGH.GET_VALUE@informix(c, 1, val);
    12    DBMS_OUTPUT.PUT_LINE(val);
    13    END LOOP;
    14    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@informix(c);
    15  END;
    16*
    t
    f
    PL/SQL procedure successfully completed
    Easier solutions are still welcome.

  • "An expression of non-boolean type specified in a context where a condition

    I have below query and its respective result set "0 and NoofRows" in Execute SQL task
    select count(*) from TEMP_InterfaceSAP_LoadFile
    where (timeid = '20110100' and  ([ENTITY_AFF] in (N'6050')))
    When I run the task individually, there is no issue at all, but when I tried run it as whole, I'm getting below error.
    "[Execute SQL Task] Error: Executing the query "select count(*) from TEMP_PM_InterfaceSAP_LoadFile..." failed with the following error: "An expression of non-boolean type specified in a context where a condition is expected, near ')'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."

    I have below query and its respective result set "0 and NoofRows" in Execute SQL task
    select count(*) from TEMP_InterfaceSAP_LoadFile
    where (timeid = '20110100' and (ENTITY_AFF in (N'6050')))
    When I run the task individually, there is no issue at all, but when I tried run it as whole, I'm getting below error.
    "Execute SQL Task Error: Executing the query "select count(*) from TEMP_PM_InterfaceSAP_LoadFile..." failed with the following error: "An expression of non-boolean type specified in a context where a condition is expected, near ')'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."
    ======================================================================
    Hi Prabhu0505,
    You may enclose the string with ' ' in SQL task if you use SQL command, then you need to adjust your delimeter to avoid wrong interepretation. I cannot say how you can fix the problem, but I remember there was more ' such as '''6050''' and so on, please find out correct SQL expression in an eclosed string.
    This is one of thing I remember, I used ADO connection in SQL script task in SSIS and there were lots of SQL in command, the ' quatation is tricky one.
    Regards,
    YH Seo

  • An expression of non-boolean type specified in a context where a condition is expected, near ','

    I am getting the error message, "An expression of non-boolean type specified in a context where a condition is expected, near ',' " when running an ssrs 2008 r2 report.
    The sql embedded in the dataset is:
    IF @reportID <> 0
    BEGIN
      SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
      UNION
      SELECT 'Students report 2', 2 
      UNION
      SELECT 'Students report 3', 3
      UNION
      SELECT 'Students report 4', 4
      UNION
      SELECT 'Students report 5', 5
      ORDER BY selectRptName
    END
    The sql runs fine in managment studio when I declare @reportID.
    The sql runs fine with I comment out  'IF @reportID <> 0'.
    The @reportID is a parmeter value that is passed to the applicable dataset.
    The @reportID can have more than one value.
    Thus can you show me sql and/or tell me what I need to do to solve the issue for me?

    Hi wendy,
    After testing the issue in my environment, I can reproduce it when I select more than one values in the @reportID parameter drop-down list. As per my understanding, it seems that you are trying to filter the dataset with the @reportID parameter. When it
    doesn’t contain value ‘0’, the dataset returns values. Otherwise, no value is returned in the dataset.
    If in this scenario, we can achieve this requirement with filters in the dataset. For more details, please refer to the following steps:
    Modify the dataset with the below query:
    SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
    UNION
    SELECT 'Students report 2', 2 
    UNION
    SELECT 'Students report 3', 3
    UNION
    SELECT 'Students report 4', 4 
    UNION
    SELECT 'Students report 5', 5
    ORDER BY selectRptName
    Click the Filters in the left pane of Dataset Properties dialog box.
    Add a filter as below:
    Expression: =INSTR(JOIN(Parameters!reportID.Value,","),"0")>0
    Type: Boolean
    Operator: =
    Value: false
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • An expression of non boolean type specified in context near id

    Hi
    Sorry for duplicate posting. I am desperately looking to solve the issue for  display image tif format using datawindow inkpict. I am little bit going progress .
    My Sqlserver  table  <mpdoc>
    id <int>, empdoc  <image>
    In datawindow object I have given id as id and large binary column as empdoc. But after when I retrieve the datawindow it is showing the error
    'an expression of non Boolean type specified in context near id' how can I fix this error.Please help
    dw_1.settransobject(sqlca)
    dw_1.retrieve()
    I am very desperate at the moment with the powerbuilder to display tif image   and also I can only get the help from this site.
    if it is not working in PB, I have to use C#.
    With Many Thanks
    Pol

    Hi wendy,
    After testing the issue in my environment, I can reproduce it when I select more than one values in the @reportID parameter drop-down list. As per my understanding, it seems that you are trying to filter the dataset with the @reportID parameter. When it
    doesn’t contain value ‘0’, the dataset returns values. Otherwise, no value is returned in the dataset.
    If in this scenario, we can achieve this requirement with filters in the dataset. For more details, please refer to the following steps:
    Modify the dataset with the below query:
    SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
    UNION
    SELECT 'Students report 2', 2 
    UNION
    SELECT 'Students report 3', 3
    UNION
    SELECT 'Students report 4', 4 
    UNION
    SELECT 'Students report 5', 5
    ORDER BY selectRptName
    Click the Filters in the left pane of Dataset Properties dialog box.
    Add a filter as below:
    Expression: =INSTR(JOIN(Parameters!reportID.Value,","),"0")>0
    Type: Boolean
    Operator: =
    Value: false
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Hi i want to use boolean type in a procedure as out parameter !!

    Hi
    I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
    please HELP !!

    I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
    Sounds like basic PL/SQL stuff.
    What problem are you experiencing?
    Are you looking for something like this?
    create or replace procedure check_emp (p_empno in number, p_result out boolean) is
      dummy  pls_integer;
    begin
      select 1
      into dummy
      from scott.emp
      where empno = p_empno;
      p_result := true;
    exception
      when no_data_found then
        p_result := false;
    end;
    SQL> declare
      2    emp_exists  boolean;
      3  begin
      4    check_emp(7839, emp_exists);
      5    if emp_exists then
      6      dbms_output.put_line('Employee exists');
      7    else
      8      dbms_output.put_line('Employee does not exist');
      9    end if;
    10  end;
    11  /
    Employee exists
    PL/SQL procedure successfully completed

  • What is the default value of boolean type transient attribute in VO?

    Hi All,.
    jdev version-11.1.2.1.0
    i have created one vo based on eo where i add one boolean type transient attribute Marked(uihint checkbox).
    now i have apply view criteria on this vo.
    like---
         ViewObject vo=getView(iterator);
         vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
         ViewCriteria vc=vo.createViewCriteria();
         ViewCriteriaRow vcr=vc.createViewCriteriaRow();
         vcr.setAttribute("Marked", "true");//Setting attribute on view criteria.
           vcr.setConjunction(ViewCriteriaRow.VCROW_CONJ_AND);
           vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
         vo.applyViewCriteria(vc);//Apply view criteria on vo.
         vo.executeQuery();
         vc.add(vcr);
       vo.executeQuery();this code running fine and that is selected only those row which i have cheked.
    but now i want to apply view criteria that select select those rows that are not checked.
    like-
    vcr.setAttribute("Marked", "false");but it is not return any row.
    if select checked any row and then uncheked that row so marked attribute for this row set false. but rows that are unchecked by default not return.
    so my question is that what is default value of Marked attribute when user not take any action i will try
    vcr.setAttribute("Marked","null");
    but not working.

    i have tried this but this is not working.
    follwing code working for Null case not for False
    vcr.setAttribute("Marked","is null"); this code display all rows who has null but when i checked any row and then unchecked so that row get value "false" also not display.

  • Setting boolean type in registerOutParameter of a callablestatement.

    Hi all..,
    Plz..define how to set the registereOutParameter for boolean type....
    My StoredProcedure is returning OUT the following parameters :
    NUMBER,VARCHAR,BOOLEAN & CURSOR.
    So, for the above OUT params i setting registerOutParameter as follow :-
    CallableStatement cal_stmt;
    ......and after gettign the connection and calling the procedure using
    cal_stmt...
    NUMBER,VARCHAR,BOOLEAN & CURSOR.
    cal_stmt.registerOutParameter(1,OracleTypes.NUMBER);//for number
    cal_stmt.registerOutParameter(2,OracleTypes.VARCHAR);//for varchar
    cal_stmt.registerOutParameter(3, ?(How to set for boolean)...)
    cal_stmt.registerOutParameter(4,OracleTypes.CURSOR);//for cursor.
    Plz..define how to set the registereOutParameter for boolean type....
    very very..urgent...

    Andrew,
    I'm not clear on what you mean when you ask "try to load it ... doesn't
    resove the classes to the subclass."
    Can you post a code snip here and what you would expect to see?
    Roger
    "Andrew" <[email protected]> wrote in message news:3f4494e2$[email protected]..
    >
    I'm trying to create a schema with an abstract class and two subclasses.(see
    below)
    The xml saves fine, but when I try to load it the parser doesn't resolvethe classes
    to the subclass. Is there a way of setting the xsi:type as an attribute sothat
    when the file is loaded the classes are resolved to their correct type. Isthere
    a better way of doing this?
    Thanks in advance,
    Andrew
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.books.org"
    xmlns="http://www.books.org"
    elementFormDefault="unqualified">
    <xsd:complexType name="PublicationType" abstract="true">
    <xsd:sequence>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string"maxOccurs="unbounded"/>
    <xsd:element name="Date" type="xsd:year"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="MagazineType">
    <xsd:complexContent>
    <xsd:extension base="PublicationType">
    <xsd:sequence>
    <xsd:element name="A" type="xsd:string"/>
    <xsd:element name="B" type="xsd:string"/>
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="BookStore">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Publication" maxOccurs="unbounded"type="PublicationType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • Insert new boolean type column in jtable

    how can i insert new boolean type column or columns in jtable while my program is runing?
    thanks for your answers...

    Save your dukes and see the code I posted at http://forum.java.sun.com/thread.jsp?forum=17&thread=548443&tstart=0&trange=15
    You need the underlying 2d data array be dynamic. I chose Vectors.

  • I have boolean type of value in the database, how to get it as true or fals

    Hi friends,
    I have login page in that only admin can access next page after login. First my problem is only admin must be logged in, so i have used one column named admin, which is nothing but it is BIT type of column. So if it is true then it must allow the admin, otherwise if it is false then it must not redirect to that page. So how can i get that column value whether it is true or false. I have used this method to get the value.
    boolean ok = getBoolean("Admin");// This isnothing but getting column Admin which is of type boolean.
    if(ok==true){
    return "adminPage";
    }Please help me out from this problem. Please give me a suggestion.
    Thanking You in Advance.

    Hi There,
    Normally a database stores the boolean value as a 0 or a 1. you may have to check for that or convert the 0,1 to true or false and then check for it.
    Hope it helps
    K

  • PreparedStatement for Boolean type

    hello guys,
    I have a form whose values I need to insert into a MS Access database. I am doing this with the use of <jsp:usebean> tag, I have also defined a bean and compiled it into a class. The problem I am facing is that in my form I have a display check box, if checked its value will be 1.
    So if suppose, the user will check this box, in the Access Table, the data type is Yes/No. It should accordingly check.
    I am making use of the preparedstatement, and theres seems to be no SetBoolean method, as there are for setInt and setString.
    How do I go about it ? I accepted the value as a string decalred a boolean variable and then again using the setString method tried to insert into the db but it doesnt work.
    Please help

    What version of Java are you using?
    setBoolean

  • Identifyin​g Boolean Type

    I am working on a generic subvi to save and restore the main VI control settings when the program starts and ends.  I can't seem to find a way to identify the particular type of control.  For example I can generate a list of front panel booleans but I can't tell if they are buttons, switches, rockers, etc.  There is no point in saving a STOP button setting but I would like to save check box settings.  I suppose some sort of naming or description convention would work but I am hoping for a more elegant and foolproof solution then that.
    Attached is the block diagram I have been working on which builds lists of ClassID's, Class Names and Labels.
    Any suggestions on how to identify the particular type of control within a class?
    Attachments:
    ConfigSettings_BD.png ‏12 KB

    drog wrote:
    Thank you for your assistance.  From the responses received I gather that my suspicions are correct and that there is no way to programatically determine the specific type of control (switch, button, check-box, etc.)
    Oh, I wouldn't say that. There are ways, if you don't mind being sneaky.
    If you're not using it, you could set the control's caption to indicate the switch type, and then read it using a property node.
    If you're not using it, you could set the control's description to indicate the switch type, and then read it using a property node.
    If you're not using the Boolean text, set one of the to indicate the switch type, and then read it using a property node.
    Use the Get Image method to get an image of the control and then do an image comparison. Yeah, I know. A bit out there. 

  • Jaxb Integer and Boolean types not initialized

    I just converted from using JWSDP 1.6 to 2.0. I noticed that when I used Jaxb to generate my beans the default types for int and boolean are now the wrapper classes Integer and Boolean. With version 1.6 I did not initialize my ints or booleans. Now with version 2.0 I find I have null issues because the fields that have the types Boolean and Integer are not initialized.
    I would like to change how Jaxb generates the beans so that one of the two options listed below will occur:
    1) The field types that need integers and booleans would be primitive types instead of the wrapper classes.
    or
    2) I would like to change the declaration from:
    protected Boolean someboolean;
    protected Integer someinteger;
    to:
    protected Boolean someboolean=new Boolean(true);
    protected Integer someinteger = new Integer(0);
    How can I do this?
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    I found the answer: The problem was that I had used the attribute minOccurs="0". This caused the code generator to make the types either Boolean or Integer. I removed the attribute minOccurs="0" then the system generated the fields with the primatives int and boolean. Now my fields are initialized.

  • Boolean types with entity framework code first and oracle provider

    Working in a application that has to work in oracle and sqlServer. In SqlServer we have used "Bit" to store booleans and in oracle number(1).
    Have check other threads in this forum, but didnt find any that fix my problem, sorry if this may have been discused before.
    We have created a code first model were we find few bool properties mapped to database fields.
    for example:
    public partial class ZPruebaBooleano
    public int Numero { get; set; }
    public bool Booleano { get; set; }
    Mapped as:
    this.ToTable("ZPRUEBABOOLEANO", schema);
    this.HasKey<int>(t => t.Numero);
    this.Property(t => t.Numero).HasColumnName("NUMERO");
    this.Property(t => t.Booleano).HasColumnName("BOOLEANO");
    Also, sw added to the application configuration file (for simplicity we have test it without the use of any additional dll):
    <oracle.dataaccess.client>
    <settings>
    <add name="bool" value="edmmapping number(1,0)" />
    <add name="byte" value="edmmapping number(3,0)" />
    <add name="int16" value="edmmapping number(4,0)" />
    <add name="int32" value="edmmapping number(9,0)" />
    <add name="int64" value="edmmapping number(18,0)" />
    </settings>
    </oracle.dataaccess.client>
    I am confident that the provider factory read it when creating the model, because it provokes an exception if i add an invalid entry in any of the type names mapped in the file.
    As i have find in other forums, this should work. But now i am not sure if should work always, including code first.
    I have this exception when i excecute the code (translated from spanish, sorry for any mistake):
    Type 'Edm.Boolean[Nullable=False,DefaultValue=]' from 'Booleano' to type'PruebaBooleanos.ZPruebaBooleano' is not compatyble with 'OracleEFProvider.number[Nullable=False,DefaultValue=,Precision=38,Scale=0]'
    Its funy that says Precision=38. The database is Number(1), i am sure about that, in fact this is the script:
    CREATE TABLE ZPRUEBABOOLEANO
    NUMERO NUMBER(15),
    BOOLEANO NUMBER(1)
    Also, i find it interesting that i was having this mistake even when i was not informing the table i was maping, like if the oracle provider didnt even check if the column was number(anything). Right now is well maped, table and schema.
    I have test to create an integer property wrapped by the boolean one, as we can see in this code.
    namespace PruebaBooleanos
    public partial class ZPruebaBooleano
    public int Numero { get; set; }
    public bool Booleano
    get
    return iBooleano == 1 ? true : false;
    set
    iBooleano = value ? 1 : 0;
    public int iBooleano { get; set; }
    in this last case i ignored the boolean and mapped the integer.
    That worked ok in oracle. But added 2 problems:
    1. It fails in SqlServer, because in sql server is bit
    2. Cant query the entity model using the boolean property as it is not maped to Database.
    I could change the bit field in SqlServer to Number.
    But i would like to keep bit in sqlserver and number(1) in oracle.
    Anyone had a similar problem?
    I am open to any ideas, thanks !!!
    libo

    It's cool. :)
    Sure. I can upload an EDMX file that works against my database if you want to look at it. The relevant parts are probably much like you'd expect. I've removed some columns from this version to make it easier to read.
    From the SSDL:
            <EntityType Name="PARAMETER">
              <Key>
                <PropertyRef Name="PARAMETER_CD" />
              </Key>
              <Property Name="PARAMETER_CD" Type="number" Nullable="false" Precision="4" />
              <Property Name="PARAMETER_ACTIVE_INDR" Type="number" Nullable="false" Precision="1" />
            </EntityType>From the CSDL:
    <EntityType Name="PARAMETER">
              <Key>
                <PropertyRef Name="PARAMETER_CD" />
              </Key>
              <Property Type="Int16" Name="PARAMETER_CD" Nullable="false" />
              <Property Type="Boolean" Name="PARAMETER_ACTIVE_INDR" Nullable="false" />
            </EntityType>From the C-S mapping:
    <EntitySetMapping Name="PARAMETER">
                <EntityTypeMapping TypeName="Model.PARAMETER">
                  <MappingFragment StoreEntitySet="PARAMETER">
                    <ScalarProperty Name="PARAMETER_ACTIVE_INDR" ColumnName="PARAMETER_ACTIVE_INDR" />
                    <ScalarProperty Name="PARAMETER_CD" ColumnName="PARAMETER_CD" />
                  </MappingFragment>
                </EntityTypeMapping>
              </EntitySetMapping>Also worth noting that the EDMX mapper probably won't set the provider and token correctly:
    <Schema Namespace="Model.Store" Alias="Self" Provider="Oracle.DataAccess.Client" ProviderManifestToken="11.2" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">Full version is available at http://www.hiredgoons.ca/DataImport.edmx . This is an early development one so I make no apologies for not renaming columns to something readable. ;) It does work correctly as I've had it in testing (taking data from a 170MB excel file and putting it into Oracle using the model). It was created using DB First.
    When you have it load at runtime, you need the application configuration settings to map bool to number(1). If that's in app.config or web.config it'll pick it up. Probably worth noting that if you don't have the configuration setting and you load this, the model doesn't validate correctly. As soon as you try to create a DbContext from it, you get an immediate exception that number(1) doesn't map to boolean.
    Edited by: Tridus on Nov 21, 2012 3:37 PM

Maybe you are looking for

  • Creation of Material using BDC Session method & global class

    Hi Creation of Material using BDC Session method & global class by using oops. can anyone plz help me out

  • ESS WF WS04200009 Leave request with HTML (BP for SAP R/3 4.7))

    Hi there all, I hope somebody can help how to configure this scenario. I searched around on SDN and SAP Help but couldn't find a thing. I actually have 2 questions: 1. is there somebody who has some how-to guides for the ESS scenarios especially abou

  • Numbers in web gallery and resource image folders do not match

    When I create a web gallery in Bridge, the numbers in the resource image folders, (Large, medium, thumbnail) do not match the name and numbers in the gallery and are completely out of order. The numbers are long and random.  My client is trying to em

  • Airport Extreme Card

    I couldn't find an answer so here is my post. I bought an Airport Extreme card from a guy and can't get it to work in both an iMac G5 and an eMac G4. It doesn't show up in the System Profiler. The guy claims it only works with older Apple Powerbook I

  • HT5622 DEAD IPAD MINI! WHAT TO DO? :(

    Can somebody help me? my ipad mini is dead... all i know is i charged it... and when im about to use it, it was not even responding... all i can see is a black screen... and the temperature of my mini is not normal... it's quite hot!  anybody who has