Quering with sysdate function

hi all ,
there is a strange thing right here ,
i set the where clause for my database block to , ( test_date = sysdate )
then , query caused no records to be retrieved , and i am sure that the table has records with sysdate date .
why does this happen ?
even if i queried the table in the isqlplus ,
select test_date from patients ; -- then queries with sysdate date are retrieved , but if i write
select test_date from patients where test_date = sysdate . -- there is nothing to be retrieved .?
help ?
even i created a new table tt with one column(cc) , and inserted the value sysdate in it ,
when i select sysdate from dual then it works 27-NOV-12 but
when i select dd from cc where dd = sysdate then no rows selected
Edited by: semsem on Nov 27, 2012 11:33 AM

sysdate contains both date and current time elements, down to seconds. You will never find a match on sysdate, unless you hit the query at exactly the right time that matches some record in your table.
Set your where clause to:
( trunc (test_date) = trunc (sysdate) )
The "trunc" truncates (removes) the time element from your date values before doing the conditional test.
when i select sysdate from dual then it works 27-NOV-12Do this in SQL Plus:
alter session set nls_date_format='mm-dd-yyyy hh24:mi:ss';That will enable you to see the true date and time contained in your date datatypes. Here is an example:
SQL> select sysdate from dual;
SYSDATE
27-NOV-12
SQL> alter session set nls_date_format='mm-dd-yyyy hh24:mi:ss';
Session altered.
SQL> select sysdate from dual;
SYSDATE
11-27-2012 11:47:37Note in Forms, you can use two datatypes: DATE and DATETIME The both will query a date from the database, but the DATE datatype will remove the time element in the form, so a data change occurs. If you want to see the full date and time from the database column, use DATETIME, and set the Format Mask to something that will display everything.
Edited by: Steve Cosner on Nov 27, 2012 11:42 AM

Similar Messages

  • Queries with custom functions

    Hi, Oracle gurus,
    I experienced recently an issue with SQL performance when playing with queries using PL/SQL functions.
    Let’s look at the following query:
    SELECT my_package.my_function(x)
    FROM Xvalues
    This query returns values calculated by a PL/SQL function “my_function” in “my_package” package. The function performs some CPU intensive computations so that it takes it approx. 1 second to return a value. If the “Xvalues” table contains 100 rows then it takes Oracle 100 seconds to complete the query. OK.
    Now I want to filter only non null results so that my query may look as:
    SELECT y
    FROM (
    SELECT my_package.my_function(x) y
    FROM Xvalues
    WHERE y IS NOT NULL
    It was surprising for me that it took Oracle ca. 200 seconds to complete this query, twice as long as the original one. I believe that the optimizer resolves this query to something like this:
    SELECT my_package.my_function(x) y
    FROM Xvalues
    WHERE my_package.my_function(x) IS NOT NULL
    When processing such a query Oracle first evaluates the WHERE clause to decide to return output values specified in the SELECT clause or not. That’s logical in most situations, but in this particular case it leads to longer execution time.
    What I do to workaround this problem is splitting the query. First I put all values into a temporary table using
    INSERT INTO TempTable
    (SELECT my_package.my_function(x)
    FROM Xvalues)
    and then select non null results with another query
    SELECT y
    FROM TempTable
    WHERE y IS NOT NULL
    The whole execution time shrinks to original ca. 100 seconds what I wanted to achieve. Nevertheless I am not satisfied with this solution because it introduces some intermediate steps. This is only a simplified example but in fact my query is much more complex, consists of many nested subqueries, etc. and this approach – although effective – would require dozens of temporary tables and make the whole query unclear.
    I wonder if there is a simpler solution possible, for example to have one single hierarchical query like above one and force Oracle first to fully process the nested subquery and then the embracing one? The goal is to decrease waiting for filtered results down to original 100 seconds (or a bit longer) …
    Any suggestions will be greatly appreciated!
    Greg

    Maybe Tom Kyte's "trick" of the "select pl_sql_function () from dual" to invoke scalar subquery caching can help you:
    select ename
      from emp, dept
    where (select dname_lookup(emp.deptno) from dual) = 'SALES'
       and dept.deptno = 30
       and emp.deptno = dept.deptno;http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1547006324238
    As Tom says, in 11g you'll be able to cache that function (new 11g feature) which removes the need for the "trick":
    Oracle® Database PL/SQL Language Reference 11g Release 1 (11.1)
    - 8 Using PL/SQL Subprograms
    -- Using the Cross-Session PL/SQL Function Result Cache
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/subprograms.htm#BABFHACJ
    "On the PL/SQL Function Result Cache" by Steven Feuerstein
    http://www.oracle.com/technology/oramag/oracle/07-sep/o57plsql.html
    Regards,
    Zlatko

  • Queries with date functions using PreparedStatement for multiple DB

    I am developing application that uses DB independant queries. I am using preparedstatement to process the queries. I need to use date functions for query selection criteria.
    for eg.
    selecting the list of employees who had joined in the last 15 days
    selecting list of employees who had joined between two dates etc.
    where Date Joined field is a Timestamp value. To extract date no DB specific function can be used.
    If I use setMonth, setYear etc.. to set params in the pstmt the query becomes complex in the above case. Can any one throw some light on how to do the above in preparedstatement or any other better alternative.
    Tx a lot

    Hi,
    I did not mean that way. I presume that there is a timestamp value (may be a date too) column in the table. Then based upon your requirement (say before 15 days) pass the value as date (or time stamp) in the query as a parameter.
    String qry = "select * from myTable where join_date <= ?";
    stmt.setDate(1,myDate); // this is where you will have to manipulate the value to suit your DB timestamp or date value; you will have compatibility issues with util.Date and sql.Date so use Calendar class to satisfy.Feel free to mail me if you need further clarifications to [email protected]
    Cheers,
    Sekar

  • Queries with parameters - how do they get migrated?

    We are evaluating this migration to move a client off of access and put them into oracle. We use APEX for other things and like it. So, we tried with 3 tables, one query and one report. The tables moved fine, but the query failed. The log showed:
    Failed to Convert View <name> unexpected end of subtree: Line 0 Column 0.
    I began removing things to determine what was causing it. I finally got it to run when I got rid of the functions like iif, int and val. I think these are causing the issue. But, I still couldn't create the view because of the parameter in the query. Access prompts the user for this value before the query is run, but how would this translate to an Oracle view? And how would the report prompt the user for this value in Apex? Does this convert over automatically?
    If I have to rewrite the queries myself, I will. If I do, will that affect importing reports like this into Apex? Any suggestions?
    Thanks, Chris

    Hi Chris,
    Thanks for the updates.
    Currently the Oracle SQL Developer Migration Workbench translator does not support the parsing of the IIF function. I believe there is a bug already logged against this & a fix will be available in a future release of the Workbench.
    You may find it useful to refer to the following threads discussing alternative handling of queries using the IIF function -
    Access Queries with "IIF" function
    msaccess parser error
    As mentioned in the above postings, one option for you is to use a CASE statement, similar to the following:
    SELECT SUM(case when Table1.Week Between 1 And Ending_Week then Table1.Sales else 0 end) TY_Sales_YTD
    FROM Table1 ;
    If you wished to use such a query to display the resulting value on an Oracle APEX page, this could be implemented as follows:
    Note: Assuming that you have migrated the database schema to Oracle & have associated your APEX workspace with that schema.
    1. Create a new blank page in your APEX application. Add a new HTML region to your page.
    2. Create a "Select List with Submit" item and in its "List of Values Query" field enter syntax similar to the following:
    select week d, week r
    from table1
    order by 1
    and set the item name to P1_END_WK. Place the item on your HTML region. This item will act as the parameter in your query.
    3. Create a "Display as Text" item and set its Source region to be of type "SQL Query". Paste the following syntax into the items' source value field:
    SELECT SUM(case when Table1.Week Between 1 And :P1_END_WK then Table1.Sales else 0 end) TY_Sales_YTD
    FROM Table1
    and set the item name to P1_SUM. Place the item on your HTML region. This query will return the result based upon the user's selection of value in the P1_END_WK select list item.
    4. Add a branch to the page, setting it to branch to itself. Basically when the user selects a value from the P1_END_WK select list, this will submit the page. The branch will redirect the page to itself & in turn update the value held in P1_SUM.
    Would this type of implementation work for your application? It's obviously just one option to consider. I hope this helps. If you have any further issues/questions regarding any of the above information or regarding other queries in your MS Access MDB file, please let me know. If you'd like me to take a look at your MDB file, please post your email address so I can contact you directly.
    Regards,
    Hilary
    Message was edited by:
    hfarrell

  • The value of sysdate function is sometimes not equal with O/S date.

    Hello, everyone.
    I administrate oracle 8i database that consists of OPS.
    The problem is that the value of sysdate function is not matched to OS date.
    It's runing commonly in equal state. but sometimes occurred, and the gap is one hour or one date.
    There are not any other logs and traces in the distination of oracle dump.
    So I can not detect what oracle event is happened on that time which the problem is occurred.
    Is there oracle event in this case?
    Could you reply to this problem?
    OS ver : HPUX 11.11
    DB ver : 8.1.7.4 OPS

    Please look into metalink note 1017965.102 for this
    You may need to change some settings in the System level to reset the Timde differential factor

  • What's wrong with this function

    What's wrong with this Function(PL/SQL) in this formaula column definition in Reports 6i
    function currdateFormula return Date is
    curr_date date;
    begin
    select to_char(sysdate, 'DD-MM-YYYY') into curr_date from dual;
    return(curr_date);
    end;
    I get the following error in compiling
    REP-1401. 'currdateformula'.Fatal PL/SQL error occured. ORA-01843 not a valid month.
    The SQL select to_char(sysdate, 'DD-MM-YYYY') from dual; worked well in SQL Plus prompt.
    I got a clean compile when i use just sysdate in the function (see below).
    function currdateFormula return Date is
    curr_date date;
    begin
    select sysdate into curr_date from dual;
    return(curr_date);
    end;
    Appreciate your help
    Raja Lakshmi

    hello,
    what you are trying to do :
    fetch the current date and return it as the result of the formula-column.
    what you are actually doing :
    fetch the current date, convert it to text, assign this text to a date-variable which causes an implicit type-conversion.
    in your case you create a date-string with the format dd-mm-yyyy. the implicit conversion then tries to convert this string back to date using the NLS settings of your session. depending on your NLS_LANG and NLS_DATE_FORMAT this might work, if your session-date-format is dd-mm-yyyy which obviously it is NOT as you get the error.
    what you should do :
    select sysdate into curr_date from dual;
    this fetches the sysdate and stores it in your date-variable. there is no type conversion needed what so ever.
    regards,
    the oracle reports team

  • Some issue with the Function Module u0093'SKWF_FIND_BY_QUERY' in a BW ECC6.0

    Hi All,
    Need some urgent help..
    Iam facing some issue with the Function Module “'SKWF_FIND_BY_QUERY' in a BW ECC6.0 system.
    As shown below, in the function module, the Table “IT_PROPERTIES_RESULT” gets populated with some values based on inputs like IT_CLASSES, IT_QUERY, and ‘L’.
    This updation of “IT_PROPERTIES_RESULT” table is happening for some of the services sent through IT_QUERY and is not getting populated for some.
      call function 'SKWF_FIND_BY_QUERY
    exporting
      CONNECTION_SPACE         =
        OBJ_TYPE                 = 'L'
      PTYPE                    =
      X_STRICT                 =
    IMPORTING
      ERROR                    =
         tables
         CLASSES                  = IT_CLASSES
         QUERIES                  = IT_QUERY
         RESULT_OBJECTS           = IT_LOIO
      PROPERTIES_REQUEST       = PROPERTIES_RESULT        = IT_PROPERTIES_RESULT.
    The values are as follows:-
    Values getting populated in IT_CLASSES – BW_LO_TRAN               Values getting populated in IT_QUERY – 1) BW_QUERY, 2) /BIC/ZSERVICE
    I would like to know whether any Standard Customizing BW transaction is present that is maintaining “IT_PROPERTIES_RESULT” table properties  and fetching through this Function Module.
    Also, suggest how this issue can be resolved
    Thanks & Regards,
    Shailesh nagar

    Thanks Suhas. That definitely helped.
    Also the following links helped.
    http://help.sap.com/saphelp_nw70/helpdata/EN/86/1c8c3e94243446e10000000a114084/frameset.htm
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Cheers,
    Preethi

  • Converting part of the string to a date and subtract with sysdate.

    HINT! In order solve this you must know how the pnr is assembled. Study this:
    650323-5510, we only need the first six characters. They inform us about when the person (car owner) was born. In this case it is 23 Mars 1965. You have to use several oracle built-in-functions to solve this. Hint! Begin by converting part of the string to a date and subtract with sysdate.
    select to_char(to_date(cast(pnr,'YYMMDDMM'))) from car_owner;
    please what am i doing wrong. i need the result to be something like this
    Hans, Rosenboll, 59,6 years.

    Hi.
    The main problem here is you have only last two digits of year. That could be the problem in a couple of years from now, when somebody born after 2k would get in to your database. For now if we ignore this problem the right solution would be :
    <code>
    SELECT months_between(trunc(SYSDATE),
    to_date('19' || substr('650323-5510',
    1,
    6),
    'YYYYMMDD')) / 12 years_old
    FROM dual
    </code>
    Suppose you are expecting the age of the car owner as a result above code will give you that. One again notice the '19' I appended.
    Best regards.

  • Need valuable guidance to make a peformance oriented query, trying to replace unions with analytical function

    Hi,
       Please find below table structure and insert scritps. Requesting for vluable help.
    create table temp2 (col1 number,col2 varchar2(10),col3 number,col4 varchar2(20));
    insert into temp2 values (1,'a',100,'vvv');
    insert into temp2 values (2,'b',200,'www'); 
    insert into temp2 values (3,'c',300,'xxx');
    insert into temp2 values (4,'d',400,'yyy');   
    insert into temp2 values (5,'e',500,'zzz');
    insert into temp2 values (6,'f',600,'aaa');
    insert into temp2 values (7,'g',700,'bbb'); 
    insert into temp2 values (8,'h',800,'ccc');
    I am trying to get same output, what we get from below UNION query with ANALYTICAL Function.
    select * from temp2 where col1 in (1,2,3,4,5)
    union
    select * from temp2 where col1 in (1,2,5,6)
    union
    select * from temp2 where col1 in (1,2,7,8);
    I am seeking help by this dummy example to understand the concept, how can we use analytical functional over UNION or OUTER JOINS.
    In my exact query, I am using same table three times adding UNION clause. here also we scan temp2 three times, so for bulky tables using 'union'  would be hampering query's performance
    It means i go with three time scans of same table that is not performance oriented. With the help of above required concept, i will try to remove UNIONs from my exact query.
    Thanks!!

    Thanks for your time BluShadow and sorry as i think i couldn't make my query clear.
    I try it again. Below there are three queries, you may see all three queries are using same tables. Difference in all three queries are just few conditions, which makes all three queries diff with each other.
    I know, u cant run below query in your database, but i think it will convey my doubt to you. I have mentioned no. of rows with each clause and total i am getting 67 rows as my output. (Reason may be first n third query's result set are the subset of Second Query dataset)
    So i want to take all common rows as well as additional rows, if present in any of the query. This is getting easliy done with UNION clause but want to have it in other way as here my same is getting scanned again n again.
    SELECT
             START_TX.FX_TRAN_ID START_FX_TRAN_ID
            ,END_TX.FX_TRAN_ID END_FX_TRAN_ID
            ,START_TX.ENTERED_DT_TS
            ,USER
            ,START_TX.TRADE_DT
            ,START_TX.DEAL_NUMBER
            ,START_TX.FX_DEAL_TYPE
            ,START_TX.ORIENTATION_BUYSELL
            ,START_TX.BASE_CCY
            ,START_TX.BASE_CCY_AMT
            ,START_TX.SECONDARY_CCY
            ,START_TX.SECONDARY_CCY_AMT
            ,START_TX.MATURITY_DT
            ,START_TX.TRADE_RT
            ,START_TX.FORWARD_PTS              
            ,START_TX.CORPORATE_PIPS           
            ,START_TX.DEAL_OWNER_INITIALS      
            ,START_TX.CORPORATE_DEALER         
            ,START_TX.PROFIT_CENTER_CD
            ,START_TX.COUNTERPARTY_NM
            ,START_TX.COUNTERPARTY_NUMBER
      FROM
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS >=  TO_DATE('20-Nov-2013 4:00:01 AM','DD-Mon-YYYY HH:MI:SS AM')) START_TX
           INNER JOIN
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS <=  TO_DATE('20-Nov-2013 4:59:59 PM','DD-Mon-YYYY HH:MI:SS AM'))  END_TX
       ON START_TX.COUNTERPARTY_NM        = END_TX.COUNTERPARTY_NM         AND
          START_TX.COUNTERPARTY_NUMBER    = END_TX.COUNTERPARTY_NUMBER     AND
          START_TX.FX_DEAL_TYPE           = END_TX.FX_DEAL_TYPE            AND
          START_TX.BASE_CCY               = END_TX.BASE_CCY                AND
          START_TX.SECONDARY_CCY          = END_TX.SECONDARY_CCY           AND
          NVL(START_TX.CORPORATE_DEALER,'nullX')=NVL(END_TX.CORPORATE_DEALER,'nullX')       AND
          START_TX.ORIENTATION_BUYSELL='B'                                 AND 
          END_TX.ORIENTATION_BUYSELL='S'                                  AND
          START_TX.FX_TRAN_ID = 1850718                                  AND
         (START_TX.BASE_CCY_AMT           = END_TX.BASE_CCY_AMT          
          OR
          START_TX.SECONDARY_CCY_AMT      = END_TX.SECONDARY_CCY_AMT)        -- 10 Rows
    UNION
    SELECT
             START_TX.FX_TRAN_ID START_FX_TRAN_ID
            ,END_TX.FX_TRAN_ID END_FX_TRAN_ID
            ,START_TX.ENTERED_DT_TS
            ,USER
            ,START_TX.TRADE_DT
            ,START_TX.DEAL_NUMBER
            ,START_TX.FX_DEAL_TYPE
            ,START_TX.ORIENTATION_BUYSELL
            ,START_TX.BASE_CCY
            ,START_TX.BASE_CCY_AMT
            ,START_TX.SECONDARY_CCY
            ,START_TX.SECONDARY_CCY_AMT
            ,START_TX.MATURITY_DT
            ,START_TX.TRADE_RT
            ,START_TX.FORWARD_PTS              
            ,START_TX.CORPORATE_PIPS           
            ,START_TX.DEAL_OWNER_INITIALS      
            ,START_TX.CORPORATE_DEALER         
            ,START_TX.PROFIT_CENTER_CD
            ,START_TX.COUNTERPARTY_NM
            ,START_TX.COUNTERPARTY_NUMBER
      FROM
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS >=  TO_DATE('20-Nov-2013 4:00:01 AM','DD-Mon-YYYY HH:MI:SS AM')) START_TX
           INNER JOIN
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS <=  TO_DATE('20-Nov-2013 4:59:59 PM','DD-Mon-YYYY HH:MI:SS AM'))  END_TX
       ON START_TX.COUNTERPARTY_NM        = END_TX.COUNTERPARTY_NM         AND
          START_TX.COUNTERPARTY_NUMBER    = END_TX.COUNTERPARTY_NUMBER     AND
          START_TX.FX_DEAL_TYPE           = END_TX.FX_DEAL_TYPE            AND
          START_TX.BASE_CCY               = END_TX.BASE_CCY                AND
          START_TX.SECONDARY_CCY          = END_TX.SECONDARY_CCY           AND
          NVL(START_TX.CORPORATE_DEALER,'nullX')=NVL(END_TX.CORPORATE_DEALER,'nullX')  AND
          START_TX.FX_TRAN_ID = 1850718                                  AND
          START_TX.ORIENTATION_BUYSELL='B'                                 AND 
          END_TX.ORIENTATION_BUYSELL='S'                        --                                   67 Rows
    UNION 
    SELECT
             START_TX.FX_TRAN_ID START_FX_TRAN_ID
            ,END_TX.FX_TRAN_ID END_FX_TRAN_ID
            ,START_TX.ENTERED_DT_TS
            ,USER
            ,START_TX.TRADE_DT
            ,START_TX.DEAL_NUMBER
            ,START_TX.FX_DEAL_TYPE
            ,START_TX.ORIENTATION_BUYSELL
            ,START_TX.BASE_CCY
            ,START_TX.BASE_CCY_AMT
            ,START_TX.SECONDARY_CCY
            ,START_TX.SECONDARY_CCY_AMT
            ,START_TX.MATURITY_DT
            ,START_TX.TRADE_RT
            ,START_TX.FORWARD_PTS              
            ,START_TX.CORPORATE_PIPS           
            ,START_TX.DEAL_OWNER_INITIALS      
            ,START_TX.CORPORATE_DEALER         
            ,START_TX.PROFIT_CENTER_CD
            ,START_TX.COUNTERPARTY_NM
            ,START_TX.COUNTERPARTY_NUMBER
      FROM
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS >=  TO_DATE('20-Nov-2013 4:00:01 AM','DD-Mon-YYYY HH:MI:SS AM')) START_TX
           INNER JOIN
          (SELECT * FROM FX_TRANSACTIONS WHERE GMT_CONV_ENTERED_DT_TS <=  TO_DATE('20-Nov-2013 4:59:59 PM','DD-Mon-YYYY HH:MI:SS AM'))  END_TX
       ON START_TX.COUNTERPARTY_NM        = END_TX.COUNTERPARTY_NM         AND
          START_TX.COUNTERPARTY_NUMBER    = END_TX.COUNTERPARTY_NUMBER     AND
          START_TX.FX_DEAL_TYPE           = END_TX.FX_DEAL_TYPE            AND
          START_TX.BASE_CCY               = END_TX.BASE_CCY                AND
          START_TX.SECONDARY_CCY          = END_TX.SECONDARY_CCY           AND
          NVL(START_TX.CORPORATE_DEALER,'nullX')=NVL(END_TX.CORPORATE_DEALER,'nullX') AND
          START_TX.ORIENTATION_BUYSELL='B'                                 AND 
          END_TX.ORIENTATION_BUYSELL='S'                                   AND
          START_TX.FX_TRAN_ID = 1850718                                  AND
            END_TX.BASE_CCY_AMT BETWEEN (START_TX.BASE_CCY_AMT - (START_TX.BASE_CCY_AMT * :PERC_DEV/100)) AND (START_TX.BASE_CCY_AMT + (START_TX.BASE_CCY_AMT * :PERC_DEV/100))        
            OR
            END_TX.SECONDARY_CCY_AMT BETWEEN (START_TX.SECONDARY_CCY_AMT - (START_TX.SECONDARY_CCY_AMT*:PERC_DEV/100) ) AND (START_TX.SECONDARY_CCY_AMT + (START_TX.SECONDARY_CCY_AMT*:PERC_DEV/100))
        );                                                       ---                              10 Rows

  • FI/CO's Queries and their Functions

    Hi all,
    I need to note down all queries that belong to "FI/CO Application component" with their functions.
    in sap help BI Content, they just list the series of queries but lack of the information about their functions. So don't need to give me these link again.
    You can give me some documents that you have through my email [email protected]
    Or give me the links that you have
    Or can write down what you have known about some queries
    Thank U very much and points will be given for the valuable answers.
    Regards,
    Chuong Hoang

    It seem a hard question

  • OS and databas time setting with sysdate value

    Hi Experts:
    Oracle claims “SYSTIMESTAMP returns the system date, including fractional seconds and time zone, of the system on which the database resides. The return type is TIMESTAMP WITH TIME ZONE.”
    Last week on this site, I got the confirmation that systimestamp/sysdate function picks up current OS (Operating System) time only.
    Here, I have some question for this point.
    If OS and database time zone were set in different time zone.
    What will be happen? for sysdate valur in codes?
    also Oracle have a command to changes DB time zone setting as
    ALTER database SET TIME_ZONE =<Timszoen>
    does this command change OS level time zone setting?
    Under this condition, if there are different time zone setting between OS and database level.
    example as: LOCAL DATABASE OS timezone as PST BUT database as EST time zone.
    what kind of sysdate value will be return from oracle sysdate function? PST time value or EST time value.
    we have some issue in Linux and window platform with 10G database
    Thanks
    JIm
    Edited by: user589812 on Jan 3, 2011 12:51 PM

    ALTER database SET TIME_ZONE =<Timszoen>
    does this command change OS level time zone setting?
    No it does not. Its for changing the time zone columns within the database. It will not work if you have tables with LOCAL TIME ZONE.
    Whatever timezone your OS has, database will show the same.
    HTH----

  • Formating sysdate function output

    Hi Gurus,
    I'm doing a POC with BPEL and XMLPublisher and need the current date in a rtf template. I found the function <?xdofx:sysdate()?>, this output is not in the correct format and I need to reformat the sysdate output.
    I also found the information about date formatting, but all this information refer to the field name. How could I reformat the sysdate function output?
    Thanks in advance.

    Hi mcarlosro,
    I hope you will be using form field method to place the sysdate....
    Do one thing ...in form field choose the type as a date...or choose current date.... if you r choosing current date.. hen no need to give any code... but i will suggest you to go with this code whatever you are having for this field........ and choose type as a date and type format.. whatever you want...... you can type it there....
    I hope it will help you.....
    Regards
    Ravi

  • Error while replacing IF statements with DECODE function in procedure

    Hi All,
    I have created a procedure which has nested IF statements. Now I want to replace the IF statements with DECODE functions to improve performance.
    Procedure:
    IF (var_int_sev = '0')
    THEN
    var_sev := '2';
    ELSE
    SELECT sev
    INTO var_int_sev
    FROM errorconfig
    WHERE errorcode = var_errorcode;
    var_sev := var_int_sev;
    END IF;
    I converted the above IF statement into DECODE function as mentioned below:
    var_Sev := DECODE(var_int_sev,0,2,SELECT severity FROM errorconfig WHERE errorcode=var_ErrorCode)
    But it throws below error at the select statement used inside DECODE.
    Error(58,51): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternativ
    Can someone help me in converting the IF to DECODE in the above case. Also how can we use a select statement inside decode.

    instead of trying to rewrite all your code and hoping that the performance will be better, it's a better option to investigate and find out which part of your application is slow
    read this:
    When your query takes too long ...

  • How to find the number of data items in a file written with ArryToFile function?

    I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
    If you are young work to Learn, not to earn.
    Solved!
    Go to Solution.

    What about:
    OpenFile ( your file );
    cnt = 0;
    while ((br = ReadLine ( ... )) != -2) {
    if (br == -1) {
    // I/O error: handle it!
    break;
    cnt++;
    CloseFile ( ... );
    There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
    After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to querie with bind variable in findMode?

    Hallo,
    is it possible to use a querie with bind variable in findMode? And when how is it possible to initialize the bind variable?
    Any help is appreciated.

    Hi,
    bind variables can be linked from teh ADF binding to e.g. a managed bean, the sessionScope or other binding attributes via EL. So when you go into findMode and execute the query, the EL will grab the bindVariable values automatically.
    Frank

Maybe you are looking for

  • SecondaryMultiKeyCreator bug still there?

    Hi, I am using the java api for the Berkeley DB, and I ran into trouble using a BTREE to secondary index a RECNO primary database. After searching the forum, it seems like this was fixed here: http://forums.oracle.com/forums/thread.jspa;jsessionid=8d

  • Acrobat Form Fill Fields - Can you specify a font?

    I am using the new feature of InDesign CS6 that allows creation of form fields for PDFs. After exporting the page to PDF via the interactive setup dialog [command+E 'Adobe PDF (interactive)] I'll inspect the finished PDF in Acrobat 9. Everything look

  • On startup, FF loads 2 tabs - one is my default, the other a FF info window.

    I turn on my desktop and click my Firefox (FF) icon. When FF loads to the screen, two tabs appear. - one with some FF page that includes a FF video it says something like "Hurray: your browser is up to date." - the other is my default page The result

  • How to stop this file tshelpererror.log HELP!!

    every start up this file shows up in my documents i try and delete but it recreates after every restart i have got to stop this! macpro 2.7 8 gig ram all updated latest software

  • Intallation of 11g in Brand New server

    Hi Gurus, This is the first time i am installing the 11g on Brand new Windows 2008 64 bit server. I need help and info what are the prerequist i need to have and start the OBIEE 11g installation on the Windows 2008 64 bit server. It is brand new serv