Use SQL to INSERT a record into an Access table and populate using variables

I am having difficulties with the following code:
'Get my username
UserNameWindows = GetUserName
'Assemble my name and request corrections
MsgBoxTitle = "What name do you want to use?"
NewDefault = Replace(UserNameWindows, ".", " ")
NewDefault = StrConv(NewDefault, vbProperCase)
MyValue = InputBox(Message, MsgBoxTitle, NewDefault)
RealName = MyValue
'Assemble your email address
MsgBoxTitle = "What is your email address?"
NewDefault = UserNameWindows & "@calibreglobal.com.au"
MyValue = InputBox(Message, MsgBoxTitle, NewDefault)
EmailAddress = MyValue
MsgBox "Your UserNameWindows value is " & UserNameWindows & "."
'Insert UserNameWindows into the tblAuthorisedPeople table
strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (" & UserNameWindows & ",""" & RealName & """, """ & EmailAddress & """)"
DoCmd.RunSQL (strSQL)
It asks me to enter the value for the Person field into a dialogue box instead of using the value of UserNameWindows.
After entry, it accepts the other values and enters the record correctly.
I have also tried this SQL string without success
strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (" & Forms!frmCreateNew!UserNameWindows & ",""" & RealName & """, """ & EmailAddress & """)"
Any comments?
Barry Cuthbertson

Found the error. I had used the rules for the syntax from a web forum reply which appears to have been incorrect!
strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (""" & UserNameWindows & """,""" & RealName & """, """ & EmailAddress &
This seems to be working well as the moment
All finished.
Barry GC
 

Similar Messages

  • Cannot INSERT records into Partitioned Spatial Table and Index

    I am trying to tune our Spatial Storage by creating partitioning our spatial_entity table and index. I used the World Geographic Reference System (GEOREF) creating a partition for each 15 x 15 degree grid square assigning a partition key of decimal longitude, decimal_latitude. The build went OK, however when trying to insert a data record I receive an ORA-14400: Inserted partition key does not map to any partition.
    I validated the CREATE(s), and all appears correct, but obviously something is not correct, which is prompting for expert help in this forum.
    I would be very grateful for your help.
    Below are the code snippets for the table and index, and an insert statement.
    CREATE TABLE spatial_entity
         geoloc_type VARCHAR2 (60 BYTE) NOT NULL
    ,entity_id NUMBER NOT NULL
    ,metadata_xml_uuid VARCHAR2 (40 BYTE) NOT NULL
    ,geoloc MDSYS.sdo_geometry NOT NULL
    ,nee_method CHAR (1 BYTE) NOT NULL
    ,nee_status CHAR (1 BYTE) NOT NULL
    ,decimal_latitude NUMBER (15, 6) NOT NULL
    ,decimal_longitude NUMBER (15, 6) NOT NULL
    PARTITION BY RANGE (decimal_longitude, decimal_latitude)
         PARTITION p_lt_0_90s
              VALUES LESS THAN (1, -90)
         ,PARTITION p_lt_0_75s
              VALUES LESS THAN (1, -75)
         ,PARTITION p_lt_0_60s
              VALUES LESS THAN (1, -60)
         ,PARTITION p_lt_0_45s
              VALUES LESS THAN (1, -45)
         ,PARTITION p_lt_0_30s
              VALUES LESS THAN (1, -30)
         ,PARTITION p_lt_0_15s
              VALUES LESS THAN (1, -15)
         ,PARTITION p_lt_0_0
              VALUES LESS THAN (1, 0)
         ,PARTITION p_lt_0_15n
              VALUES LESS THAN (1, 15)
         ,PARTITION p_lt_0_30n
              VALUES LESS THAN (1, 30)
         ,PARTITION p_lt_0_45n
              VALUES LESS THAN (1, 45)
         ,PARTITION p_lt_0_60n
              VALUES LESS THAN (1, 60)
         ,PARTITION p_lt_0_75n
              VALUES LESS THAN (1, 75)
         ,PARTITION p_lt_0_90n
              VALUES LESS THAN (1, maxvalue)
    CREATE INDEX geo_spatial_ind ON spatial_entity (geoloc)
    INDEXTYPE IS mdsys.spatial_index
    PARAMETERS ('layer_gtype=MULTIPOINT TABLESPACE=GEO_SPATIAL_IND') LOCAL
    (PARTITION p_lt_0_90s,
    PARTITION p_lt_0_75s,
    PARTITION p_lt_0_60s,
    PARTITION p_lt_0_45s,
    PARTITION p_lt_0_30s,
    PARTITION p_lt_0_15s,
    PARTITION p_lt_0_0,
    PARTITION p_lt_0_15n,
    PARTITION p_lt_0_30n,
    PARTITION p_lt_0_45n,
    PARTITION p_lt_0_60n,
    PARTITION p_lt_0_75n,
    PARTITION p_lt_0_90n,
    INSERT INTO spatial_entity
         geoloc_type
         ,entity_id
         ,metadata_xml_uuid
         ,geoloc
         ,nee_method
         ,nee_status
         ,decimal_latitude
         ,decimal_longitude
    VALUES
                   'BATCH'
                   ,0
                   ,'6EC25B76-8482-4F95-E0440003BAD57EDF'
                   ,"MDSYS"."SDO_GEOMETRY"
                        2001
                        ,8307
                        ,"MDSYS"."SDO_POINT_TYPE" (32.915286, 44.337902, NULL)
                        ,NULL
                        ,NULL
                   ,'M'
                   ,'U'
                   ,32.915286
                   ,44.337902
    Thank you for you help.
    Dave

    Thank you for your quick reply. I did not post the entire CREATE script as it is quite long. The portion of the script that is applicable to the INSERT is:
    ,PARTITION p_lt_45e_90s
              VALUES LESS THAN (23, -90)
         ,PARTITION p_lt_45e_75s
              VALUES LESS THAN (23, -75)
         ,PARTITION p_lt_45e_60s
              VALUES LESS THAN (23, -60)
         ,PARTITION p_lt_45e_45s
              VALUES LESS THAN (23, -45)
         ,PARTITION p_lt_45e_30s
              VALUES LESS THAN (23, -30)
         ,PARTITION p_lt_45e_15s
              VALUES LESS THAN (23, -15)
         ,PARTITION p_lt_45e_0
              VALUES LESS THAN (23, 0)
         ,PARTITION p_lt_45e_15n
              VALUES LESS THAN (23, 15)
         ,PARTITION p_lt_45e_30n
              VALUES LESS THAN (23, 30)
         ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (23, 45)
         ,PARTITION p_lt_45e_60n
              VALUES LESS THAN (23, 60)
         ,PARTITION p_lt_45e_75n
              VALUES LESS THAN (23, 75)
         ,PARTITION p_lt_45e_90n
              VALUES LESS THAN (23, maxvalue)
    Or, I do not fully understand. Are you indicating that I must explcitly state the longitude in each clause,
    e.g ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (45, 45)
    ,PARTITION p_lt_45w_45n
              VALUES LESS THAN (-45, 45)
    If so, that answers the question of why it cannot find a partition, however an Oracle White Paper "Oracle Spatial Partitioning Best Practices" Sept 2004, discusses multi column partitioning such as represented by this problem, and gives an INSERT statement example of :
    CREATE TABLE multi_partn_table (in_date DATE,
    geom SDO_GEOMETRY, x_value NUMBER, y_value NUMBER)
    PARTITION BY RANGE (X_VALUE,Y_VALUE)
    PARTITION P_LT_90W_45S VALUES LESS THAN (1,-45),
    PARTITION P_LT_90W_0 VALUES LESS THAN (1,0),
    PARTITION P_LT_90W_45N VALUES LESS THAN (1,45),
    PARTITION P_LT_90W_90N VALUES LESS THAN (1,MAXVALUE
    and as I am writing this I am seeing that I failed to include the longitude and latitude in the SDO_GEOMETRY clause, so it does appear tht I need to explicitly state the longitude valuues.
    What is your judgement sir?
    Dave

  • Insert multiple records into Oracle using Java

    Hi,
    Has anyone tried to insert multiple records into an Oracle table from Java? I have my data in a Java collection.Can I send a Java Collection to an Oracle Package as a PL/SQL Table Type? My problem is I dont want to instantiate a CallableStatement object everytime I do an insert. Instead I want to do that only once and then insert multiple records in one operation.
    Any suggestions will be appreciated,
    Thanks,
    Alex

    Hi Mensa,
    I went thru the code example in your book in chapter 8 (downloaded it from OTN). It looks like the java code for "public class myPLSQLIndexTab" might be a java stored procedure stored in the oracle database?
    Pardon my ignorance because I've never worked on java code in the oracle database itself but how would I call such a program outside the oracle database? For example say I have a batch job that downloads data from a webservice and that batch job is written in java and its sitting on a batch server somewhere on the network. But the java program that inserts data into the database is sitting in the oracle database (also somewhere in the same network). How can the java code sitting on the batch server talk to the java code sitting on the oracle server? Is it the same as calling a pl/sql package using CallableStatement?
    Thanks
    Alex

  • Different methods involved in insertion of records into the table

    hi all,
    i am using Forms [32 Bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    i have parameters like emp_code(optional) and year(mandatory field-four digit year).
    Based on the parameter i have to get the details from one table and those records should be inserted into other table along with additions columns(by hardcoding the additional columns).
    To acheive this i am planning to get a cursor by selecting the necessay fields from the table passing the parameters in the where clause of the cursor.
    by looping through the cursor i will insert the records into the other table.
    here the thing is the data is going to be huge (since year is the parameter).
    so is my approach leads to the performance issue.
    i heard that there are different method of insetions,
    can anybody suggest me the better way(peformance wise) other than what i have mentioned (if you are aware of)..
    Thanks..

    This is not really a Forms issue, so you'd better go to the sql and pl/sql forum. Here, this question has been asked many times: how do I insert large volumes of data in a table?
    insert into ...
    select ....
    or CTAS (create table as select ....)
    by looping through the cursor i will insert the records into the other table.That is really the worst idea. If you can do it in sql (insert into ... select ...) DON'T do it in pl/sql.

  • Inserting multiple records in to database table using webdynpro abap

    Hi all,
    I have created a username inputfield,a button and a table
    with one coloumn.
    If i enter  names in the input field then the values should be
    displayed in that table.
    Even i have got the answer i am not able to insert
    the values in to database(ztable) table.
    i.e. only one value(1st) was inserted the second value was
    not inserted ....
    so kindly send me the coding to insert multiple records
    into the database table......
    by,
    ranjith

    hi Ranjith,
    If you want to insert multiple records from the webdynpro view table to database table then try the following code.
    DATA lo_nd_tablenode TYPE REF TO if_wd_context_node.
      DATA lo_el_tablenode TYPE REF TO if_wd_context_element.
      DATA ls_tablenode TYPE wd_this->element_tablenode.
      DATA it_tablenode LIKE STANDARD TABLE OF ls_tablenode.
      navigate from <CONTEXT> to <tablenode> via lead selection
      lo_nd_tablenode = wd_context->get_child_node( name = wd_this->wdctx_tablenode ).
      get element via lead selection
      lo_el_tablenode = lo_nd_tablenode->get_element(  ).
      get all declared attributes
      lo_nd_tablenode->get_static_attributes_table(
      IMPORTING
        table = it_tablenode ).
    MODIFY databasetablename FROM TABLE  it_tablenode.
    here it_tablenode is the internal table which holds the value from webdynpro view..
    Regards,
    Shamila.

  • Insert same record on two different tables (no master detail)

    Hi all,
    I'd like to know how to insert 1 record into two different
    tables.
    the first table is corni_dati the second is cornidati_prev
    anytime someone inserts a new record both tables should be
    filled.
    if ((isset($HTTP_POST_VARS["MM_insert"])) &&
    ($HTTP_POST_VARS["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO corni_dati (corni_id,
    disciplina,
    codice_modulo, insegnanti, classi, obiettivi, prerequisiti,
    ud1, ud2,
    ud3, ud4, ud5, ud6, metodologia, collegamenti, verifiche,
    verifiche_note, durata, periodo_inizio, periodo_fine, note,
    indirizzo,
    modnum, modulo_titolo, `data`, compilato, descrizione) VALUES
    (%s, %s,
    %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
    %s, %s, %s,
    %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($HTTP_POST_VARS['corni_id'],
    "int"),
    GetSQLValueString($HTTP_POST_VARS['disciplina'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['codice_modulo'], "text"),
    GetSQLValueString($HTTP_POST_VARS['insegnanti'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['classi'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['obiettivi'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['prerequisiti'], "text"),
    GetSQLValueString($HTTP_POST_VARS['ud1'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud2'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud3'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud4'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud5'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud6'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['metodologia'], "text"),
    GetSQLValueString($HTTP_POST_VARS['collegamenti'], "text"),
    GetSQLValueString($HTTP_POST_VARS['verifiche'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['verifiche_note'], "text"),
    GetSQLValueString($HTTP_POST_VARS['durata'],
    "int"),
    GetSQLValueString($HTTP_POST_VARS['periodo_inizio'], "text"),
    GetSQLValueString($HTTP_POST_VARS['periodo_fine'], "text"),
    GetSQLValueString($HTTP_POST_VARS['note'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['indirizzo'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['modnum'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['modulo_titolo'], "text"),
    GetSQLValueString($HTTP_POST_VARS['data'],
    "date"),
    GetSQLValueString($HTTP_POST_VARS['compilato'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['descrizione'], "text"));
    mysql_select_db($database_itiscorni, $itiscorni);
    $Result1 = mysql_query($insertSQL, $itiscorni) or
    die(mysql_error());
    $insertGoTo = "creacodice_doc.php";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
    header(sprintf("Location: %s", $insertGoTo));

    If you are doing this then you really should have a look at
    your database
    design. Read up on the first 3 normal forms.
    Pat.
    "darrel" <[email protected]> wrote in message
    news:ee77jg$302$[email protected]..
    >
    >
    > --
    >> Hi all,
    >> I'd like to know how to insert 1 record into two
    different tables.
    >
    > In your SQL query, just use two inserts:
    >
    > INSERT into TABLE1...; INSERT into TABLE2...
    >
    > Darrel
    >

  • Can you use ESB to insert multiple records into a Database

    We have an XML file that has a Parent/Child relationship.
    In situation 1 we have a single parent record in the xml file. We can insert the record into the database successfully.
    In situation 2 we have a parent and a an associated child record. By using a filter expression to identify the existence of the child record we can route to the first DB Adapter to insert the parent then to the second DB Adapter to insert the child.
    Is this final scenario logical and also possible.
    Situation 3 we have multiple child records associated to a single parent. So we would first insert the parent record then insert all the child records.
    Thanks

    I use PL/SQL for this if you are using Oracle.
    Have a look at this post, it is for AQ but the concept can be used for PL/SQL
    Re: Can I pass a pl/sql table as a parameter from a database adaptor
    I will send you an example
    cheers
    James

  • Insert records into an Access

    I am trying to insert records into an Access document but
    when trying to execute the action page I get the following:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 1.
    The error occurred in
    C:\ColdFusion8\wwwroot\ASK\AskAction.cfm: line 17
    15 :
    16 :
    17 : values ('#trim(form.qname)#', '#trim(form.email)#',
    #DateVariable2#, #Val(form.Mathques)#, '#(form.quest)#')
    18 :
    19 : </cfquery>
    SQLSTATE 07002
    SQL insert into table1 (qname,
    email,qdate,recipient,question) values ('bill', '[email protected]',
    13-Oct-08, 0, '45x9 ')
    VENDORERRORCODE -3010
    DATASOURCE ques
    Resources:
    Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
    SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506;
    InfoPath.2)
    Remote Address 0:0:0:0:0:0:0:1
    Referrer
    http://localhost:8500/ask/ASKform.cfm
    Date/Time 13-Oct-08 09:07 PM
    Stack Trace (click to expand)
    thanks,
    Steve

    what are your data types for the recipient and qdate columns?
    - you could try putting quotes around the date object, i always
    forget if they're needed or not with date objects

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • Insert multiple rows into a same table from a single record

    Hi All,
    I need to insert multiple rows into a same table from a single record. Here is what I am trying to do and I need your expertise. I am using Oracle 11g
    DataFile
    1,"1001,2001,3001,4001"
    2,"1002,2002,3002,4002"
    The data needs to be loaded as
    Field1      Field2
    1               1001
    1               2001
    1               3001
    1               4001
    2               1002
    2               2002
    2               3002
    2               4002
    Thanks

    You could use SQL*Loader to load the data into a staging table with a varray column, then use a SQL insert statement to distribute it to the destination table, as demonstrated below.
    SCOTT@orcl> host type test.dat
    1,"1001,2001,3001,4001"
    2,"1002,2002,3002,4002"
    SCOTT@orcl> host type test.ctl
    load data
    infile test.dat
    into table staging
    fields terminated by ','
    ( field1
    , numbers varray enclosed by '"' and '"' (x))
    SCOTT@orcl> create table staging
      2    (field1  number,
      3     numbers sys.odcinumberlist)
      4  /
    Table created.
    SCOTT@orcl> host sqlldr scott/tiger control=test.ctl log=test.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Wed Dec 18 21:48:09 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 2
    SCOTT@orcl> column numbers format a60
    SCOTT@orcl> select * from staging
      2  /
        FIELD1 NUMBERS
             1 ODCINUMBERLIST(1001, 2001, 3001, 4001)
             2 ODCINUMBERLIST(1002, 2002, 3002, 4002)
    2 rows selected.
    SCOTT@orcl> create table destination
      2    (field1  number,
      3     field2  number)
      4  /
    Table created.
    SCOTT@orcl> insert into destination
      2  select s.field1, t.column_value
      3  from   staging s, table (s.numbers) t
      4  /
    8 rows created.
    SCOTT@orcl> select * from destination
      2  /
        FIELD1     FIELD2
             1       1001
             1       2001
             1       3001
             1       4001
             2       1002
             2       2002
             2       3002
             2       4002
    8 rows selected.

  • Inserting a record into an Excel

    Hello! Everyone, I am now trying to use Excel as a database, however, I could not insert any records into a spreadsheet but I could read the data from it. Please help...here is the code..
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import java.util.*;
    public class InteractWithExcel {
         static final String DRIVER_NAME = "sun.jdbc.odbc.JdbcOdbcDriver";
         static final String DATABASE_URL = "jdbc:odbc:EXCELJDBCTest; READONLY=0";
         public static void main(String[] args) {
              try {
                   Class.forName(DRIVER_NAME);
                   Connection conn = null;
                   conn = DriverManager.getConnection(DATABASE_URL);
                   Statement stmt = conn.createStatement();
                   stmt.executeUpdate("insert into [Sheet1$] values ('ABC', 68)");
                   ResultSet rs = /*stmt.executeQuery("select sum(Population) from [Sheet1$]");
                        stmt.executeQuery("select State,Population from [Sheet1$]");
                   while (rs.next()) {
                        String state = rs.getString(1);
                        int population = rs.getInt(2);
                        System.out.println(state + " - " + population);
                   rs.close();
                   stmt.close();
              } catch (ClassNotFoundException cnfe) {
                   System.err.println("ClassNotFoundException Was Thrown");
                   cnfe.printStackTrace();
              } catch (SQLException sqle) {
                   System.err.println("SQLException Was Thrown");
                   sqle.printStackTrace();
    }

    The code is somehow workable....
    The problem is that...
    1) a record could only be added only if I open the corresponding excel file
    2) the record is added to the end of the spreadsheet...
    e.g. there three records in the spreadsheet, namely 1, 2, 3,
    if I open the file and then run the java programme, the new record will be added to 4...
    then I deleted record 4 manually by opening the excel file and then delete,
    now, if I run the java programme again, the new record will be added to 5....but not the empty space 4...
    how come???
    Please help!

  • Insert multiple records into a table(Oracle 9i) from a single PHP statement

    How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
    From what all I've found, the statement below would work if I were using MySQL:
         insert into scen
         (indx,share,expire,pitch,curve,surface,call)
         values
         (81202, 28, 171, .27, 0, 0, 'C' ),
         (81204, 28, 501, .25, 0, 0, 'C' ),
         (81203, 17, 35, .222, 0, 0, 'C' ),
         (81202, 28, 171, .27, 2, 0, 'C' ),
         (81204, 28, 501, .20, 0, 1, 'C' ),
         (81203, 28, 135, .22, 1, 0, 'C' )
    The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
    Thank you,
    Will

    You could look at the INSERT ALL statement found in the documentation here:
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
    My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
    The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
    HTH.

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

  • Insert multiple records into database through internal table

    Hi
      please help me how to insert multiple records into database through internal table

    Hi,
    Welcome to SCN.
    Press F1 on INSERT statement and you will teh syntax as well the docu for the same.

  • Inserting a record into an array

    I have an applet that pops up different frames when you click on a menu item. On my add a record frame I have a number of textfields and an add button. When the button is clicked it is supposed to insert the record into my array of objects that only can have 3 records. When the button is clicked however I get a null pointer exception. I want to add the record in order based on the employee number, so first I want to check to see if the first spot of the array is null and add the record in the first spot if it is. If it isn't I want to check the employee numbers and insert the the record in the correct place and make sure the array isn't full. Can someone help me out 1. Why the nullpointer exception. 2. I am not sure if my logic is correct. Below is the Code. Thanks!!
    public void insertRecord()
    if (MyEmpArray[0] == null )
    addRec(0);
    else
    for(int index =0; index <3; index++)
    if(intEmpNumber < MyEmpArray[index].intEmpNumber && MyEmpArray[3] != null )
    addRec(index);
    else
    lblErrorMessage.setText("Array is full");
    public void addRec(int index)
    MyEmpArray[index].setValues(intEmpNumber, strFirstName, strLastName, strHomePhone,
    strStreet, strCity, strState, strZip, strCountry, strWorkStreet,
    strWorkCity, strWorkState, strWorkZip, strWorkCountry, strWorkPhoneNum,
    fltNumHours, fltHourlyWage, intI, intJ, intK);
    lblErrorMessage.setText("");
    txaReport.setText("");
    ClearFields();
    }

    for(int index =0; index <3; index++)
    An array with an index from 0 to 3, contains 4 records: you should replace it with
    for(int index =0; index <2; index++)
    The check-logic is good enough, but there are two minor "bugs":
    1) even If the array is full, the for cycle will uselessly check all the records
    2) if a the employee number of intEmpNumber is > thanMyEmpArray[index].intEmpNumber the program will show up "Array is full" even if the array isn't full.
    So, I suggest to add more code to make distinction between the two cases:
    for(int index =0; index <3; index++)
    if(MyEmpArray[3] != null ) // check if there is space to add a record
    if (intEmpNumber < MyEmpArray[index].intEmpNumber) //check if the position is right
    addRec(index);
    else
    lblErrorMessage.setText("Array is full");
    break; // exit the for cicle as the array is full
    I don't know what you are programming, but I ask you: "If the new intEmpNumber is < than the intEmpNumber of an already-full-array shouldn't be the new record inserted, discarding the last one?"
    I don't know if addRec works, I'm don't know applets, buttons..:)
    Sorry for my bad english...I hope this post will help you anyway :)

Maybe you are looking for