Using parameters in a select query sometimes not working

I use parameters throughout my code - usually without problem, but for some reason in one case it does not return a result. When I modify the querystring to contain the value instead of using parameters it works. Is it because I'm secting a clob? or is it because I'm using a 9i ODP.net dll against a 10g database? this is c# 2.0
here's the source code that does not work for me - REQUEST_DATA is a clob:
    public String loadRequest(String PSRNumber)
        String returnVal = null;
        ConnectionStringSettings connectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Scribe"];
        OracleConnection myConnection = new OracleConnection();
        String strSQL = "select PSR, REQUEST_DATA from stats.request where PSR = :PSR";
        try
            myConnection.ConnectionString = connectionInfo.ConnectionString;
            OracleCommand cmd = new OracleCommand(strSQL, myConnection);
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("PSR", OracleDbType.Varchar2).Value = PSRNumber;
            myConnection.Open();
            OracleDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
                returnVal = dr.GetOracleString(dr.GetOrdinal("REQUEST_DATA")).ToString();
            else
                returnVal = null;
            dr.Dispose();
            cmd.Dispose();
        catch (OracleException ex)
            printError(ex.Message);
        finally
            myConnection.Close();
            myConnection.Dispose();
        return returnVal;
    }when I replace the line generating the sql, and remove the lines pertaining to parameters it works:
String strSQL = String.Format("select PSR, REQUEST_DATA from stats.request where PSR = {0}", PSRNumber);
I'm fine just using this as a workaround, but I need an explanation why the other does not work - I prefer to use parameters.
Message was edited by:
user633546

I figured it out. thank you for your help in pointing me in the right direction.
the problem was there was a trailing space in the data.
when the data for that table is numeric for every record, the query allows me to leave out the single quotes. Trailing spaces do not seem to cause the database to see it as non-numeric - leaving out the quote still finds the record even if there is a trailing space.
but when I put in the quote, it is not an exact string match, so it could not find the record. sometimes this flexibility gets me into trouble :\

Similar Messages

  • Select query is not working in BDC Program

    Hi,
    I am working in BDC for update valuation class for T-code mm01.Actually In this BDC i am using two recoding based on material type.
    i am using two internal table : I_DATA and ITAB
    Use I_DATA to hold excle data in which material No, plant , valuation type , valuation No. and ITAB for material No, material type Only.
    So, i am fetching material Type ( MARA-MTART ) through select query. But Select query is not working. and also i did check MARA table according that  Material Number then  material no. exit in Mara Table.
    Note : at run time  I_DATA have 1 row but ITAB have 0 row ....
    DATA: BEGIN OF I_DATA OCCURS 0,
    MATNR TYPE MARA-MATNR,
    WERKS TYPE MARC-WERKS,
    BWTAR TYPE RMMG1-BWTAR,
    VERPR TYPE BMMH1-VERPR,
    BKLAS TYPE MBEW-BKLAS,
    STATUS TYPE C,
    END OF I_DATA.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    END OF ITAB.
    Loop at I_DATA.
    select matnr mtart from mara into table itab where matnr = I_DATA-matnr.
    endloop.
    Guide me..........

    If you use your
    Loop at I_DATA.
      select matnr mtart from mara into table itab
        where matnr = I_DATA-matnr.
    endloop.
    At end of loop, itab will only contain the result of the last select, so use a
    Loop at I_DATA.
      select matnr mtart from mara APPENDING table itab
        where matnr = I_DATA-matnr.
    endloop.
    better
    if I_DATA[] is not initial.
      select matnr mtart from mara into table itab
        FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
    endif.
    Some Remarks
    - If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
    - You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
    Regards,
    Raymond

  • Why select query is not working?

    CREATE OR REPLACE TYPE prod_type AS OBJECT (
    pid INT,
    pprice NUMBER,
    MEMBER PROCEDURE display(pid IN NUMBER));
    create table prod of prod_type (pid primary key);
    CREATE OR REPLACE TYPE deal_type UNDER prod_type (
    ctr NUMBER,
    OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
    insert into prod values(deal_type(101, 4, 1));
    insert into prod values(deal_type(102, 5, 0));
    ------below given select query is NOT WORKING ---------
    select ctr from prod p where p.pid=101;
    Thanks,
    -Nid

    ------below given select query is NOT WORKINGWondering how you inserted data ...
    SQL> CREATE OR REPLACE TYPE prod_type AS OBJECT (
      2  pid INT,
      3  pprice NUMBER,
      4  MEMBER PROCEDURE display(pid IN NUMBER));
      5  /
    Type created.
    SQL>
    SQL> create table prod of prod_type (pid primary key);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
      4  );
      5  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    4/1      PLS-00103: Encountered the symbol ")" when expecting one of the
             following:
             , not pragma <an identifier>
             <a double-quoted delimited-identifier> final instantiable
             current order overriding static member constructor map
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER));
      4  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    1/1      PLS-00590: attempting to create a subtype UNDER a FINAL type
    SQL>You made an attempt to create a subtype UNDER a FINAL type - that the reason why can not work ...
    Avoid deriving a subtype from this FINAL type.
    HTH

  • Select query in not working for Count(*)

    Hi,
    Our batch team running one query that is selecting one table TSFHEAD and this query is hanging. Below are diffrent shenario in which the select query is running on this table.
    select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
    --not returning any rows and hanging
    select * from tsfhead where create_id = 'BATCH' ---returning rows
    select * from tsfhead where create_date = '26-OCT-12'; --- returning rows
    select count(*) from tsfhead ----not returning rows and hanging
    This table TSFHEAD has 59000 rows.
    SQL> explain plan for select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
    Explained.
    SQL> SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 415503093
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 67 | 215 (1)| 00:00:03 |
    |* 1 | TABLE ACCESS FULL| TSFHEAD | 1 | 67 | 215 (1)| 00:00:03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    1 - filter("CREATE_ID"='BATCH' AND "CREATE_DATE"='26-OCT-12')
    I don't know why this query behaving in this manner.Please help.

    RanVijai_dba wrote:
    Thanks for your reply. But +"select count(*) from tsfhead"+ is hanging and +"select * from tsfhead where create_date = '26-OCT-12' "+ is showing records.It might be showing records, but not necessarily the correct records.
    As sb points out, you are treating dates as strings rather than the DATE datatype. That means you could be querying the wrong data, and your query is also not safe in different environments. It could also effect the query execution plan. Also, as pointed out, you should be ideally using 4 digit years. There were many headaches caused by the use of 2 digit years that most companies corrected as part of the millenium bug fixes prior to the year 2000... well over a decade ago, and most good designs now ensure that 4 digit years are used as standard.
    So your query would be better written as:
    select * from tsfhead where create_date = TO_DATE('26-OCT-2012','DD-MON-YYYY')When you say:
    select count(*) from tsfhead... is hanging, you say the table has around 59000 rows in it, and in reality that's a small amount of records, so a count(*) shouldn't take long at all, even doing a full table scan.
    Post the explain plan for that simple count(*) query for us. (and ensure you use {noformat}{noformat} tags to keep the formatting on the forum, as described in {message:id=9360002})                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • My select query in not working

    hi
    this my select query
    select * from J_1IEXCHDR where werks = 'DT*'
    this is not working
    i want result where werks like DT01, DT09 and many statting with DT
    so plz tel me how to write for like .
    thank

    Hi,
    >
    Guptaprashant wrote:
    > hi
    >
    > this my select query
    >
    > select * from J_1IEXCHDR where werks = 'DT*'
    >
    >
    > this is not working
    >
    > i want result where werks like DT01, DT09 and many statting with DT
    > so plz tel me how to write for like .
    >
    > thank
    Use:-
    select * from J_1IEXCHDR where werks like 'DT%'.
    Regards,
    Tarun

  • XQuery select query is not working in proper speed

    In our project we have large no. data (its a property listing site) and I'm storing that data to Barkeley DB (XML DB). The problem is when I am searching for a property it will list the first 10 property quickly(100% speed). Then I'm going to 2dn, 3rd page its working in the same speed. But if I'm going to 10th(30% speed) or 100th or 1500th(15%speed) page is working very slowly.
    Following are my query:
    let $property_ids:=
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id,
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id,
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id
    return <properties>{
    for $id in subsequence($property_ids, 1, 10) return
    collection('bdb/properties.dbxml')/properties/property@property_id = $id
    }</properties>
    And some times query will change like the following way based on the filter option in my page(means sort by only sale_price field):
    let $property_ids:=
    for $property in collection('bdb/properties.dbxml')/properties/property
    order by $property/sale_price/number() descending
    return $property/@property_id
    return <properties>{
    for $id in subsequence($property_ids, 1, 10) return
    collection('bdb/properties.dbxml')/properties/property@property_id = $id
    }</properties>
    then from the first page its self its performance is very slow(15%).
    Could you please check my query and help me to solve the issue...
    Thank you,
    Vijesh

    If you use your
    Loop at I_DATA.
      select matnr mtart from mara into table itab
        where matnr = I_DATA-matnr.
    endloop.
    At end of loop, itab will only contain the result of the last select, so use a
    Loop at I_DATA.
      select matnr mtart from mara APPENDING table itab
        where matnr = I_DATA-matnr.
    endloop.
    better
    if I_DATA[] is not initial.
      select matnr mtart from mara into table itab
        FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
    endif.
    Some Remarks
    - If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
    - You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
    Regards,
    Raymond

  • Select query is not executing

    Hi Friends,
    my code is :
    itab-vbeln = bseg-vbeln.
    if not itab-vbeln is initial.
    select single vbeln inco1 inco2 into ( itab-vbeln itab-inco1 itab-inco2)
    from vbrk where vbeln = itab-vbeln.
    appned itab.
    note : here inco1 inco2 are incoterms
    my question is  can we direct move the values of bseg-vbeln into itab-vbeln. ???
    and i am generating the report with one varient , when i debug this report the
    there is no value in bseg-vbeln. it is showing null value.thats why my select query is not working..but i want execute this select query final.
    in output i want display the inco1 inco2 data.(incoterms)
    any help please.
    urgent.
    regards,
    vijay.

    Hi Vijay,
    First you need to check it out whether <b>itab-vbeln = bseg-vbeln</b> is in with in LOOP or not (<b>if ITAB is intenal table</b>)
    if itab is internal table you should write above statement with in loop, and also check it out in debug mode why bseg-vbeln value is not coming.
    and one more thing you need to make small correction in ur code use ',' .
    select single vbeln inco1 inco2 into ( <b>itab-vbeln, itab-inco1, itab-inco2</b>)
    from vbrk where vbeln = itab-vbeln
    Note: when ever use select single u should pass values into work area, dont use internal table .
    <b>if you have more doubts just send your entire code then i will rewrite it.</b>
    <b>Reward with points if useful.</b>
    Regards,
    Vijay Krishna

  • Using varchar record in SELECT query

    Hi, from a VARCHAR field I get the string ",1,2,3,4,5,6,".
    I wish to use it in a SELECT query like:
    SELECT * FROM TABLE WHERE ID IN (1,2,3,4,5,6)
    Is there a way to obtain this in a tsql query ?
    Thank you
    Stefano

    CREATE TABLE t1
     col1 INT NOT NULL PRIMARY KEY,
     col2 VARCHAR(50) NOT NULL
    INSERT INTO t1 VALUES (1,'10,11,12')
    INSERT INTO t1 VALUES (2,'13')
    INSERT INTO t1 VALUES (3,'14,15')
    CREATE TABLE t2
     col1 INT NOT NULL PRIMARY KEY,
     col2 VARCHAR(50) NOT NULL
    INSERT INTO t2 VALUES (10,'A')
    INSERT INTO t2 VALUES (11,'B')
    INSERT INTO t2 VALUES (12,'C')
    INSERT INTO t2 VALUES (13,'D')
    INSERT INTO t2 VALUES (14,'E')
    INSERT INTO t2 VALUES (15,'F')
    SELECT DISTINCT O.col1, O.col2
    FROM t1 T
       INNER JOIN t2 O
          ON (PATINDEX('%,' + CAST(O.col1 AS varchar(10)) + ',%',
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How can i use SUM aggregate in select query?

    HI,
    GURUS,
    How can i use SUM function in Select Query and i want to store that value into itab.
    for ex:
    TABLES: vbap.
    types: begin of ty_vbap,
           incluse type vbap,
           sum type string,
          end of ty_vbap.
    data: i_vbap type TABLE OF ty_vbap,
          w_vbap type ty_vbap.
    SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.
                            (or)
    SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.
      loop at i_vbap into w_vbap
    " which variable have to use to display summed value.
      endloop.
    if above code is not understandable pleas give ome sample code on  above query.
    Thank u,
    shabeer ahmed.

    Hi,
    Check this sample code.
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Regards,
    Sravanthi

  • Check Index used in an oracle select query

    Hi Friends,
    I have partitioned an oracle table and created Local Index for the Partitioned table .
    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?
    Please let me know.
    Regards,
    DB

    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.Why? Have you proven that using this local index is the "best" plan?
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?When I asked Google "how to read an oracle explain plan," I found lots of information - what did you find?

  • "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    Here are three screenshots in succession from trying to perform the color selection:
    Dropbox - Screenshot 2015-02-12 14.57.40.png
    Dropbox - Screenshot 2015-02-12 15.00.14(2).png
    Dropbox - Screenshot 2015-02-12 15.01.00.png

  • Uploading Files Using InputFile Component -- Sometimes not working

    Hello,
    This is the 2nd time I make a post about it!
    Because I have more than 1 application using upload, and everything is correct! But it doesn't work as it should!
    You can check the original post here: Uploading Files Using InputFile Component - Sometimes not working
    I need a solution please!
    The only thing we can conclude is that it could be a bug from oracle !!! (???) But I talked with other people and they say that it works fine for them.
    There is one important thing: when we put a form to "Uses Upload = true" it seems that the page doesn't work very normal. For exemple: if you use a table in a form that uses upload the table get's "crazy".
    Thanks,
    JP

    I have now access to METALINK!
    I can find some problems and patches about inputFile but not mine! I will check better later!
    I think the problem is caused because of my framework!

  • SELECT DISTINCT does not work - Another Problem!

    Dear All
    Previous Post
    I just posted a thread, which has been answered by an expert. It's here:
    SELECT DISTINCT does not work. Why?
    My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
    The solution was to change this select:
    T0.[U_SupInv]      AS 'Link'
    ... to this:
    CAST(T0.[U_SupInv] as nvarchar(100))      AS 'Link'
    The amended Query worked.
    New Problem
    I just discovered that resolving the problem created a new one.
    The field U_SupInv (Link) is in fact a UDF.
    I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
    to the respective AP Invoice.
    Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
    When the Query is amended by adding CAST, the link becomes dead.
    Help
    Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
    The main purpose of my Query is to help users view the pdf scans by clicking on the links.
    Thanks
    Leon Lai
    Here's my Original Query
    SELECT
    T0.[UpdateDate] AS 'Update Dt',
    T0.[TaxDate] AS 'Doc Dt',
    CASE T5.[TransType]
         WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
         WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
    END 'SAP Ref.',
    T1.[ImportLog]     AS 'Ship #',
    T0.[CardCode] + '' AS 'Supplier #',
    T0.[CardName]      AS 'Supplier Name',
    T0.[DocTotal]      AS 'Rs',
    T1.[BlockNum]      AS 'Reqn #',
    T0.[DocNum]        AS 'Doc No',
    T0.[U_SupInv]      AS 'Link'
    FROM klship.[dbo].[OPCH] T0
    INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
    INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
    WHERE
    (T0.[UpdateDate] >= '[%2]' AND
    T0.[UpdateDate]  <= '[%3]' AND
    T0.[U_SupInv] IS NULL)
    OR
    (T0.[UpdateDate] >= '[%4]' AND
    T0.[UpdateDate]  <= '[%5]' AND
    T0.[U_SupInv] IS NOT NULL)
    FOR BROWSE

    Dear István Korös,
    Thanks a lot for your answer.
    I will test your suggestion tomorrow, as it's night and I am returning home now.
    However, I do not think it will suit my requirements for the foll reasons:
    - I worked hard to get rid of the need to enter anything in the @Scan2 field.
    - This UDF was created solely as a text of instruction for my staff.
       Unfortunately I had to fill in something to make the Query work.
    - The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
       blank, the query does not work.
    - With the help of another expert, I succeeded in ignoring @Scan2 altogether.
    - I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
      need to enter something in @Scan2, so you may not be aware of my requirement.
    - I hope you understand my reluctance. But I will try your suggestion nevertheless.
    My Suggestion
    I think using PCH1.VISORDER may be the solution.
    If we select only those rows where visorder = 0, then
       - there will be no duplication
       - I need not use SELECT DISTINCT
       - All my LINKS to pdf files will be live because I need not use CAST
       - I may retain that part of my Query which permits ignoring @Scan2 altogether.
    - A Dream!-
    The problem is that I don't know how and where  to place that VISORDER.
    If you think I may be right, could you help me along that line?
    Best Regards
    Leon Lai

  • I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I could do that, however when I select the icloud button (or whatever the heck it is) I am asked to enter the apple id and password. So if you are suppose to create another one for icloud you'd think it would give you the option at this point which would be logical.

  • Select() function is not working properly in solaris 10.

    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
    Thanks a lot.
    Regards,
    Srikanth.

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

Maybe you are looking for

  • Monitor display no signal input

    my computer turn on but the monitor display no signal input.  I plug my monitor to other computer and the screen shows my icons and everything but when I plug other monitor to my computer it say no signal input. How do I fix my computer to communicat

  • How much cpu does itunes require to import a cd?

    istat pro reported 98% cpu used by itunes in importing a cd! this cant be normal? this was in the 'processes' section. in the cpu section it was saying about 50%. same reported in activity monitor. .... neither of which sound normal to me? btw the cd

  • Grouping for Dunning Notices Not updated FKKMAKO-MGRUP

    Hi All,   Dunning grouping field is not updated after dunning ran. Field FKKMAKO-MGRUP   I am enhancing couple new steps to collection strategy for current dunning which is running good.   All existing steps running fine and field(Dunning grouping fi

  • Unable to create remote portlet

    Hi I have created and deployed a simple wsrp portlet on producer end. when i tried to add the created portlet as remote portlet, i got this error. I am using weblogic portal server 9.2 and weblogic workshop 9.2. com.bea.wsrp.consumer.management.produ

  • Disable Photobooth for network accounts

    Hi there, I have Mac's attached to a windows active directory network. I am looking to disable some mac software on the windows login account without a mac server. Is this possible??? any help is gratefully appreciated tim