Probelm regarding timing when insert a record

hello all,
i want to insert a time with date in my one of my column
how can i do that
can i use sysdate or to_date(sysdate)
right now it shows me 12.0. in my timing .
any help appriciated .

Just to further demonstrate what already had been said:
/* using standard NLS date setting without time component */
SQL> select sysdate, to_date(sysdate) from dual;
SYSDATE   TO_DATE(S
08-FEB-08 08-FEB-08
/* printing the time component */
SQL> select to_char(sysdate,'HH24:MI:SS'), to_char(to_date(sysdate),'HH24:MI:SS') from dual;
TO_CHAR( TO_CHAR(
11:01:29 00:00:00
/* Include printing the time component in the default date format mask*/
SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
Session altered.
/* See how the default format mask influences the output */
SQL> select sysdate, to_date(sysdate) from dual;
SYSDATE              TO_DATE(SYSDATE)
08-FEB-2008 11:02:08 08-FEB-2008 11:02:08
SQL>

Similar Messages

  • Can I run a Unix shell when insert some record on a specific table?

    Can I run a Unix shell when insert some record on a specific table?
    I need to run a Unix shell when a record be insert on a table. Is there a way in order to do that?
    THanks,
    Carlos.

    1. Make a backup of the extproc.c file in the c:\orant\rdbms80\extproc
    directory.
    2. Create a file called extern.c in the c:\orant\rdbms80\extproc directory.
    The "extern.c" file :
    #include <oci.h>
    #define NullValue -1
    #include<stdio.h>
    #include<string.h>
    long __declspec(dllexport) OutputString(context ,
                             path , path_ind ,
                             message , message_ind,
                             filemode , filemode_ind ,
                             len , len_ind )
    char *path;
    char *message; 
    char *filemode;
    int len;
    OCIExtProcContext *context;
    short path_ind;
    short message_ind;
    short filemode_ind;
    short len_ind;
    FILE *file_handle;
    int i ;
    char str[3];
    int value;
    /* Check whether any parameter passing is null */
    if (path_ind == OCI_IND_NULL || message_ind == OCI_IND_NULL ||
    filemode_ind == OCI_IND_NULL || len_ind == OCI_IND_NULL ) {
    text initial_msg = (text )"One of the Parameters Has a Null Value!!! ";
    text *error_msg;
    /* Allocate space for the error message text, and set it up.
    We do not have to free this memory - PL/SQL will do that automatically. */
    error_msg = OCIExtProcAllocCallMemory(context,
    strlen(path) + strlen(initial_msg) + 1);
    strcpy((char *)error_msg, (char *)initial_msg);
    /*strcat((char *)error_msg, path); */
    OCIExtProcRaiseExcpWithMsg(context, 20001, error_msg, 0);
    /* OCIExtProcRaiseExcp(context, 6502); */
    return 0;
    /* Open the file for writing. */
    file_handle = fopen(path, filemode);
    /* Check for success. If not, raise an error. */
    if (!file_handle) {
    text initial_msg = (text )"Cannot Create file ";
    text *error_msg ;
    /* Allocate space for the error message text, and set it up.
    We do not have to free this memory - PL/SQL will do that automatically. */
    error_msg = OCIExtProcAllocCallMemory(context,
    strlen(path) + strlen(initial_msg) + 1);
    strcpy((char *)error_msg, (char *)initial_msg);
    strcat((char *)error_msg, path);
    OCIExtProcRaiseExcpWithMsg(context, 20001, error_msg, 0);
    return 0;
    i = 0;
    while (i < len)
    /* Read the hexadecimal value(1). */
    str[0] = message;
         i++;
    /* Read the hexadecimal value(2). */
    str[1] = message[i];
    /* Convert the first byte to the binary value. */
    if (str[0] > 64 && str[0] < 71)
    str[0] = str[0] - 55;
    else
    str[0] = str[0] - 48;
    /* Convert the second byte to the binary value. */
    if (str[1] > 64 && str[1] < 71)
    str[1] = str[1] - 55;
    else
    str[1] = str[1] - 48;
    /* Convert the hex value to binary (first & second byte). */
    value = str[0] * 16 + str[1];
    /* Write the binary data to the binary file. */
    fprintf(file_handle,"%c",value);
              i++;
    /* Output the string followed by a newline. */
    /* fwrite(message,len,1,file_handle); */
    /* Close the file. */
    fclose(file_handle);
    3. Use the make.bat available in the c:\orant\rdbms80\extproc directory. You
    need to run vcvars32.bat file before running this batch file. This will
    create a dll file.
    4. Configure the tnsnames.ora and the listener.ora files.
    The tnsnames.ora should contain the following entries.
    extproc_connection_data.world =
    (DESCRIPTION =
    (ADDRESS =
    (PROTOCOL = IPC)
    (KEY = ORCL)
    (CONNECT_DATA = (SID = extproc)
    The listener.ora should contain the following entries.
    # P:\ORANT\NET80\ADMIN\LISTENER.ORA Configuration File:p:\orant\net80\admin\listener.ora
    # Generated by Oracle Net8 Assistant
    LISTENER8 =
    (ADDRESS = (PROTOCOL = TCP)(HOST = winnt_nsc)(PORT = 1521))
    SID_LIST_LISTENER8=
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = winnt_nsc)
    (SID_NAME = ORCL)
    (SID_DESC =
    (SID_NAME = extproc)
    (PROGRAM = extproc)
    5. Login from sqlplus and issue the following statements.
    create library externProcedures as 'C:\orant\RDBMS80\EXTPROC\extern.dll';
    Create or replace PROCEDURE OutputString(
    p_Path IN VARCHAR2,
    p_Message IN VARCHAR2,
    p_mode in VARCHAR2,
    p_NumLines IN BINARY_INTEGER) AS EXTERNAL
    LIBRARY externProcedures
    NAME "OutputString"
    With context
    PARAMETERS (CONTEXT,
    p_Path STRING,
    p_path INDICATOR,
    p_Message STRING,
    p_message INDICATOR,
    p_mode STRING,
    p_mode INDICATOR,
    p_NumLines INT,
    p_numlines INDICATOR);
    This is the pl/sql block used to write the contents of the BLOB into a file.
    Set serveroutput on before running it.
    SQL> desc lob_tab;
    Name Null? Type
    C1 NUMBER
    C2 BLOB
    lob_tab is the table which contains the blob data.
    declare
    i1 blob;
    len number;
    my_vr raw(10000);
    i2 number;
    i3 number := 10000;
    begin
    -- get the blob locator
    SELECT c2 INTO i1 FROM lob_tab WHERE c1 = 2;
    -- find the length of the blob column
    len := DBMS_LOB.GETLENGTH(i1);
    dbms_output.put_line('Length of the Column : ' || to_char(len));
    -- Read 10000 bytes at a time
    i2 := 1;
    if len < 10000 then
    -- If the col length is < 10000
    DBMS_LOB.READ(i1,len,i2,my_vr);
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'wb',2*len);
    -- You have to convert the data to rawtohex format. Directly sending the buffer
    -- data will not work
    -- That is the reason why we are sending the length as the double the size of the data read
    dbms_output.put_line('Read ' || to_char(len) || 'Bytes');
    else
    -- If the col length is > 10000
    DBMS_LOB.READ(i1,i3,i2,my_vr);
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'wb',2*i3);
    dbms_output.put_line('Read ' || to_char(i3) || ' Bytes ');
    end if;
    i2 := i2 + 10000;
    while (i2 < len ) loop
    -- loop till entire data is fetched
    DBMS_LOB.READ(i1,i3,i2,my_vr);
    dbms_output.put_line('Read ' || to_char(i3+i2-1) || ' Bytes ');
    outputstring('p:\bfiles\ravi.bmp',rawtohex(my_vr),'ab',2*i3);
    i2 := i2 + 10000 ;
    end loop;
    end;

  • Urgent help : how when insert new record navigation off

    hi master
    Sir
    when i insert new record by mistake press down key and curser move to next record and my need is
    When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
    Thanking you
    aamir

    If u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
    key-next-item trigger of that particular item.
    ie IN key-next-item
    null;
    Hope this is what you wanted.

  • ORA-01654 error message when inserting multiple records

    Hello all,
    I have a Test table with attributes TEST_ID, TEST_NAME, TEST_DATE, STATUS, and want to insert multiple records into this table based on user input form. If user select a value from the drop down list, and the number of records to insert into the Test table, the application should insert that many into the Test table with the same TEST_DATE, STATUS, but TEST_NAME should be the drop down list value + i (1....the number of inserted records). I manually created the form, and wrote a sql for the process.
    For example if the user select MUSIC, 3 then data should look like this
    TEST_ID TEST_NAME TEST_DATE STATUS
    1 MUSIC1 04/06/2010 Y
    2 MUSIC2 04/06/2010 Y
    3 MUSIC3 04/06/2010 Y
    I got the error ORA-01654: unable to extend index TEST_TOOL_ID.TEST_PK by 128 in table space FLOW_13120862905990037739.
    The process query
    DECLARE IDTEST NUMBER := 1;
    BEGIN
    WHILE (IDTEST < :P1_COUNT + 1) LOOP
    INSERT INTO TEST ( TEST_NAME, TEST_DATE, STATUS )
    VALUES ((:P1_TEST_NAME || ' ' ||IDTEST), SYSDATE, 'Y');
    END LOOP;
    END;
    Here is the link to this application
    http://apex.oracle.com/pls/apex/f?p=4000:1:3173416575551580::NO:RP:FB_FLOW_ID,F4000_P1_FLOW:32828,32828
    Any help would be appreciated.
    Thanks,
    Karoline

    This is the output i get when i change the getMessage with printStackTrace.
    String getMessage() replaced with printStackTrace:
    G:\studies\Chapter11\MakeDB.java:33: 'void' type not allowed here
                   System.out.println("Could not drop primary key on UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:43: 'void' type not allowed here
                   System.out.println("Could not drop UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:54: 'void' type not allowed here
                   System.out.println("Could not drop Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:64: 'void' type not allowed here
                   System.out.println("Could not drop Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:83: 'void' type not allowed here
                   System.out.println("Exception creating Stocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:102: 'void' type not allowed here
                   System.out.println("Exception creating Users table: "
    ^
    G:\studies\Chapter11\MakeDB.java:119: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks table: "
    ^
    G:\studies\Chapter11\MakeDB.java:133: 'void' type not allowed here
                   System.out.println("Exception creating UserStocks index: "
    ^
    G:\studies\Chapter11\MakeDB.java:159: 'void' type not allowed here
                   System.out.println("Exception inserting user: "
    ^
    9 errors
    Tool completed with exit code 1

  • Error when inserting a Record Form

    Hi,
    I'm very green with web development and am just trying my hand at PHP. I've set up a database with Mysql and phpmyadmin  those are working fine.
    I had inserted a record form using the record insertion form wizard and it worked just fine. I deleted it because I wanted some different information and
    now every time I try to insert a new form this error message comes up.
    While executing onClick in ServerObject-InsRecPHP.htm, the following JavaScript error(s) occurred:
    At line 5694 of file 'C:\Program Files (x86)Adobe\Adobe Dreamweaver CS5\Configuration\Shared\Common\Scripts\dwscriptsExtData.js':this.node has no
    properties.
    I've gone to look at the file but I'm not sure how to tell if the properties are working or not. I've also googled this problem but haven't found someone with exactly my dilemma. Any help will be greatly appreciated!
    Thank you for your time

    Troubleshooting JavaScript errors in Dreamweaver
    http://kb2.adobe.com/cps/405/kb405604.html
    Try #4 and #12 first.

  • Meeting trouble when inserting a record into dababase using JDBC.

    Hi, everyone!
    If I want to insert a record in a table of a database, but I
    do not know whether there is already a primary key existing in
    the database (I mean the value of the record which I want to insert
    conflicting, i.e. duplicating, with one of the value of primary
    key in the database). So, I have two solutions:
    1. check whether there is already a primary key which confilcting
    with the value I want to insert, if not, insert into database.
    2. do not do any check before and insert the record directly, and catch
    SQLException.
    But they both have shortcomings. Solution 1 will lost time (must checking first)
    and solution 2 will throw a SQLException, and from the Exception, I do not know
    how can I infer it is a primary key conflicting exception.
    (I do not know how to distinguish it from other type of SQLException, for example,
    database name error exception or SQL statement syntax error).
    I do not know whether I have made myself understood.
    Who have better solutions?
    Thanks in advance,
    George

    If I use solution 2, can I get some information from
    SQLException? For example, can the exception tell me
    whether it is a duplicated primary key error or SQL
    statememt syntax error? You don't have to look at the error text. You should
    look at the error code. But keep in mind that
    it is vendor specific. A duplicate key error in Oracle
    has different error code then in SQL Server.Sounds good in theory, in practice it leaves a lot to be desired. First one still has to figure out which codes are problematic, and there is still no guarantee that they won't change. Moreover you might find that the code is used for different types of errors, and that won't work.
    >
    May you can have a look at the sqlstate, this should
    be the same across different DB's as it is defined int
    he SQL92 standard, but I wouldn't bet on it...
    I would bet - against it.

  • Problem when inserting blank record.

    Dear All,
    I have following taskflow structure
    execute (master)
    createinsert (detail)
    pagefragment
    my page fragment has 1 master record.. 1 detail record. (which would be blank one except pk and fk generated from viewlink)
    when the user saves (commit action click)record the master saves.. but the child doesnot saves
    what i noticed is that when i enter any field in af:table(detail) it saves... but i want to insert the blank record to database.
    Any ideas..?
    Regards,
    Santosh
    jdev 11.1.1.5.0
    Edited by: Santosh Vaza on Aug 26, 2011 10:08 PM

    Hi..
    read following will useful
    http://blogs.oracle.com/shay/entry/master_with_two_details_on_the

  • How can I using java bean to insert new record

    Hi everybody,
    I'd some problem when I insert a record using java bean. When insert a record, the resultset executeUpdate return 0 anc cannot add record to database. Would you please tell me what's wrong in my code?
    java bean
    package miniproj;
    import java.sql.*;
    public class Register{
    private String sql;
    private String username;
    private String usertype;
    private String password;
    private String blocknum;
    private int floornum;
    private String owner;
    private int rows;
    private String s;
    // set parameter to database
    public int setMember(){
    try{
    //load database driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Get a connection to the database
    Connection sqlConn = java.sql.DriverManager.getConnection("jdbc.odbc:WFBS");
    // Get a statement from the connection
    Statement sqlStmt = sqlConn.createStatement();
    sql = "INSERT INTO USERS(user_name, password) VALEUS ('aaa', 'aaa')";
    // sql = "INSERT INTO USERS(user_name, password) VALEUS (" + user_name + "," + password + ")" ;
    rows = sqlStmt.executeUpdate(sql);
    // sqlRst.close();
    sqlStmt.close();
    sqlConn.close();
    catch(SQLException se){
    catch(Exception e){
    return rows;
    // set user name method
    public void setUsername(String name){
    username = name;
    // set passwrod method
    public void setPassword(String pwd){
    password = pwd;
    // set block num mehtod
    public void setBlockNum(String block){
    blocknum = block;
    // set floor num method
    public void setFloorNum(int floor){
    floornum = floor;
    // set owner method
    public void setOnwer(String own){
    owner = own;
    // get user name method
    public String getUsername(){
    return username;
    // get password method
    public String getPassword(){
    return password;
    jsp code
    <%@ include file="Header.jsp" %>
    <%@ page errorPage="Error.jsp" %>
    <jsp:useBean id="register" class="miniproj.Register" />
    <jsp:setProperty name="register" property="*" />
    User name : <%=register.getUsername()%><br>
    Password : <%=register.getPassword()%><br>
    <%
    int i = register.setMember();
    out.println(i);
    %>
    Thanks a lot
    Chris

    Seems to me that executeUpdate() would throw an SQLException, which in turn would get caught by your empty catch. The SQL keyword VALUES is misspelled. Put a 'se.printStackTrace()' in your catch to confirm this.

  • Error with date field when inserting records into sql server from webdynpro

    Dear SDN's,
    I am trying to insert the records into sql server through my webDynpro program.
    I have created a date field in a dictionary with the datatype date.
    In my webdynpro program to insert the date i am following the below format.
    String dateString = "2006/12/10";
          java.util.Date d=new java.util.Date(dateString);
          java.sql.Date <b>date</b> = new java.sql.Date(d.getTime());
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,<b>REQDT</b>,ADVCE,ETADV,PURTR) values(21, '555-1212', '" + <b>date</b> + "', 5000, '20060501','hi')");
    when i try to execute it, it gives the following error.
    <b>com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "TRAVEL_HEADER" ("TRQID","PROJECTID","REQDT","ADVCE","ETADV","PURTR") VALUES (21,'555-1212','2006-12-10',5000,'20060501','hi')" contains the semantics error[s]: - type check error: new value (element number 3 (CHAR)) is not assignable to column  >>REQDT<< (DATE)</b>
    Please correct me.
    Your help will be appreciated.
    Regards,
    Sireesha.B

    Hi,
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,REQDT,ADVCE,ETADV,PURTR) values(21, '555-1212', 'date', 5000, '20060501','hi')");
    try like this.
    I Think in SQL the general format to take date as input like this.
    INSERT INTO X VALUES ('10/30/56')
    thaks,
    Lohi.

  • Error when inserting a new record (Ctrl+Down)

    Hello,
    [http://img402.imageshack.us/my.php?image=12846351.jpg]
    Here the problem is : when i press Ctrl+Down (Insert new record), i enter data into all those fields, but i got an error
    Cannot Insert Record ("ROGER"."NUME") cannot be null (roger is my username which i logged on). And i completed all fields
    Also, when inserting data into fields, when i click on another field, it points me back automatically to the last completed field, then when i click again on the next field, i can enter data in that field. why the cursor cannot be on the next field when i first click there?
    i changed the property of the items Required = No (but however, in the database cannot be null).
    Please help if you can.
    Thanks

    For your other issue, with null fields on your forms.
    have you ever tried to log those fields value into a log table?
    A better and simple idea is:
    Create a temp table, with four columns: seq, section, message, type
    Where section is the column to condition any search you want to make
    message is the column to write anything you want
    type is the column which holds the tpe of the record, like info, debug, warn, etc.
    then create a database procedure
    this procedure must recieve the section, message, type and insert them into the log table and do commit.
    in yiour pre-insert trigger [forms level] or in your when-button-pressed or even better on your on-commit trigger [forms level]
    write the following code:
    begin
    database_procdure('MY_FORM_NAME', 'THE VALUES ARE: 1='||:1||' 2='||:2||' 3='||:3, 'INFO');
    end;
    After that you can do a select in your sql*plus with the following statement:
    select *
    from temp_table
    where selction like 'MY_FORM_NAME';
    then you can track if any of the values you think is null or has a value, in fact, has a value.
    best regards,
    Abdel Miranda
    AEMS Global Group
    Panama

  • Question regarding DocumentDB RU consumption when inserting documents & write performance

    Hi guys,
    I do have some questions regarding the DocumentDB Public Preview capacity and performance quotas:
    My use case is the following:
    I need to store about 200.000.000 documents per day with a maximum of about 5000 inserts per second. Each document has a size of about 200 Byte.
    According to to the documentation (http://azure.microsoft.com/en-us/documentation/articles/documentdb-manage/) i understand that i should be able to store about 500 documents per second with single inserts and about 1000 per second with a batch insert using
    a stored procedure. This would result in the need of at least 5 CUs just to handle the inserts.
    Since one CU consists of 2000 RUs i would expect the RU usage to be about 4 RUs per single document insert or 100 RUs for a single SP execution with 50 documents.
    When i look at the actual RU consumption i get values i don’t really understand:
    Batch insert of 50 documents: about 770 RUs
    Single insert: about 17 RUs
    Example document:
    {"id":"5ac00fa102634297ac7ae897207980ce","Type":0,"h":"13F40E809EF7E64A8B7A164E67657C1940464723","aid":4655,"pid":203506,"sf":202641580,"sfx":5662192,"t":"2014-10-22T02:10:34+02:00","qg":3}
    The consistency level is set to “Session”.
    I am using the SP from the example c# project for batch inserts and the following code snippet for single inserts:
    await client.CreateDocumentAsync(documentCollection.DocumentsLink, record);
    Is there any flaw in my assumption (ok…obviously) regarding the throughput calculation or could you give me some advice how to achieve the throughput stated in the documentation?
    With the current performance i would need to buy at least 40 CUs which wouldn’t be an option at all.
    I have another question regarding document retention:
    Since i would need to store a lot of data per day i also would need to delete as much data per day as i insert:
    The data is valid for at least 7 days (it actually should be 30 days, depending on my options with documentdb). 
    I guess there is nothing like a retention policy for documents (this document is valid for X day and will automatically be deleted after that period)?
    Since i guess deleting data on a single document basis is no option at all i would like to create a document collection per day and delete the collection after a specified retention period.
    Those historic collections would never change but would only receive queries. The only problem i see with creating collections per day is the missing throughput:
    As i understand the throughput is split equally according to the number of available collections which would result in “missing” throughput on the actual hot collection (hot meaning, the only collection i would actually insert documents).
    Is there any (better) way to handle this use case than buy enough CUs so that the actual hot collection would get the needed throughput?
    Example: 
    1 CU -> 2000 RUs
    7 collections -> 2000 / 7 = 286 RUs per collection (per CU)
    Needed throughput for hot collection (values from documentation): 20.000
    => 70 CUs (20.000 / 286)
    vs. 10 CUs when using one collection and batch inserts or 20 CUs when using one collection and single inserts.
    I know that DocumentDB is currently in preview and that it is not possible to handle this use case as is because of the limit of 10 GB per collection at the moment. I am just trying to do a POC to switch to DocumentDB when it is publicly available. 
    Could you give me any advice if this kind of use case can be handled or should be handled with documentdb? I currently use Table Storage for this case (currently with a maximum of about 2500 inserts per second) but would like to switch to documentdb since i
    had to optimize for writes per second with table storage and do have horrible query execution times with table storage because of full table scans.
    Once again my desired setup:
    200.000.000 inserts per day / Maximum of 5000 writes per second
    Collection 1.2 -> Hot Collection: All writes (max 5000 p/s) will go to this collection. Will also be queried.
    Collection 2.2 -> Historic data, will only be queried; no inserts
    Collection 3.2 -> Historic data, will only be queried; no inserts
    Collection 4.2 -> Historic data, will only be queried; no inserts
    Collection 5.2 -> Historic data, will only be queried; no inserts
    Collection 6.2 -> Historic data, will only be queried; no inserts
    Collection 7.2 -> Historic data, will only be queried; no inserts
    Collection 1.1 -> Old, so delete whole collection
    As a matter of fact the perfect setup would be to have only one (huge) collection with an automatic document retention…but i guess this won’t be an option at all?
    I hope you understand my problem and give me some advice if this is at all possible or will be possible in the future with documentdb.
    Best regards and thanks for your help

    Hi Aravind,
    first of all thanks for your reply regarding my questions.
    I sent you a mail a few days ago but since i did not receive a response i am not sure it got through.
    My main question regarding the actual usage of RUs when inserting documents is still my main concern since i can not insert nearly
    as many documents as expected per second and CU.
    According to to the documentation (http://azure.microsoft.com/en-us/documentation/articles/documentdb-manage/)
    i understand that i should be able to store about 500 documents per second with single inserts and about 1000 per second with a batch insert using a stored procedure (20 batches per second containing 50 documents each). 
    As described in my post the actual usage is multiple (actually 6-7) times higher than expected…even when running the C# examples
    provided at:
    https://code.msdn.microsoft.com/windowsazure/Azure-DocumentDB-NET-Code-6b3da8af/view/SourceCode
    I tried all ideas Steve posted (manual indexing & lazy indexing mode) but was not able to enhance RU consumption to a point
    that 500 inserts per second where nearly possible.
    Here again my findings regarding RU consumption for batch inserts:
    Automatic indexing on: 777
    RUs for 50 documents
    Automatic indexing off &
    mandatory path only: 655
    RUs for 50 documents
    Automatic indexing off & IndexingMode Lazy & mandatory path only:  645 RUs for
    50 documents
    Expected result: approximately 100
    RUs (2000 RUs => 20x Batch insert of 50 => 100 RUs per batch)
    Since DocumentDB is still Preview i understand that it is not yet capable to handle my use case regarding throughput, collection
    size, amount of collections and possible CUs and i am fine with that. 
    If i am able to (at least nearly) reach the stated performance of 500 inserts per second per CU i am totally fine for now. If not
    i have to move on and look for other options…which would also be “fine”. ;-)
    Is there actually any working example code that actually manages to do 500 single inserts per second with one CUs 2000 RUs or is
    this a totally theoretical value? Or is it just because of being Preview and the stated values are planned to work.
    Regarding your feedback:
    ...another thing to consider
    is if you can amortize the request rate over the average of 200 M requests/day = 2000 requests/second, then you'll need to provision 16 capacity units instead of 40 capacity units. You can do this by catching "RequestRateTooLargeExceptions" and retrying
    after the server specified retry interval…
    Sadly this is not possible for me because i have to query the data in near real time for my use case…so queuing is not
    an option.
    We don't support a way to distribute throughput differently across hot and cold
    collections. We are evaluating a few solutions to enable this scenario, so please do propose as a feature at http://feedback.azure.com/forums/263030-documentdb as this helps us prioritize
    feature work. Currently, the best way to achieve this is to create multiple collections for hot data, and shard across them, so that you get more proportionate throughput allocated to it. 
    I guess i could circumvent this by not clustering in “hot" and “cold" collections but “hot" and “cold"
    databases with one or multiple collections (if 10GB will remain the limit per collection) each if there was a way to (automatically?) scale the CUs via an API. Otherwise i would have to manually scale down the DBs holding historic data. I
    also added a feature requests as proposed by you.
    Sorry for the long post but i am planning the future architecture for one of our core systems and want to be sure if i am on
    the right track. 
    So if you would be able to answer just one question this would be:
    How to achieve the stated throughput of 500 single inserts per second with one CUs 2000 RUs in reality? ;-)
    Best regards and thanks again

  • Validations when inserting records into database using table control?

    hi , guru's.
          iam inserting records into database table through table control when i press insert i want check which record is existing and which is not . so please give me any sample code
    regards,
    satheesh.

    hi , arjun.
    please check this code.
        WHEN 'INSERT'.
        data: g_vcontrol_itab1 like table of zcust_call_rec,
              g_vcontrol_wa1 like g_vcontrol_wa.
         SELECT *  FROM zcust_call_rec
                   INTO CORRESPONDING FIELDS OF TABLE g_vcontrol_itab1
                   FOR ALL ENTRIES IN g_vcontrol_itab
                   WHERE kunnr = g_vcontrol_itab-kunnr AND budat = g_vcontrol_itab-budat.
            loop at g_vcontrol_itab into g_vcontrol_wa.
               read table g_vcontrol_itab1 into g_vcontrol_wa1
                    with table key  g_vcontrol_wa-kunnr = kunnr and g_vcontrol_wa-budat = budat.
                     if sy-subrc = 0.
                       delete g_vcontrol_itab.
                     endif.
            endloop.
          LOOP AT g_vcontrol_itab INTO g_vcontrol_wa.
            INSERT into zcust_call_rec values g_vcontrol_wa.
          ENDLOOP.
    with this iam getting error message like this.
              <b>g_vcontrol_wa-budat is not expected.</b>

  • How do I create a DVD with no theme, i.e., it plays what was recorded when inserted in the player?

    How do I create a DVD with no theme, i.e., it plays what was recorded when inserted in the player?  Nothing extra, just the recorded content.

    Hi
    No Menu on DVD
    from. Mishmunken
    How to create a DVD in iDVD6 without menu (there are several options)
    1. Easy. Drop your iMovie in the auto-play box in iDVD's Map View, then set your auto-play item (your movie) to loop continuously.
    Disadvantage. The DVD plays until you hit stop on the remote
    2. Still easy. If you don't want your (auto-play) movie to loop, you can create a black theme by replacing the background of a static theme with a black background and no content in the drop-zone (text needs to be black as well).
    Disadvantage. The menu is still there and will play after the movie. You don't see it, but your disc keeps spinning in the player.
    3. Still quite easy but takes more time. Export the iMovie to DV tape, and then re-import using One-Step DVD.
    Disadvantage. One-Step DVD creation has been known to be not 100% reliable.
    4. (My preferred method) Easy enough but needs 3rd party software. Toast lets you burn your iMovie to DVD without menu - just drag the iMovie project to the Toast Window and click burn.
    Disadvantage. you'll need to spend some extra $$ for the software. In Toast, you just drop the iMovie project on the Window and click Burn.
    5. The "hard way". Post-production with myDVDedit (free-ware)
    Tools necessary. myDVDedit ( www.mydvdedit.com )
    • create a disc image of your iDVD project, then double-click to mount it.
    • Extract the VIDEO_TS and AUDIO_TS folders to a location of your choice. select the VIDEO_TS folder and hit Cmd + I to open the Inspector window
    • Set permissions to "read & write" and include all enclosed items; Ignore the warning.
    • Open the VIDEO_TS folder with myDVDedit. You'll find all items enclosed in your DVD in the left hand panel.
    • Select the menu (usually named VTS Menu) and delete it
    • Choose from the menu File > Test with DVD Player to see if your DVD behaves as planned. If it works save and close myDVDedit.
    • Before burning the folders to Video DVD, set permissions back to "read only", then create a disc image burnable with Disc Utility from a VIDEO_TS folder using Laine D. Lee's DVD Imager.
    //lonestar.utsa.edu/llee/applescript/dvdimager.html
    hope this helps!
    From LynnLU USA
    www.mediasoftmac.com/dvd-creator-articles/convert-mov-video-to-dvd-on-mac.html#1 29
    Yours Bengt W

  • How can i create trriger when inserting record in foreign key

    i have two table
    ward(id,erf_no,zone)
    property(id,war_id,Address_Line)
    ward.id = property.war_id
    i what to create new ward id whenever am inserting new record in property
    something like this but i don't what to insert in property id i what to insert in ward table new id
    CREATE OR REPLACE TRIGGER ASSIGN_propid
    BEFORE INSERT ON SMS_PROPERTIES FOR EACH ROW
    BEGIN
    IF :NEW.ID IS NULL OR :NEW.ID < 0 THEN
    SELECT  SMS_MAST1_SEQ.NEXTVAL
    INTO :NEW.ID
    FROM DUAL;
    END IF;
    END;
    {code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Here's an example:
    http://www.oracle-base.com/articles/misc/populating-master-detail-fks-using-sequences.php

  • Help needed regarding insert a record

    Hi,
    I have designed a page to insert employee records.
    After pressing the "Apply" button is giving the following error :
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object CreateAM.EMP_Create_VO1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    Please help me in resolving this error.
    Thanks,
    Swaroop

    Hi shiv,
    I have created a EO attached it to EMP table. Created VO, atteched to that EO.
    and My controller code is :
    |
    package oracle.apps.OPI.setup.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.jbo.domain.Number;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    * Controller for ...
    public class CreateCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    // Always call this first.
    super.processRequest(pageContext, webBean);
    // If isBackNavigationFired = false, we're here after a valid navigation
    // (the user selected the Create Empoyee button) and we should proceed
    // normally and initialize a new employee.
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction (this
    // is used to ensure correct Back button behavior).
    TransactionUnitHelper.startTransactionUnit(pageContext, "empCreateTxn");
    // This test ensures that we don't try to create a new employee if
    // we had a JVM failover, or if a recyled application module
    // is activated after passivation. If these things happen, BC4J will
    // be able to find the row that you created so the user can resume
    // work.
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("createEmployee", null);
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "empCreateTxn", true))
    // We got here through some use of the browser "Back" button, so we
    // want to display a stale data error and disallow access to the page.
    // If this were a real application, we would probably display a more
    // context-specific message telling the user she can't use the browser
    // "Back" button and the "Create" page. Instead, we wanted to illustrate
    // how to display the Applications standard NAVIGATION ERROR message.
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    } // end processRequest()
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Apply") != null)
    am.invokeMethod("apply");
    pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/OPI/setup/webui/DisplayPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackEmployee");
    pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/OPI/setup/webui/CreatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    My AM code is:
    package oracle.apps.OPI.setup.server;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.jbo.Row;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.jbo.Transaction;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    public class CreateAMImpl extends OAApplicationModuleImpl {
    /**This is the default constructor (do not remove)
    public CreateAMImpl() {
    /**Container's getter for CreateVO1
    public CreateVOImpl getCreateVO1() {
    return (CreateVOImpl)findViewObject("CreateVO1");
    /**Sample exportable method.
    public void sampleCreateAMImplExportable() {
    /**Sample exportable method.
    public void sampleCreateAMImplExportable2(String testParam1) {
    /**Sample main for debugging Business Components code using the tester.
    public static void main(String[] args) {
    launchTester("oracle.apps.OPI.setup.server", /* package name */
    "CreateAMLocal" /* Configuration Name */);
    * Creates a new employee.
    public void createEmployee()
    OAViewObject vo = (OAViewObject) getEMP_Create_VO1();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    Row row = vo.createRow();
    vo.insertRow(row);
    // Required per OA Framework Model Coding Standard M69
    row.setNewRowState(Row.STATUS_INITIALIZED);
    } // end createEmployee()
    * Executes a rollback including the database and the middle tier.
    public void rollbackEmployee()
    Transaction txn = getTransaction();
    // This small optimization ensures that we don't perform a rollback
    // if we don't have to.
    if (txn.isDirty())
    txn.rollback();
    } // end rollbackEmployee()
    public void apply()
    getDBTransaction().commit();
    /**Container's getter for EMP_Create_VO1
    public EMP_Create_VOImpl getEMP_Create_VO1() {
    return (EMP_Create_VOImpl)findViewObject("EMP_Create_VO1");
    }

Maybe you are looking for