String value is giving different values

Hi,
When I run the string equals it just works fine but if I give date by converting it to a char and give it in < or < it gives random answers.

Hi,
When I run the string equals it just works fine but if I give date by converting it to a char and give it in < or < it gives random answers.
Are you storing date as string (char field)? If yes, SQL would do string comparison rather than your expectation of date-based comparison when you use > or <
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle

Similar Messages

  • LISTCUBE is giving different values

    Hi ,
    I am having an 'X'  and 'Y' cubes which carries the same data both cube structure and restrictions are same.
    When i look into list cube one cube is giving is giving correct result and one is not giving correct.
    I found in LISTCUBE few kay figures are giving wrong result.
    Thanks,
    Guna

    hello,
    please check the definitions of the Keyfigures.check the aggreation option defined in them.they may vary.
    Also,  when u r running listcube for both ICs,see if the check boxes ticked in both the screens are the same.
    Also see if you are displaying the same set of chs and KFs in both the screens.
    Reagrds,
    Dhanya

  • Dbms_lob.getlength() returns different values

    Hi !
    I am not a developer.. So, possibly cannot answer developer specific question.
    We have two instances running on 10.2.0.4 but both giving different value for
    declare
         xml varchar2(32676) :=
    'SELECT XT_STRATEGY, ACCT_DESCRIPTION,sum(MON_PL) PL_MON ,sum(TUE_PL) PL_TUE,sum(WED_PL) PL_WED ,sum(THU_PL) PL_THU, sum(FRI_PL) PL_FRI, sum(WTD_PL) PL_WTDPL,sum(WTD_PREMIUM_PL) PL_WTDPRMPL, sum(MTD_PL) PL_MARKPL,sum(MTD_PREMIUM_PL) PL_MTDPRMPL,sum(YTD_PL) PL_YTDPL,sum(YTD_PREMIUM_PL) PL_YTDPRMPL,
                   DLC_REGION,DLC_ENTITY  FROM (SELECT xt_strategy, acct_description ,case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0 else MON_PL end as MON_PL, case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D''))) then 0 else tue_pl end as tue_pl,
    case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0 else WED_PL end as WED_PL, case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0 else THU_PL end as  THU_PL,
    case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0 else FRI_PL   end as  FRI_PL, case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0 else WTD_PL   end as  WTD_PL,
    case when  blankout_date  < to_char( to_date(    fv[EOD]        )+ (1 -to_char(to_date(to_date(    fv[EOD]        )),''D'')))  then 0  else WTD_PREMIUM_PL   end as  WTD_PREMIUM_PL,
    case when  blankout_date  < (select actual_date from tbl_date where date_type = ''PLMonthStart'' and to_char(actual_date, ''MMYYYY'') = to_char(to_date(    fv[EOD]        ),''MMYYYY'')) then 0 else mtd_pl end as mtd_pl,
    case when  blankout_date  < (select actual_date from tbl_date where date_type = ''PLMonthStart'' and to_char(actual_date, ''MMYYYY'') = to_char(to_date(    fv[EOD]        ),''MMYYYY'')) then 0 else MTD_PREMIUM_PL end as MTD_PREMIUM_PL,
    case when  blankout_date  < (select to_date(''01-JAN-''|| to_char(to_date((fv[EOD]),''DD-MON-YYYY''),''YYYY''),''DD-MON-YYYY'') from tbl_business_date) then 0 else ytd_PL end as ytd_PL,
    case when  blankout_date  < (select to_date(''01-JAN-''|| to_char(to_date((fv[EOD]),''DD-MON-YYYY''),''YYYY''),''DD-MON-YYYY'') from tbl_business_date) then 0 else ytd_premium_PL end as ytd_premium_PL,
    IN_STRIKECURR, IN_QUOTEDCUR, case dlc_region when ''LON'' then ''LN'' when ''NYC'' then ''NY'' when ''TOK'' then ''TK'' else dlc_region
    end as DLC_REGION, DLC_ENTITY,DTL_REFERENCE,TRADE_STATE,blankout_date
    FROM (select a.bo_book_id as xt_strategy, a.bo_book_id  as acct_description , b.mon_pl, b.tue_pl, b.wed_pl,b.thu_pl,b.fri_pl,b.wtd_pl, b.wtd_premium_pl , b.mtd_pl , b.mtd_premium_pl, b.ytd_pl, b.ytd_premium_pl,
               a.BASE_CCY as IN_STRIKECURR, A.QUOTED_CCY AS IN_QUOTEDCUR,  a.region_code as dlc_region, a.entity_acronym  as dlc_entity, TP.EBI_TRADE_ID AS DTL_REFERENCE, a.trade_state,
         case when a.trade_state in  (7,8,13) then a.amendment_date when a.maturity_date > nvl(a.premium_settlement_date, to_date(''01-JAN-1900'')) then
              Case when a.trade_state in  (4,5 ) then  trunc(a.updated_date) else a.maturity_date end else a.premium_settlement_date end as blankout_date  FROM      TBL_TRADE_HIST A
         join vw_feed_downstream_trade_id tp on a.trade_id = tp.trade_id and tp.mapping_source_name = ''ramfx''
       join tbl_pl b on a.trade_id = b.trade_id and a.version = b.trade_version      and b.pl_date = (select max(pl_date) from tbl_pl d where a.trade_id  = d.trade_id and pl_date <=     fv[EOD]        )
       join tbl_bo_book bk on a.bo_book_id = bk.bo_book_id  and bk.business_Area = ''OPTIONS''
       where b.pl_date <     fv[EOD] 
       AND      NOT EXISTS (SELECT 1 FROM TBL_EOD_TRADES D WHERE A.TRADE_ID = D.TRADE_ID AND  D.BUSINESS_DATE =     fv[EOD]        )
    UNION
        SELECT A.XT_STRATEGY,     A.ACCT_DESCRIPTION, C.MON_PL,C.TUE_PL, C.WED_PL,C.THU_PL, C.FRI_PL,C.WTD_PL,C.WTD_PREMIUM_PL,C.MTD_PL,C.MTD_PREMIUM_PL,C.YTD_PL,C.YTD_PREMIUM_PL,
             A.IN_STRIKECURR, A.IN_QUOTEDCUR,  A.DLC_REGION,A.DLC_ENTITY, A.DTL_REFERENCE , a.trade_state , case when a.trade_state in  (7,8,13) then  a.DLC_BUSDATEUPD when a.IN_EXPIRATION > nvl(a.XT_SETTLEDATE, to_date(''01-JAN-1900'')) then a.IN_EXPIRATION else a.XT_SETTLEDATE end as blankout_date
        FROM VW_EBI_FEED A , TBL_EOD_TRADES B , TBL_PL C
        WHERE A.TRADE_ID                    = B.TRADE_ID   AND      A.VERSION  = B.TRADE_VERSION   AND      A.TRADE_ID    = C.TRADE_ID
        AND      A.ACCT_RISKFEED             = ''D''    AND      A.DLC_DEALSTATE   in  (''LIVE'',''PENDING'',''CANCELLED'',''REVERSED'')    AND      A.VERSION                 = C.TRADE_VERSION
        AND      B.BUSINESS_DATE         =     to_date(    fv[EOD]          ,''DD-MON-YYYY'')    AND C.PL_DATE   =    to_date(    fv[EOD]          ,''DD-MON-YYYY'')
    UNION
        SELECT A.BO_BOOK_ID  AS XT_STRATEGY , A.BO_BOOK_ID  AS ACCT_DESCRIPTION,   a.MON_PL , a.TUE_PL , a.WED_PL, a.THU_PL , a.FRI_PL, a.WTD_PL ,a.WTD_PREMIUM_PL , a.mtd_pl,  a.MTD_PREMIUM_PL,a.ytd_PL ,  a.ytd_premium_PL,A.BASE_CCY AS IN_STRIKECURR,A.QUOTED_CCY AS IN_QUOTEDCUR,
                       A.REGION_CODE as dlc_region ,A.ENTITY_ACRONYM AS DLC_ENTITY, A.MAPPING_SOURCE_ID AS DTL_REFERENCE, 12 as trade_state , a.PL_DATE as blankout_date
                                        FROM TBL_PL_ARCH A , tbl_bo_book b  where a.bo_book_id = b.bo_book_id  and      b.business_area = ''OPTIONS''
    union
    select d.bo_book_id as xt_strategy, d.bo_book_id as acct_description, case  when to_char(b.pl_date,''D'') = 6 then (b.inception_pl + b.inception_premium_pl ) else  (b.mon_pl * -1) end as mon_pl ,
             case when to_char(b.pl_date,''D'') = 2 then  (b.inception_pl + b.inception_premium_pl )  when to_char(b.pl_date,''D'')  > 2 then  (b.tue_PL  * -1) else 0 end as tue_pl,  case when to_char(b.pl_date,''D'') = 3 then  (b.inception_pl + b.inception_premium_pl )  when to_char(b.pl_date,''D'') > 3 then  (b.wed_pl * -1) else 0 end as wed_pl ,
               case when to_char(b.pl_date,''D'') = 4 then  (b.inception_pl + b.inception_premium_pl)  when to_char(b.pl_date,''D'') > 4 then  (b.thu_pl * -1) else 0 end as thu_pl ,case when to_char(b.pl_date,''D'') = 5 then  (b.inception_pl + b.inception_premium_pl)  when to_char(b.pl_date,''D'') > 5 then  (b.fri_pl * -1) else 0 end as fri_pl ,
             (b.mon_pl + b.tue_pl + b.wed_pl  + b.thu_pl + b.fri_pl) * -1 + (b.inception_pl + b.inception_premium_pl)  as wtd_pl, case when b.wtd_premium_pl <> 0 then b.wtd_premium_pl *-1 + (b.inception_premium_pl) else b.wtd_premium_pl end as wtd_premium_pl  ,       case when b.mtd_pl <> 0 then  b.mtd_pl * -1 + (b.inception_pl) else b.mtd_pl end as mtd_pl ,
             case when b.mtd_premium_pl <> 0 then b.mtd_premium_pl * -1 +  (b.inception_premium_pl ) else b.mtd_premium_pl end as mtd_premium_pl,   case when b.ytd_pl <> 0 then b.ytd_pl * -1 + (b.inception_pl) else b.ytd_pl  end as ytd_pl,
             case when b.ytd_premium_pl <> 0 then b.ytd_premium_pl * -1 + (b.inception_premium_pl) else b.ytd_premium_pl  end as ytd_premium_pl ,
              c.base_ccy as IN_STRIKECURR,c.quoted_ccy as IN_QUOTEDCUR,c.region_code as dlc_region,c.entity_acronym as dlc_entity, to_char(c.trade_id) as dtl_reference,
            8 as trade_state,  case when to_char(b.pl_date,''D'') = 6 then b.pl_date + 2 else b.pl_date end as blankout_date
    from tbl_trade_hist a
    join tbl_pl b on a.trade_id = b.trade_id and a.version = b.trade_version
    join tbl_trade_hist c on a.tradE_id = c.trade_id
    join tbl_pl d on c.trade_id = d.trade_id and c.version = d.trade_version and d.pl_date =   (select max(e.pl_date) from tbl_pl e where c.trade_id = e.trade_id and e.pl_date <= c.amendment_date)
    join tbl_bo_book f on a.bo_book_id = f.bo_book_id and f.business_area = ''OPTIONS''
    where (b.bo_book_id <> d.bo_book_id or a.region_code <> c.region_code or a.entity_acronym <> c.entity_acronym or a.base_ccy <> c.base_ccy or a.quoted_ccy <> c.quoted_ccy)
    and      d.pl_date  -  b.pl_date =  case when to_char(d.pl_date,''DAY'') = ''MON'' then  3 else  1 end
    and      d.pl_date <= to_date(    fv[EOD]          ,''DD-MON-YYYY'')
    union all
    select b.bo_book_id as xt_strategy,  b.bo_book_id as acct_description,case  when to_char(b.pl_date,''D'') = 6 then (b.inception_pl * -1 + b.inception_premium_pl * -1) else  (b.mon_pl ) end as mon_pl ,
             case when to_char(b.pl_date,''D'') = 2 then  (b.inception_pl * -1 + b.inception_premium_pl * -1)  when to_char(b.pl_date,''D'')  > 2 then  (b.tue_PL) else 0 end as tue_pl, case when to_char(b.pl_date,''D'') = 3 then  (b.inception_pl * -1  + b.inception_premium_pl * -1 )  when to_char(b.pl_date,''D'') > 3 then  (b.wed_pl) else 0 end as wed_pl ,
               case when to_char(b.pl_date,''D'') = 4 then  (b.inception_pl * -1 +  b.inception_premium_pl * -1 )   when to_char(b.pl_date,''D'') > 4 then  (b.thu_pl ) else 0 end as thu_pl , case when to_char(b.pl_date,''D'') = 5 then  (b.inception_pl *-1 + b.inception_premium_pl * -1)  when to_char(b.pl_date,''D'') > 5 then  (b.fri_pl) else 0 end as fri_pl ,
             (b.mon_pl + b.tue_pl + b.wed_pl  + b.thu_pl + b.fri_pl)  + (b.inception_pl* -1 + b.inception_premium_pl * -1)  as wtd_pl, case when b.wtd_premium_pl <> 0 then b.wtd_premium_pl + (b.inception_premium_pl * -1) else b.wtd_premium_pl end as wtd_premium_pl  ,   case when b.mtd_pl <> 0 then  b.mtd_pl + (b.inception_pl * -1) else b.mtd_pl end as mtd_pl ,
             case when b.mtd_premium_pl <> 0 then b.mtd_premium_pl +  (b.inception_premium_pl * -1) else b.mtd_premium_pl end as mtd_premium_pl,  case when b.ytd_pl <> 0 then b.ytd_pl + (b.inception_pl * -1) else b.ytd_pl  end as ytd_pl,
             case when b.ytd_premium_pl <> 0 then b.ytd_premium_pl + (b.inception_premium_pl * -1) else b.ytd_premium_pl  end as ytd_premium_pl ,
             a.base_ccy as IN_STRIKECURR, a.quoted_ccy as IN_QUOTEDCUR, a.region_code as dlc_region,a.entity_acronym as dlc_entity, to_char(a.trade_id) as dtl_reference, 8 as trade_state,
            case when to_char(b.pl_date,''D'') = 6 then b.pl_date + 2 else b.pl_date end as blankout_date
    from tbl_trade_hist a
    join tbl_pl b on a.trade_id = b.trade_id and a.version = b.trade_version
    join tbl_trade_hist c on a.tradE_id = c.trade_id join tbl_pl d on c.trade_id = d.trade_id and c.version = d.trade_version and d.pl_date =   (select max(e.pl_date) from tbl_pl e where c.trade_id = e.trade_id and e.pl_date <= c.amendment_date)
    join tbl_bo_book f on a.bo_book_id = f.bo_book_id and f.business_area = ''OPTIONS''
    where (b.bo_book_id <> d.bo_book_id or a.region_code <> c.region_code or a.entity_acronym <> c.entity_acronym or a.base_ccy <> c.base_ccy or a.quoted_ccy <> c.quoted_ccy)
    and      d.pl_date  -  b.pl_date =  case  when to_char(d.pl_date,''DAY'') = ''MON'' then  3 else  1 end and      d.pl_date   <= to_date(  fv[EOD]  ,''DD-MON-YYYY'') ))
    group by xt_strategy,ACCT_DESCRIPTION,DLC_REGION,DLC_ENTITY';
    c clob;
    s varchar2(25000);
    i numeric := 424;
    begin
         c := xml;
       dbms_output.put_line('length of clob: ' || dbms_lob.getlength(c));
       dbms_output.put_line('split clob at: ' || i);
       dbms_output.put_line('desired substring length: ' || to_char(dbms_lob.getlength(c) - i));
       s := dbms_lob.substr(c, dbms_lob.getlength(c) - i, i + 1);
       dbms_output.put_line('length of substring: ' || length(s));
    end;I checked for the database characterset and they are same - AL32UTF8
    The result we get is
    Output from MD1 database
    length of clob: 10616
    split clob at: 424
    desired substring length: 10192
    length of substring: 10192
    Output from MD2 database
    length of clob: 10616
    split clob at: 424
    desired substring length: 10192
    length of substring: 8191Any idea why there is this discrepancy ?
    Edited by: USER101 on Feb 19, 2010 4:24 PM

    The EOF and the LF versus CR/LF could influence the count difference, yes.
    Another explain could possibly be character set conversions. The BFILE I believe counts bytes, a CLOB would count "characters" - so if the source happens to contain a few multibyte characters (UTF), then the byte count would be larger than the character count.
    To help you find the cause for your exact file, then I can suggest a couple of things you might do to explore the issue:
    <li>Load the file into a BLOB instead of a CLOB and see what getlength() returns for the BLOB. BLOBs would also do byte counts and not try to treat the source as text.
    <li>Save the CLOB back into the filesystem and compare the original file with the exported CLOB and check the differences with some filecompare tool.

  • SAPSCRIPT Quantity Symbol printing different values

    Hi,
    I am generating a Printout & Fax at a time for the Purchase Order output, a SYMBOL which is having a conversion value is printing different values in FAX output. Both the Printout and Fax uses the same Print Program but different sapscripts which have same formatting for printing the conversion value (different scripts but copied one and no changes in the script).
    the following symbol is printing different values:
    Print program:
    data: p_value type ekpo-menge,
             umbsz TYPE umbsz.
    umbsz = marm-umrez / marm-umren.
    p_value = umbsz.
    Script
    &p_value(7.0R)&
    This &p_value(7.0R)& gives different values in Printout and Fax and this difference is not for every document, it is for some documents and there are no changes in conversions also.
    My question is: "Is there any problem in using (7.0R) for datatype menge, I mean restrict the no.of characters and decimals at a time for quantity field type".
    Thanks in Advance.
    Ravi

    Hi Ravi,
    Try doing a WRITE - TO in your program. Make the variable p_value type char.
    Another suggestion would be to get the value doing a PERFORM xxxxx IN PROGRAM and retrieve the value from there.
    Regards,
    Ernesto.

  • [ora_hash] different value for the same input

    hi all,
    i'm using 2 different machine running the same version of oracle (11g).
    on those 2 db i have the same tables with the same datas.
    for the comparisson of the data i'm using the ora_hash function (both on numeric and string fields) and for some records i get different results.
    how is that possible?
    (by the way looking at the records that has different hashes the values calculated by the hash function are the same)
    thx

    You have posted in the wrong forum. As the forum title says this forum is for SQL Developer and not for SQL or PL/SQL questions.
    After reading the information provided at the end of this reply you should
    1. create a new thread in the SQL and PL/SQL forum
    PL/SQL
    2. Edit this current question to add a link to the new question and tell people to follow up in the other forum.
    3. Mark this current question ANSWERED so followup will be in the other forum.
    Thanks.
    When you post in the other forum provide information related to the following
    >
    for the comparisson of the data i'm using the ora_hash function (both on numeric and string fields) and for some records i get different results.
    >
    Please post your 4 digit Oracle versions - both versions (result of SELECT * FROM V$VERSION) and examples (i.e. actual code) of values that are giving different results.
    >
    (by the way looking at the records that has different hashes the values calculated by the hash function are the same)
    >
    What? there can't be 'different hashes' if the 'values calculated by the hash function' are the same. What are you saying here?
    Again - provide examples that show the differences. Should be something like
    SELECT ORA_HASH(12345) FROM DUAL;Since you say there are differences on the two machines provide the execution plan from each machine that shows what Oracle is actually doing. One machine may be applying a function to the data.

  • What are the different values available for type attribute

    Hi,
        I am working with IDOC to Stored Procedure. For each field we need to give the values for 'isInput' and 'type' attributes. I need to pass values for 'datetime' and 'numeric' fields. What are the list of values availabIe for 'type' attribute. I know only about 'CHAR' attribute.
         Can anybody please tell me what all the values availabe for attribute 'type'. I am facing this problem while giving the value for type attribute.
    Thanks in Advance,
    Murthy.

    Does this help
    tring
        Data that contains a combination of letters, numbers, and special characters. String data types are listed below:
    CHARACTER: Fixed-length character strings. The common short name for this data type is CHAR.
    VARCHAR: Varying-length character strings.
    CLOB: Varying-length character large object strings, typically used when a character string might exceed the limits of the VARCHAR data type.
    GRAPHIC: Fixed-length graphic strings that contain double-byte characters.
    VARGRAPHIC: Varying-length graphic strings that contain double-byte characters.
    DBCLOB: Varying-length strings of double-byte characters in a large object.
    |BINARY: A sequence of bytes that is not associated with a |code page.
    |VARBINARY: Varying-length binary strings.
    BLOB: Varying-length binary strings in a large object.
    |XML: Varying-length string that is an internal representation |of XML.
    Numeric
        Data that contains digits. Numeric data types are listed below:
    SMALLINT: for small integers.
    |INTEGER: for large integers.
    |BIGINT: for bigger values.
    DECIMAL(p,s) or NUMERIC(p,s), where p is precision and s is scale: for packed decimal numbers with precision p and scale s. Precision is the total number of digits, and scale is the number of digits to the right of the decimal point.
    |DECFLOAT: for decimal floating-point numbers.
    REAL: for single-precision floating-point numbers.
    DOUBLE: for double-precision floating-point numbers.
    Datetime
        Data values that represent dates, times, or timestamps. Datetime data types are listed below:
    DATE: Dates with a three-part value that represents a year, month, and day.
    TIME: Times with a three-part value that represents a time of day in hours, minutes, and seconds.
    TIMESTAMP: Timestamps with a seven-part value that represents a date and time by year, month, day, hour, minute, second, and microsecond.
    Regards
    Ravi

  • Creating a Material with different values for fields in Transaction MM01

    Hello All,
    While creating a material i will be giving a Profit Center in Sales:general/plant view, which i can see in Costing1 View. If i change this in this View it automatically changes in the other View. Is there any way to give different values in the two views or then what is the significance in showing the same field again in two different views.
    Thanks,
    Shashidhar.

    Hi,
    Its just a way of showing the data in different views for user. It doesn't have any significance.
    Regards,
    Sudheer.

  • Passing different values to the same servlet

    Hi,
    Is there a way to pass different values to the same servlet?
    Background:
    I have a database that I query to acquire a list of customers, then I show each customer as a link, that when clicked will show details of that customer. (The customer table is dynamic so I can't create a new page for each customer)
    When using JSP what I do is
    //Do query database
    while (rst.next())
         String cust = rst.getString ("cust");
            out.write("<a href = \"cust2.jsp?cust=" + cust + " \" >" + cust + "</a> ");
    }Then on the cust2.jsp. I will use
    String str = request.getParameter ("cust");to acquire the customer to get details of.
    Is there a way to do the same using servlets?
    I could swap to JSP when creating this particular part of the project but it won't look good and it would help me learn a few things when there is another way.

    I want to know if there is a way to pass a variable from a webpage link like in my JSP example using servlets.
    Here is what I wanted to do:
    I have a webpage that contains customer names and each name has a link to the same servlet (let's say the link is famia/servb). I want servb to show detailed information about the customer my visitor clicked in the webpage.
    The logic I was thinking is to pass a variable to this servlet, then I can use that variable to know which customer should I query in my database. So that I can show the details to my users.
    Here lies my problem, I don't know how I can pass this variable, or even know which customer my visitor clicked. I can't use a new servlet for each client since the customer is in a database and if my customer base grows then I would need to create a lot more web page that does the same thing.
    The JSP example I gave is how I will be coding it if I am using JSP, but now I am using servlets. So I was wodnering if there is a way to do this using servlet. Or should I stay with using JSP for this particular logic and just call servb after the JSP page acquired the variable.
    I'm trying not to use "<original URL> + ? + <variable> = <value>" (eg: http://www.famia.net/customer?cust=famia) as the means for passing the variable. (or in the example as a means of passing variable cust with value famia)

  • The table has total different value than what I inserted!

    Hi, I have a table named "cfg2" and the structure of the table is like this.
    Name Null? Typ
    UID NOT NULL VARCHAR2(30)
    S1 VARCHAR2(10)
    S2 VARCHAR2(10)
    UIDFLAG NOT NULL NUMBER(1)
    I inserted "UID" values from 1 to 100 with preparedstatement. The code looks like this.
    String query = "insert into cfg2 values (?,?,?,0)";
    ps = conn.prepareStatement(query);
    for (int i =1; i <=100; i++)
    String ii = String.valueOf(i);
    ps.setString(1, ii);
    ps.setString(2, "blaHi");
    ps.setString(3, "blaHa");
    ps.execute();
    conn.commit();
    The strange thing is that the value of "uid" is different from what I inserted. When I use "select * from cfg2", then it shows exactly the values which I inserted. Like this.
    UID S1 S2 UIDFLAG
    1 blahi blaha 0
    2 blahi blaha 0
    3 blahi blaha 0
    ..... Until the UID is 100.
    But I can't get any special line, using "select ...where uid like '3(for example)'". So I let only the UID values be shown, using "select uid from cfg2", and then the astonisching result came. All the uid values are 77, like this.
    UID
    77
    77
    77 .....
    I deleted the table and established another table with the same structure and tested again. The result was always same. No matter what I insert into "UID", the value which I got was always 77. Does anybody have same or similiar experience? Any help is welcome. Thanks.

    What is your source material? Is it H.264? FCP does not work correctly with that material.
    Click on a source clip in the FCP Browser, and once selected, type Command + 9 to see the item properties for the clip. Either report those properties, or take a screen shot of the item properties, and post that here.
    Next, click anywhere in your timeline, and then type Command + 0 {zero} to see your Sequence Settings. Either report those Sequence Settings, or take a screen shot of the Sequence Settings and post that here.
    MtD

  • How to give different value to a static variable???

    Hi all:
    Is there any solution to set different values to a static variable???I had try two ways but all have errors!
    1.Way_1
    protected String tmp=null;
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    tmp = "string1";
    else if (sayorpress==1)
    tmp = "string2";
    protected static String RESOURCE_STRING = tmp; <---error
    Error:non-static variable tmp cannot be referenced from a static context
    2.Way_2
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    protected static String RESOURCE_STRING = "string1"; <---error
    else if (sayorpress==1)
    protected static String RESOURCE_STRING = "string2"; <---error
    Error:illegal start of expression at
    not an expression statement at
    Thank you very mich!!!

    Try this:
    protected static String RESOURCE_STRING = null;
    protected void initSituation(int sayorpress)
    if (sayorpress==0)
    yourClass.RESOURCE_STRING = "string1";
    else if (sayorpress==1)
    yourClass.RESOURCE_STRING = "string2";
    You cannot declare a static variable inside a method. But you can access a static variable thorugh your class.

  • DataGridCellStyle: Set Background of DataGridCell based on value in a Different DataGrid / DataTable

    Hi everyone
    I am trying to set the background of a cell in a datagrid based on a value in a different datagrid. Is it possible to specify this in the XAML through binding? I'm using the MVVM pattern and would like to minimise code in the code behind. Please note that
    the datagrids are the same dimension, but the dimension is unknown until runtime.
    I've copied an image of the two datagrids. Essentially, the second datagrid will contain values of 0 or 1. I would then like to color the cells in the first datagrid a different color based on these values. 
    CODE:
    <DataGrid Style="{StaticResource Style1}" ItemsSource="{Binding Table1, StringFormat=n}" AutoGenerateColumns="True" >
    <DataGrid.InputBindings>
    <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CommandWithParameter}" CommandParameter="{Binding .}"/>
    </DataGrid.InputBindings>
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="Background" Value="{Binding Table2, Converter={StaticResource WeightConverter} }"/>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    Thanks!

    You could use a DataTrigger that binds to a column of a row of the other DataGrid like this:
    <DataGrid x:Name="datagrid"></DataGrid>
    <DataGrid x:Name="datagrid2">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Style.Triggers>
    <DataTrigger Binding="{Binding Path=Items[0].num, ElementName=dataGrid}" Value="abc">
    <Setter Property="Foreground" Value="Red"/>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </DataGrid.CellStyle>
    </DataGrid>
    DataTable dt = new DataTable();
    dt.Columns.Add(new DataColumn("num") { DataType = typeof(string) });
    dt.Rows.Add("abc");
    datagrid.ItemsSource = dt.DefaultView;
    datagrid2.ItemsSource = new List<string> {"a", "b", "c" };
    Hope that helps.
    Please also remember to mark all helpful posts as answer to close your threads and please start a new thread if you have a new question.

  • Need Value and labed different for a dynamic Dropdown in an ADF page

    Hi,
    We have an ADF page with a drop down.
    This is populated dynamically.
    We have created using the below code.
    Issue: what we need is that each value the Label set should be different.
    Code : presently hard coded
    In the Java file for the page we had the following code:
    ===========================================================
    String haircolor;
    SelectItem[] haircolorSelectItems;
    ArrayList haircolorlist = new ArrayList();
    public PatientAdvSearch() {
    haircolorlist.add(new SelectItem("Black"));
    haircolorlist.add(new SelectItem("Blonde"));
    haircolorlist.add(new SelectItem("Red"));
    haircolorlist.add(new SelectItem("Others"));
    haircolorlist.add(new SelectItem("Grey"));
    SelectItem[] haircolors = (SelectItem[]) haircolorlist.toArray(new SelectItem[0]);
    haircolorSelectItems = haircolors;
    public void setHaircolor(String haircolor) { this.haircolor = haircolor; }
    public String gethaircolor() { return haircolor; }
    public SelectItem[] getHaircolorSelectItems() {
    return haircolorSelectItems;
    ===========================================================
    And the JSPX will have the following code.
    <af:selectOneChoice binding="#{backing_PatientAdvSearch.selectOneChoicerace11}"
    id="selectOneChoicerace11"
    unselectedLabel="&lt;Select>">
    <f:selectItems value="#{backing_PatientAdvSearch.haircolorSelectItems}" />
    </af:selectOneChoice>
    ===========================================================
    This populates both Lable and Value for the Select Item with one value.
    We need two different value.
    How do we go ahead with that.
    Thanks

    Yes.. actually i am also facing the same prob...
    i need value and label to be different for dynamic dropdown.
    Please help in case any one has faced the same issue.

  • Can anyone tell me the best way to store same key & different value pairs?

    Hi,
    I have a set of string elements & corresponding to them i have values. The only problem i have is that one string element can occur multiple times but with different values. I want to store this in a linked passion. Because i have to read it again to get the same order. Any ideas???

    > If you don't mind, can you elaborate a little more. I
    am a little confused.
    Here's a small demo:
    import java.util.*;
    public class Test {
        private Map map;
        public Test() {
            map = new HashMap();
            this.addSomethingToYourMap("A", new Integer(1));
            this.addSomethingToYourMap("B", new Integer(2));
            this.addSomethingToYourMap("C", new Integer(3));
            this.addSomethingToYourMap("A", new Integer(11));
            this.addSomethingToYourMap("B", new Integer(22));
            this.addSomethingToYourMap("C", new Integer(33));
            System.out.println(map);
        private void addSomethingToYourMap(String key, Integer value) {
            // The key exists, so get the List from your map and add the value in the List.
            if(map.containsKey(key)) {
                List values = (ArrayList)map.get(key);
                values.add(value);
            // The key does not exist, add a new List with the value in it to your map.
            else {
                List newValues = new ArrayList();
                newValues.add(value);
                map.put(key, newValues);
        public static void main(String[] args) {
            new Test();
    }

  • Comparing row values in two different tables

    Hello,
    Does anyone know if it is possible to compare (and possibly highlight - which I know can be done) row values in two different tables?
    I have a ZIP Code column in table A that I want to compare to a ZIP Code column in table B and highlight those ZIP Codes that are present in table B but not in table A etc. Is this possible?
    Thanks,
    Kenneth

    To be able to apply conditional formatting, I must edit the formulas this way.
    =IF(ISBLANK(B)," ",IF(ISERROR(VLOOKUP(B,Tableau 2 :: B,1,0))," ",VLOOKUP(B,Tableau 2 :: B,1,0)))
    =IF(ISBLANK(B)," ",IF(ISERROR(VLOOKUP(B,Tableau 1 :: B,1,0))," ",VLOOKUP(B,Tableau 1 :: B,1,0)))
    I replaces the four empty strings by strings containing one space character.
    In the field supposed to contain the text which is not contained I just entered a single space character.
    Yvan KOENIG (from FRANCE vendredi 12 septembre 2008 20:52:11)

  • Combobox in Datagrid with different values

    Hi All,
    I have a datagrid. One of the columns in the datagrid is set
    to display a combobox as the ItemRenderer. Now, the data for the
    combobox is different for each row. How do I set up the data
    provider for the combobox in such a scenario.
    For example : I have a collection of Shirt objects.
    public class Shirt {
    public String id;
    public String type;
    public String[] color; //this is an array
    This should be displayed in the datagrid, with the Color
    column rendered as a combobox. The colors will be different for
    each shirt.
    Thanks
    CS

    Yes. Some more detail:
    in the function,
    override public function set data(value:Object): void {
    the "value" parameter will contain a refernce to an entire
    "Shirt" instance.
    So you can assign the comboBox.dataProvider=value.color;
    Now, It is more complicated than this, because you will want
    the combobox to show the correct value for each row, right?
    For this to happen, you will need a selectedColor property on
    Shirt. When the user chooses a color, you will need to update this
    property with the selection.
    Next, your renderer must read the value of selectedColor and
    set the comboBox.selectedIndex.
    If selectedColor contains the *index* of the color then you
    have it easy. If it contains the color name itself, then you will
    have to for-loop over the color array until yom match the
    selectedColor. then you will have the index and can set
    selectedIndex.
    ComboBox does not support setting the value directly. It is
    pretty easy to extend combo to do this. There are several examples
    out there. I posted a link to one on CFLEX.net
    Tracy

Maybe you are looking for

  • Blank first page and chart printing on the second page

    I have a subreport in my report footer that displays a chart.  The detail section is suppressed in the main report.  For some reason the chart displays on the second page of the report and the first page is blank except for the report header and page

  • How to identify which button is clicked in an action

    Hi, I am just checking whether it is possible to build calculator or not in webdynpro for abap. I have some buttons and i have associated same action for all the buttons and in that action i would like to know which button is clicked. Please let me k

  • How do I get the pictures I put onto my phone from iphoto into my photostream?

    I am a photographer and would like to show off pictures.  I was able to sync my photos from iPhoto to my iPhone but I can't seem to get the pictures to be viewed on PhotoStream.  Pictures that were sent to me in a text and saved to the phone are auto

  • 10G sqlplus result cache

    Hi, we try to write a query to analyze the performance of our database. The problem now is that the sqlplus or the database caches the results. We use a 10g and a 11g database Does anyone know how to do not cache the results Thanks *T                

  • ICWC transaction launcher

    Hi All, I am trying to launch transaction BP using ICWC transaction Launcher Following are the steps i have followed to launch the transaction 1.Swo1 => to copy TSTC To ZZstc Object name: Zexecute 2.Changed ZZstc to check Synchronous check box => sav