date code sql

Hi all
I have a date like this
----------------------
ENDDATE = NOVEMBER 30, 12 '
STARTDATE = NOVEMBER 28, 12 '
------------------------
If I say
SELECT ENDDATE-STARTDATE FROM DUAL;
It should show 2...
Please give me the way...

Try this...

with xx as (
    select '28-NOV-12' sd, '30-NOV-12' ed from dual
)
select to_date(ed,'dd-MON-yy') - to_date(sd,'dd-MON-yy') from xx;

gives

o/p = 2

Because you gave the ACE String entries, we have converted all first it to a format of valid Date and when we have taken together we get the number of days.

Hope that helps,
Vanessa B.

Published by: Vanessa B 30 November 2012 13:08
-added o/p

Tags: Database

Similar Questions

  • Loading data to SQL server for the Oracle database

    I want to create a table in oracle db table in sql server. Table is huge that he has obtained the documents 97,456,789.
    I created the link (HS) db in the oracle database that points to the sql server. I choose this oracle db on the link table.

    Select * from 'dbo '. "T1@dblink;

    I shot below to create the table.
    create table t2 nologging parallel (degree = 3) as select * from 'dbo '. "T1@dblink;
    and its taking a long time... but its operation...

    is there any other method to do this and and fill the table in oracle db faster.

    Please notify. Thank you.

    vhiware wrote:
    create table t2 nologging parallel (degree = 3) as select * from 'dbo '. "T1@dblink;
    and its taking a long time... but its operation...

    I doubt that parallel processing will be used because it is unique to Oracle (using rowid varies in general) and not SQL-Server.

    is there any other method to do this and and fill the table in oracle db faster.

    Part of the performance overhead is to pull that data from SQL Server to Oracle in the whole of the liaison network between them. This can be accelerated by compressing the data first - and who then transfer them over the network.

    For example: using + bcp + to export the data in the SQL Server box to a CSV file, compress/zip file, scp/sftp file Oracle and then to unzip there. In parallel and direct treatment of load can now be done using SQL * Loader to load the CSV file into Oracle.

    If it is a basic Linux/Unix system, the process of decompression/unzip can be run in parallel with the SQL * process Loader by creating a pipe between the two – where the decompression process writes data uncompressed in the pipe and SQL * Loader reads and loads the data that is available through the pipe.

    Otherwise you are PQ own transformation. Assume that the data is date varies. You can create a procedure on Oracle that looks like this:
    {code}
    create or replace procedure as copyday (day) is
    Start
    Insert / * + append * / into local_tab select * from remote_tab@remotedb where col_day = day;
    -Add logging info, validation, etc.
    end;
    {code}

    You can now start 10 or more of these different days and run it in the background using DBMS_JOB.

  • Data code

    Hello

    Just signed up and I hope I post this question in the right place.

    I just got a HDR-CX300. Of course, I'll want to transfer the video files on my computer. I need to have the date/time on the video code after I write it on a disk. My question is, will do PMB for me or I'll lose the data code during the transfer?
    I heard that PMB does not transfer them with video, only with pictures.

    If it isn't, recommendations on other software that will give me the time code on the video?

    Thanks in advance

    Jack

    ETA: not sure if it's important, but I am running WinXP SP3.

    Visit this link

    https://us.en.KB.Sony.com/app/answers/detail/A_ID/39790

    .

  • Problem of lens date code

    Hi all! I hope someone could help me in the determination of the date of that my kit lens was manufactured. I "googled" all morning & searched these forums & others, without success. I bought my kit of 6 d 24-105 mm Canon last March 2014 & saved the boxes and all the paperwork, but see only a serial number of 8 digits on the lens & paperwork. The white box, it came in had the same numbers but this > (21) at the front of it. It makes me crazy! Am I missing something?

    It took some time for Canon to 'understand', but some photographers obsess how old or new is a lens. Some will measure where they won't buy a used is more than a couple of years. Thus, they abolished put on their lenses date codes maybe 2 years ago or not.

    Unless it has access to internal files canons that show serial number for each lens ranges as well as the dates they are made, there is no way to determine when a "new" lens was manufactured.

    And, for what it's worth, when I got to the EF-S-objectives, I remember seeing a code on any of them. Only Ls had codes of date as far as I know. My EF 85 F1, 8 2 years ago have a date code, either.

    And I don't like not my 80-200 f2.8L "magic drain" had been built in 93 rather 94 or when? Not a bit! It produces great images for a fraction of what a new 70-200 f2.8L brand I would have cost 3 years ago...

  • Loading data from SQL to Essbase table

    Hello

    I'm loading data from SQL to Essbase table by using a rules file. Number of rows in the source table is 7 million. I use the SUNOPSIS MEMORY ENGINE as area transit, LKM SQL for SQL and SQL IKM for Hyperion Essbase (DATA).

    Question:

    1 can I not use any other LKM as MSSQL for MSSQL (PCBS) to load data to the staging instead of LKM SQL for SQL? What I have to change the transit area then? Loading data using LKM SQL for SQL seems quite slow.

    2 it is mandatory to use LKM SQL for SQL, can someone please tell me what I can change to make this quick support parameters?

    3. is it compulsory to use the SUNOPSIS MEMORY engine loading data from SQL server to Essbase?

    Thank you...

    (1) Yes, I highly recommend watching using a KM which uses native as database technology these will usually be more efficient than the generic (like LKM SQL for SQL) KM especially when large volumes of data are involved. Your staging will change depends on where you organize data for example if you are using a SQL server specific KM as - MSSQL for MSSQL (PCBS) - you must have a lay-by available on a MSSQL database and have access to the utility of PCBS.

    (2) it is not mandatory to use this KM you can use a KMs supported by your database technology

    (3) it is absolutely not obligatory to use the SUNOPSIS MEMORY engine. This should only be used when you have relatively small amounts of data, as well as all the processes in memory, or in the case where you have no other relational technology to perform the staging on. However, in your case to use wherever you are processesing these large volumes of data you should be staged on a physical such as SQL Server or Oracle database if they are available.

  • Loads of parallel data through SQL connect and replace existing data

    I'm doing a load of multiple data through SQL Connect using the following statement.  Just try to put in place a .bat file to automate the process but not sure that whenever it executes this statement adds data to existing or replaces the data? I tried to write an override for this but it works for instructions which contain the import section.

    Import of database data App.DB connect as username identified by password

    with the help of several rules_file, rul1, rul2, rul3

    load_buffer_block starting with buffer_id 10 on error write to 'C:\\dataload.err ';

    We can add spec commit buffer such as "replace all data ', 'create group', 'Add' to this import statement? The default declaration overrides the value whenever the data is loaded?

    Thanks in advance!

    you have an option in the rules file "Overwrite out of values."

    rulefile > setting dataload > loading values

  • view the data in SQL

    I was able to use ASP to retrieve data from SQL database by using something like the one below:

    SQL = "SELECT PageName",

    SQL = SQL & "CONVERT (NUMERIC (6,2), AVG(Rating * 1.00))" AVERAGE ".

    SQL = SQL & 'COUNT (Rating) AS Total',

    SQL = SQL & "SUM(CASE WHEN Rating = 1 THEN 1 ELSE 0 END) AS [Star1Total]"

    SQL = SQL & "SUM(CASE WHEN Rating = 2 THEN 1 ELSE 0 END) AS [Star2Total]"

    SQL = SQL & "SUM(CASE WHEN Rating = 3 THEN 1 ELSE 0 END) AS [Star3Total]"

    SQL = SQL & "SUM(CASE WHEN Rating = 4 THEN 1 ELSE 0 END) AS [Star4Total]"

    SQL = SQL & "SUM(CASE WHEN Rating = 5 THEN 1 ELSE 0 END) AS [Star5Total].

    SQL = SQL & "FROM [SDBI]. [dbo]. [GnieRatePage] "

    SQL = SQL & "GROUP BY PageName".

    SQL = SQL & "ORDER BY PageName".

    I then post on the help page:

    Response.Write ("PageName") Recordset

    What I need, it of to transmit these data to Flash and let Flash to view the coast. How to do by way of ASP?

    Thank you

    I don't use the proper syntax for writing couples variable/value with asp, but, if this is the case, use:

    var myTextLoader:URLLoader = new URLLoader();

    myTextLoader.dataFormat = pouvez;

    myTextLoader.addEventListener (Event.COMPLETE, onLoaded);

    function onLoaded(e:Event):void

    {

    for {(var s:String in e.target.data)

    trace (s, e.Target.Data [s]);

    }

    myTextLoader.load (new URLRequest ("read_page_rating.asp"));

  • data via sql dev store

    Hello
    I've given cluster and can store files and it is clustering ID in the new database using the ODM. I group these data via SQL dev. Oracle again but I'm not for any folder for the storage of cluster ID. How do I? can I put something in response or detail node?

    Hi Nasiri,
    In your description, you have only the Cluster node as entry in the node to apply it. You should also connect a node type of source of data as well. Just to get this to work, why not connect the source of input data to your Cluster node to the node to apply it. If the node to apply it should have 2 inputs, a node of type of data source, but also a model node.
    Thank you, Mark

  • Logic to find particular weekdays after a given date, using SQL

    Hello Experts,

    Version: Oracle 11G

    Could you please help me with logic to find a day of special week after a date in SQL
    For example, I need to know the first Friday after today's date.

    Thank you for your help.

    I hope that under query will be useful for you.

    SELECT NEXT_DAY(SYSDATE,'FRIDAY') "NEXT DAY"
    FROM DUAL
    
    Output:
    
            NEXT DAY
         2/24/2012 12:06:48 PM
    
  • How only migrate data between SQL Server 2008 Oracle 11?

    According to our requirement, we only have to migrate data from a SQL Server database to an existence
    Oracle database user.
    (1) I tried to do with the wizard of Migration SQL Developer 3.0.04, but find a problem.
    My SQL Server database name is SCDS41P2 and my Oracle database user name is CDS41P2;
    When I used SQL Developer move offline data by the Migration Wizard, I found all the oracle user
    name in movedata files who obtained by running the Migration Wizard
    is dbo_SCDS41P2. If the Oracle user name is not the same as my Oracle username existed.
    the data cannot be moved to my user Oracle existed when I run oracle_ctl.bat in the command line window.
    So I had to change the Oracle username in all the movedata files, but it is difficult to change because there are a lot of tables in
    databases. So could you please tell me how to get the movedata files which is the name of user oracle in them my
    WHEREAS Oracle user name?

    (2) I also tried to use the "copy to Oracle" to copy the data to SQL Server database tables
    the user database was Oracle. When you click on 'copy to Oracle', I selected the option 'Include data' and 'replace '.
    But I found some tables cannot be copied, the error info is as below:
    SPSSCMOR_CONTROLTABLE table failed. Message: ORA-00955: name is already used by an existing object

    Could you please tell me how to deal with this kind of mistake?

    Thank you!

    Published by: 870587 on July 6, 2011 02:57

    Hello
    After following with development the following should work too-

    1 use the migration option to capture and convert the SQL * database server
    2. go in SQL * Developer and remove the converted model.
    3. click on the captured model and choose 'convert '.
    4. click Next and you should get a screen with 2 options - "Data Type Mapping" and "Object Naming.
    5. choose "Object Naming" and scroll down the list until you see the name of the user who will be transformed. For example, in my test, I got the names scott_test and dbo_test - where the owners are 'scott' and 'dba' and 'test' was the name of the database.
    6. change the name of oner_database to just owner - scott_test to scott
    7 complete the conversion process and the owners must be created without the name of the database.
    8. you should now be able to generate the SQL * scripts of charger with only the name of the owner in the CTL files.

    Please try this and let us know if it works for you.

    Kind regards
    Mike

  • strange problem in shape after the transfer of data from sql server2000

    I successfully transferred data from sql server 2000 to oracle 10 g 2 for my forms application development...

    Now I have when I create a sample form using this data block and run I get an error something like

    1. cannot run the query... don't know why... :(

    2. when I query my table in select * from tblmaterial all values are displayed

    but

    When I run select tblmaterial matid

    He throws me an error like invalid identifier... when the column is actually present in the table...

    its really make me go nuts

    Hello
    You may be similar to this problem...

    SQL> CREATE TABLE "AMD"
      2  ("TID" NUMBER,
      3   "Tname" VARCHAR2(10),
      4   "TLOC" VARCHAR2(10));
    
    SQL> INSERT INTO "AMD"
      2  VALUES (1,'TEST','L1');
    
    SQL> SELECT * FROM "AMD";
    
           TID Tname      TLOC
    ---------- ---------- ----------
             1 TEST       L1
    
    SQL> SELECT Tname
      2  FROM "AMD";
    SELECT Tname
           *
    ERROR at line 1:
    ORA-00904: "TNAME": invalid identifier
    
    SQL> SELECT "Tname"
      2  FROM "AMD";
    
    Tname
    ----------
    TEST
    
    SQL> 
    

    If so, while creating the table remove the double quotes in column names and the name of the table.

    -Clément

  • How to view clob data using sql

    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    user562223 wrote:
    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    Usually a to_char (CLOBDFIELD) circled

    HTH,

    FJFranken

  • Date error sql Java

    I use mysql jdbc driver 5.0.6 connection mysql 5 data source. The behavior for reading the columns date containing the 0000-00-00 differs from the connector 3.0.x series (more info on zeroDateTimeBehavior). When I try to read a column that contains the 0000-00-00, an exception to date java sql is thrown (default behavior for 5.0.6). Documentation MySql JDBC said zeroDateTimeBehavior = convertToNull property must be added to the connection string for the same behavior that the series 3.0.x. I added the given property in the connection string field in CF administrator but always get java.sql.SQLException: value ' 0000-00-00' cannot be represented as a java.sql.Date error. Anyone has the same problem?

    I added the property at the end of the url jdbc instead of the connection string field and it works very well.

  • Insert data to DB avoiding code SQL injection

    Hello

    I used the following method to insert data to DB

    (1) I had a 'DB-Helper class' and that I have the following function

    void dbHelper::createOrUpdateRecord(const QString Insertquery) {
        QSqlDatabase database = QSqlDatabase::database();
        QSqlQuery query(database);
        query.prepare(Insertquery);
    
        if (query.exec()) {
           alert(tr("Record created"));
        } else {
            const QSqlError error = query.lastError();
            alert(tr("Create record error: %1").arg(error.text()));
        }
        database.close();
    }
    

    (2) where I want to insert data to DB I created the query to insert the string and pass the string as a parameter to the function above

    createOrUpdateQuery =("INSERT INTO tutorial (title,titleArabic,shortDesc,shortDescArabic,description,descriptionArabic,externalLink,tutorialId,isActive) VALUES(\""
    + map.value("title").toString() + "\", \""
    + map.value("titleArabic").toString() + "\",\""
    + map.value("shortDesc").toString() + "\",\""
    + map.value("shortDescArabic").toString() + "\",\""
    + map.value("description").toString() + "\",\""
    + map.value("descriptionArabic").toString() + "\",\""
    + map.value("externalLink").toString() + "\",\""
    + map.value("tutorialId").toString() + "\",\""
    + map.value("isActive").toString() + "\" )");
            }
    
    dbHelp.createOrUpdateRecord(createOrUpdateQuery);
    

    I read that this method also causes Sql Injection.And using this method we can insert only string as data values.

    My question is:

    I read that the best method to insert data using "bind." So, if Iam trying to use the 'bind' method then I won't be able to make integration to db as a generic function. Is this possible. Please help me to do the insertion of data in db as a generic fn

    I didn't test this, but it might give you an idea:

    sql = "INSERT INTO tutorial (title,titleArabic,shortDesc,shortDescArabic,description,descriptionArabic,externalLink,tutorialId,isActive) "
    + "VALUES(:title, :titleArabic, :shortDesc, :shortDescArabic, :description, :descriptionArabic, :externalLink, :tutorialId, :isActive)"
    
    createOrUpdateRecord(sql, map);
    
    void dbHelper::createOrUpdateRecord(const QString Insertquery, QMap paramMap {
        QSqlDatabase database = QSqlDatabase::database();
        QSqlQuery query(database);
        query.prepare(Insertquery);
    
        QMap		   
  • SECURITY OF DATA for sql queries

    Hi, I'm new to APex.

    I use APex 4.2, I want to how to ensure the security of the data in the reports.

    When I write the Sql query in interactive report, it is easy for the end user to hack and see the code.

    So is there an alternative way to encrypt the code, so that no one can see the code except me.


    Thank you
    Nihar Narla

    How comes to the security of the data? but this has been discussed on the forum in the past, please search the forum before posting a new question.

    Also look at this feature request https://apex.oracle.com/pls/apex/f?p=55447:4 research of Security Code

Maybe you are looking for

  • problem in installing Skype

    Please help me I have a problem to install Skype on my desktop, I use windows 7 ultimate.

  • How do I close the Roaming

    Hello I want to stop roaming on my Droid Razr. Thanks in advance.

  • Unable to activate the Windows 98 operating system.

    NEED TO ACTIVATE a GATEWAY WINDOWS 98 os I have a vintage computer laptop gateway 1998, and I need to reload the operating system.  Microsoft won't activate and gateway can restore disks not power gateway.  What should I do?  is there a product key g

  • Without sound helmet but can hear microphone

    So my headphones won't play all the audio sounds, but I can still hear that picks up my microphone (like my voice). Kinda bugging me because I tried to listen to music on YouTube, I have tried everything as set as a device by default, is gone in the

  • How to configure the push notification in BB10?

    Hi all I want to do an application based on the concept of send and receive push notification. I'm having difficulties in your Setup. can anyone describe the steps to configure. Thanks in advance.