Using Insert command

Hi Experts
I need to insert values in a oracle database could u please give me the EJB code for it

hi
good
check this code,
// Insert1.java:  Demonstrates how to INSERT data into an SQL
//               database using Java JDBC.
// Copyright 1998 Developer's Daily (http://www.DevDaily.com). All rights reserved.
import java.sql.*;
class Insert1 {
    public static void main (String[] args) {
        try {
            String url = "jdbc:msql://200.210.220.1:1114/Demo";
            Connection conn = DriverManager.getConnection(url,"","");
            Statement st = conn.createStatement();
            st.executeUpdate("INSERT INTO Customers " +
                "VALUES (1001, 'Simpson', 'Mr.', 'Springfield', 2001)");
            st.executeUpdate("INSERT INTO Customers " +
                "VALUES (1002, 'McBeal', 'Ms.', 'Boston', 2004)");
            st.executeUpdate("INSERT INTO Customers " +
                "VALUES (1003, 'Flinstone', 'Mr.', 'Bedrock', 2003)");
            st.executeUpdate("INSERT INTO Customers " +
                "VALUES (1004, 'Cramden', 'Mr.', 'New York', 2001)");
            conn.close();
        } catch (Exception e) {
            System.err.println("Got an exception! ");
            System.err.println(e.getMessage());
http://www.devdaily.com/java/edu/pj/jdbc/jdbc0002/
reward point if helpful.
thanks
mrutyun^

Similar Messages

  • Using insert command in NVL function

    How can we use insert command in a NVL function
    exapmle : INSERT INTO employee
    VALUES ( (NVL ( (SELECT emp_id
    FROM employee
    WHERE emp_name LIKE 'Test'),
    (insert into employee values((select max(emp_id)+1 from employee),'Test')))));
    I mean i will check for the record to exist in the table and if not exist i will add it to the table.

    998504 wrote:
    How can we use insert command in a NVL function
    exapmle : INSERT INTO employee
    VALUES ( (NVL ( (SELECT emp_id
    FROM employee
    WHERE emp_name LIKE 'Test'),
    (insert into employee values((select max(emp_id)+1 from employee),'Test')))));
    I mean i will check for the record to exist in the table and if not exist i will add it to the table.The first thing caught my eye is this
    max(emp_id) +1A real bad piece of code. Never do that. Ever thought about multi user environment? Use a SEQUENCE.
    If you want EMP_NAME to be unique (Which looks strange to me), then just add a UNIQUE constraint. You dont try to do what oracle already does really well.

  • How to insert multiple rows in a single shot using insert command?

    Hi,
    If we insert one row, we can use "insert into" command. I want to insert multiple rows into the table in a single shot. Is there any SQL command for insert multiple rows into the table?
    Plese give the solution.
    Thanks,
    chelladurai

    If you would like to do it with SQL, this would be one of the ways to achive it:
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 25 10:12:59 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    SQL>
    SQL> desc leap
    Name                                      Null?    Type
    FIRST_PRICE                                        NUMBER(16,6)
    NEXT_PRICE                                         NUMBER(16,6)
    SQL>
    SQL> select * from leap;
    no rows selected
    SQL>
    SQL>
    SQL> !vi multirow_insert.sql
    SQL> !cat multirow_insert.sql
    insert into leap(first_price, next_price) values (1,2);
    insert into leap(first_price, next_price) values (3,4);
    insert into leap(first_price, next_price) values (5,6);
    SQL>
    SQL> @multirow_insert.sql
    1 row created.
    1 row created.
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL>
    SQL> select * from leap;
    FIRST_PRICE NEXT_PRICE
              1          2
              3          4
              5          6
    SQL>

  • How to insert huge XML in CLOB using insert command in sql*plus....

    How to upload huge XML into a CLOB column of a normal table using a script?
    A simple insert statement does not seem to work.
    Thanks & regards.

    In SQL *Plus i'm trying to insert directly into the table.
    My insert statement is like below :
    Insert into ui_templates
    (TEMPLATE_ID, TEMPLATE_NAME, CUSTOMER_ID, DESCRIPTION, XML_CONTENT)
    Values
    (1, 'Default', 1, 'Main Default Template', '<?xml version="1.0" encoding="utf-8"?><xoraLayout:Layout name="MyLayout" version="1.0" ................<3357> chars long');
    COMMIT;
    Message was edited by:
    DKar

  • Getting syntax error when i using INSERT command

    Hi,
    i am using MS Access DB. Table name is "Timesheet". the table has the following Fields,
    uname - Text
    date - Text
    intime - Text
    outtime - Text
    duration - Text
    desc - Text
    i am using preparedStatment,
    String accessDBURLPrefix = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    String accessDBURLSuffix = ";DriverID=22;READONLY=false}";
    String filename="D:\\TimeSheet\\TimeDB.mdb"
    String databaseURL = accessDBURLPrefix + filename + accessDBURLSuffix;
    Connection con = DriverManager.getConnection(databaseURL);
    PreparedStatment st = con.prepareStatement("INSERT INTO (uname, date, intime) TimeSheet VALUES (?,?,?)");
    st.setString(1,user);
    st.setString(2,date);
    st.setString(3,intime);
    st.executeUpdate();
    }if i am going to compile this code i will get SQLException
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3150)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:136)
         at TimeSheetDemo.writeToDB(TimeSheetDemo.java:84)
         at TimeSheetDemo.main(TimeSheetDemo.java:37)
    Really i have tired to figure out this problem. please help me anyone.
    thank you

    Thank you. it was my careless mistake. i changed that mistake. but still it is not working, get same exception.
    st = con.prepareStatement("INSERT INTO  TimeSheet (uname, date, intime) VALUES (?,?,?)");suppose, if i will give values for all fields, it will work fine, example
    st = con.prepareStatement("INSERT INTO  TimeSheet  VALUES (?,?,?,?,?,?)");
    st.setString(1,user);
    st.setString(2,date);
    st.setString(3,intime);
    st.setString(4,outtime);
    st.setString(5,duration);
    st.setString(6,descrip);
    st.executeUpdate();But my problem is i want to insert the values for only 3 fields.
    give me the solution for inserting values for specified fields

  • How to use Insert for mulit-values

    Can anyone help, I try to insert mulit-values using insert command. but keep getting error. here is the code.
    INSERT INTO PRODUCTS
    VALUES (
    'C','CABLE',39.95,
    'D','DSL',29.95,
    'U','DIALUP_56K',19.95);
    Thank you!

    The SQL you posted isn't valid, assuming that there are only three columns in your table. The type of insert statement you posted can only insert 1 row at a time.
    You could look into loading data into collections and using the bulk insert syntax to insert multiple values in a single statement. Please post to the PL/SQL forum if you need more assistance on this.
    Justin

  • How to overcome Dump during Insert Command

    Hi Abappers,
    When I am trying to upload the text file into the Database,
    I am using Insert command using internal table.
    When the record exist, it gives dump saying duplicate records.
    How to convert that dump into the error message?
    Please Reply.
    Regards,
    Rahul

    Rahul,
    Insert FROM TABLE itab [ACCEPTING DUPLICATE KEYS]
    Effect
    If you specify an internal table itab, several rows are created from its content for insertion in the database table. A row for insertion into the table is taken from each row of the internal table according to the same rules as for a single work area Einfügenwa. The line type of the internal table has to meet the prerequisites for use in Open-SQL statements.
    If a row witht he same primary key or a same unique secondary index does not already exist in the database table for any of the rows to be inserted, all rows are inserted and sy-subrc is set to 0. If the internal table is empty, sy-subrc is also set to 0. The system field sy-dbcnt is always set to the number of rows that were actually inserted.
    If a row with the same primary key or a same unique secondary index already exists in the database table for one or more of the rows to be inserted, these rows cannot be inserted. In this situation, there are three possibilities:
    Use of ACCEPTING DUPLICATE KEYS
    If the addition ACCEPTING DUPLICATE KEYS is specified, all rows are inserted for which this is possible. The remaining rows are rejected and sy-subrc is set to 4. The system field sy-dbcnt is set to the number of lines that are inserted.
    Handling an exception
    If the addition ACCEPTING DUPLICATE KEYS is not specified, a treatable exception occurs CX_SY_OPEN_SQL_DB (it always occurs since Release 6.10). Rows are inserted until the exception occurs. The number of rows that are inserted is not defined. The system fields sy-subrc and sy-dbcnt retain their previous value.
    Runtime error
    If the addition ACCEPTING DUPLICATE KEYS is not specified and if the exception is not handled, then a runtime error occurs (it always occurs prior to Release 6.10). This executes a database rollback that reverses all changes to the current database LUW. This applies in particular to rows that were inserted before a double entry occurred.
    i would also suggest you to see SAP help by pressing F1 because some time may we miss but SAP never.
    Amit.

  • To check a record for existence in dbtable before using insert

    Hi Experts:
    My problem is that i have defined a foreign key in the Z database table and if i create entries directly through SE11, the check executes finely, but is i use insert command through module pool, all the entries are saved and the foreign key check is not executed.
    Eg I want to check the plant entry in T001w, if it is there, only then that record should be saved, otherwise error message that please check your entry,
    Is there any possiblity without using internal table.
    Can we read through dbtable as we can in case of internal table?
    Best Regards, Neetu

    You could do a select single from T001W before you Insert into your Z table to see if the entry exists.  However, if you are doing multiple inserts it is more efficient to do a single load of the T001W records into an internal table, sort it and da a read using binary search.
    I think T001W is fully buffered (a lot of these type of tables are) so the select is going to be reasonably efficient.
    Andrew

  • Using textboxes in insert command

    Sir,
    I had a doubt about insert command while I was trying to give the content of the swing text boxes as the arguments to the insert command.Is it possible?.How can i give values to the fields of a table through GUI components.

    Hi,
    I meant using text boxes in insert statement.because all time we should not give literals.we should have got inputs from swing panel from which we have to
    insert data into tables.So I asked how can i give variables or input GUI Components as arguments of insert statement. Also I gave the code below
    //CRM Sections Campaign
    //package marketing;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class CRM_Marketing_1B extends JFrame implements ActionListener
    JOptionPane joptMessage;
    JButton jbtnSave;
    JButton jbtnClear;
    JButton jbtnExit=new JButton("Exit");
    public CRM_Marketing_1B(String title)
    Container conMarketingPane=getContentPane();
    conMarketingPane.setLayout(new FlowLayout());
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLabel lblCustomer_Id=new JLabel("Customer ID");
    JLabel lblCustomer_Name=new JLabel("Customer Name");
    JLabel lblCompany_Name=new JLabel("Company Name");
    JLabel lblDesignation=new JLabel("Designation");
    JLabel lblAddress1=new JLabel("Address1");
    JLabel lblAddress2=new JLabel("Address2");
    JLabel lblQuantity=new JLabel("Quantity");
    JLabel lblUnit_Price=new JLabel("Unit Price");
    JLabel lblInterest_Level=new JLabel("Interest Level");
    JLabel lblContact_No=new JLabel("Contact No");
    JLabel lblMobile_No=new JLabel("Mobile No");
    JLabel lblEmail=new JLabel("Email Address");
    JLabel lblEmployee_Id=new JLabel("Employee ID");
    JLabel lblCampaign_Date=new JLabel("Campaign Date");
    JLabel lblNext_Appointment=new JLabel("Next Appointment");
    JLabel lblCampaign_Id=new JLabel("Campaign ID");
    JLabel lblTeam_Id=new JLabel("Team ID");
    JLabel lblOrder_No=new JLabel("Order No");
    JLabel lblResult=new JLabel("Result");
    JTextField txfCustomer_Id=new JTextField(30);
    JTextField txfCustomer_Name=new JTextField(30);
    JTextField txfCompany_Name=new JTextField(30);
    JTextField txfDesignation=new JTextField(30);
    JTextField txfAddress1=new JTextField(30);
    JTextField txfAddress2=new JTextField(30);
    JTextField txfQuantity=new JTextField(30);
    JTextField txfUnit_Price=new JTextField(30);
    JTextField txfInterest_Level=new JTextField(30);
    JTextField txfContact_No=new JTextField(30);
    JTextField txfMobile_No=new JTextField(30);
    JTextField txfEmail=new JTextField(30);
    JTextField txfEmployee_Id=new JTextField(30);
    JTextField txfCampaign_Date=new JTextField(30);
    JTextField txfNext_Appointment=new JTextField(30);
    JTextField txfCampaign_Id=new JTextField(30);
    JTextField txfTeam_Id=new JTextField(30);
    JTextField txfOrder_No=new JTextField(30);
    JTextField txfResult=new JTextField(30);
    JButton jbtnSave=new JButton("Save");
    JButton jbtnClear=new JButton("Clear");
    JButton jbtnExit=new JButton("Exit");
    conMarketingPane.add(lblCustomer_Id);
    conMarketingPane.add(lblCustomer_Name);
    conMarketingPane.add(lblCompany_Name);
    conMarketingPane.add(lblDesignation);
    conMarketingPane.add(lblAddress1);
    conMarketingPane.add(lblAddress2);
    conMarketingPane.add(lblQuantity);
    conMarketingPane.add(lblUnit_Price);
    conMarketingPane.add(lblInterest_Level);
    conMarketingPane.add(lblContact_No);
    conMarketingPane.add(lblMobile_No);
    conMarketingPane.add(lblEmail);
    conMarketingPane.add(lblEmployee_Id);
    conMarketingPane.add(lblCampaign_Date);
    conMarketingPane.add(lblNext_Appointment);
    conMarketingPane.add(lblCampaign_Id);
    conMarketingPane.add(lblTeam_Id);
    conMarketingPane.add(lblOrder_No);
    conMarketingPane.add(lblResult);
    conMarketingPane.add(txfCustomer_Id);
    conMarketingPane.add(txfCustomer_Name);
    conMarketingPane.add(txfCompany_Name);
    conMarketingPane.add(txfDesignation);
    conMarketingPane.add(txfAddress1);
    conMarketingPane.add(txfAddress2);
    conMarketingPane.add(txfQuantity);
    conMarketingPane.add(txfUnit_Price);
    conMarketingPane.add(txfInterest_Level);
    conMarketingPane.add(txfContact_No);
    conMarketingPane.add(txfMobile_No);
    conMarketingPane.add(txfEmail);
    conMarketingPane.add(txfEmployee_Id);
    conMarketingPane.add(txfCampaign_Date);
    conMarketingPane.add(txfNext_Appointment);
    conMarketingPane.add(txfCampaign_Id);
    conMarketingPane.add(txfTeam_Id);
    conMarketingPane.add(txfOrder_No);
    conMarketingPane.add(txfResult);
    conMarketingPane.add(jbtnSave);
    conMarketingPane.add(jbtnClear);
    conMarketingPane.add(jbtnExit);
    setSize(900,900);
    setVisible(true);
    lblCustomer_Id.setLocation(50,50);
    lblCustomer_Name.setLocation(50,70);
    lblCompany_Name.setLocation(50,90);
    lblDesignation.setLocation(50,110);
    lblAddress1.setLocation(50,130);
    lblAddress2.setLocation(50,150);
    lblQuantity.setLocation(50,170);
    lblUnit_Price.setLocation(50,190);
    lblInterest_Level.setLocation(50,210);
    lblContact_No.setLocation(50,230);
    lblMobile_No.setLocation(50,250);
    lblEmail.setLocation(50,270);
    lblEmployee_Id.setLocation(50,290);
    lblCampaign_Date.setLocation(50,310);
    lblNext_Appointment.setLocation(50,330);
    lblCampaign_Id.setLocation(50,350);
    lblTeam_Id.setLocation(50,370);
    lblOrder_No.setLocation(50,390);
    lblResult.setLocation(50,410);
    txfCustomer_Id.setLocation(250,50);
    txfCustomer_Name.setLocation(250,70);
    txfCompany_Name.setLocation(250,90);
    txfDesignation.setLocation(250,110);
    txfAddress1.setLocation(250,130);
    txfAddress2.setLocation(250,150);
    txfQuantity.setLocation(250,170);
    txfUnit_Price.setLocation(250,190);
    txfInterest_Level.setLocation(250,210);
    txfContact_No.setLocation(250,230);
    txfMobile_No.setLocation(250,250);
    txfEmail.setLocation(250,270);
    txfEmployee_Id.setLocation(250,290);
    txfCampaign_Date.setLocation(250,310);
    txfNext_Appointment.setLocation(250,330);
    txfCampaign_Id.setLocation(250,350);
    txfTeam_Id.setLocation(250,370);
    txfOrder_No.setLocation(250,390);
    txfResult.setLocation(250,410);
    jbtnSave.setLocation(250,450);
    jbtnClear.setLocation(350,450);
    jbtnExit.setLocation(450,450);
    txfCustomer_Id.setRequestFocusEnabled(true);
    txfCustomer_Id.requestFocus();
    jbtnSave.addActionListener(this);
    jbtnClear.addActionListener(this);
    jbtnExit.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
    if(ae.getSource().equals(jbtnSave))
    //' &txfAddress1& ',' &txfAddress2& ',' &txfQuantity& ',
    //' &txfUnit_Price& ',' &txfInterest_Level& ',' &txfContact_No& ',
    //' &txfMobile_No& ',' &txfEmail& ',' &txfEmployee_Id& ',' &txfCampaign_Date& ',
    //' &txfNext_Appointment& ',' &txfCampaign_Id& ',' &txfTeam_Id& ',' &txfOrder_No& ',' &txfResult& '
    try
    Class.forName("jdbc.odbc.JdbcOdbcDriver");
    Connection connCampaign=DriverManager.getConnection("jdbc:odbc:CRMSource");
    Statement stmtCampaign=connCampaign.createStatement();
    /* stmt.executeUpdate("insert into Campaign values('" &jtxfCustomer_ID& "',&jtxfCustomer_Name&,
    ' &jtxfCustomer_ID& ',' &txfCompany_Name& ',' &txfDesignation& ',' &txfAddress1& ',' &txfAddress2& ',
    ' &txfQuantity& ',' &txfUnit_Price& ',' &txfInterest_Level& ',' &txfContact_No& ',
    ' &txfMobile_No& ',' &txfEmail& ',' &txfEmployee_Id& ',' &txfCampaign_Date& ',
    ' &txfNext_Appointment& ',' &txfCampaign_Id& ',' &txfTeam_Id& ',' &txfOrder_No& ',' &txfResult& ')");*/
    JOptionPane.showMessageDialog(this,"Statement was saved");
    catch(Exception ex)
    ex.printStackTrace();
    I got "unclosed character literal" error when i tried to execute the above java source file .
    help me to get the required result.

  • Using INSERT INTO for FDM Memory Issue

    All -
    We configured FDM to run an integration script into our EBS instance upon the import step. It worked fine for a time, then we began running out of memory on the FDM server. Upon Oracle's suggestion, we stopped running through a record set to append and update the values to strWorkTableName and instead began using INSERT INTO. I admit, I have never needed to use the INSERT INTO way of doing things so I may be missing something bery basic.
    Our integration script:
    Function SQLIntegration2(strLoc, lngCatKey, dblPerKey, strWorkTableName)
    'Oracle Hyperion FDM IMPORT Integration Script:
    'Created By:       karks
    'Date Created:       2011-10-26 13:05:18
    'Purpose:
    Dim strSQL     'SQL string
    Dim lngPartitionKey
    Dim strConn 'Connection string to the source data
    Set cnSS = CreateObject("ADODB.Connection")
    lngPartitionKey = RES.PlngLocKey
    strConn= "File Name=C:\Users\karksadm\Desktop\NewConnection.udl;"
    cnSS.open strConn
    strSQL = "Insert Into " & strWorkTableName & " (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) "
    strSQL = strSQL & "SELECT " & lngPartitionKey & ", " & lngCatKey & ", TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & "), 'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, '[None]', EBS.CURRENCY_CODE FROM "
    strSQL = strSQL & "(Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, 'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, "
    strSQL = strSQL & "(SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE "
    strSQL = strSQL & "FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D "
    strSQL = strSQL & "WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR "
    strSQL = strSQL & "And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = 'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME "
    strSQL = strSQL & "And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = 'USD' And D.LEDGER_ID = 2022) "
    strSQL = strSQL & "And C.END_DATE = TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & ") "
    strSQL = strSQL & "And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = 'A' "
    strSQL = strSQL & "And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 "
    strSQL = strSQL & "GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 "
    strSQL = strSQL & "ORDER BY B.SEGMENT4) EBS"
    DW.DataManipulation.fExecuteDML(strSQL)
    'Give success message
    RES.PlngActionType = 2
    RES.PstrActionValue = "SQL Import successful!"
    'Assign Return value
    SQLIntegration2 = True
    cnSS.close
    Set cnSS = Nothing
    End FunctionI can run the SQL minus the Insert line in my SQL Developer and it works fine. When I run the script in its entirety in FDM, we receive the following:
    ** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:30] **
    ERROR:
    Code............................................. -2147217865
    Description...................................... ORA-00942: table or view does not exist
    Insert Into tWibison72564424799 (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) SELECT 772, 28, TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724), N'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, N'[None]', EBS.CURRENCY_CODE FROM (Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, N'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, (SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = N'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = N'USD' And D.LEDGER_ID = 2022) And C.END_DATE = TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724) And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = N'A' And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,N'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 ORDER BY B.SEGMENT4) EBS
    Procedure........................................ clsDataManipulation.fExecuteDML
    Component........................................ upsWDataWindowDM
    Version.......................................... 1112
    Thread........................................... 4424
    IDENTIFICATION:
    User............................................. ibisons
    Computer Name.................................... HOU-HYSDEV02
    App Name......................................... SWNFDMRC
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... FDMDEV
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... EBSINTEGRATION
    Location ID...................................... 772
    Location Seg..................................... 25
    Category......................................... EBS2
    Category ID...................................... 28
    Period........................................... Jun - 2011
    Period ID........................................ 6/30/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
    ERROR:
    Code............................................. -2147217865
    Description...................................... Data access error.
    At line: 33
    Procedure........................................ clsImpProcessMgr.fExecuteImpScript
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 4424
    IDENTIFICATION:
    User............................................. ibisons
    Computer Name.................................... HOU-HYSDEV02
    App Name......................................... SWNFDMRC
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... FDMDEV
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... EBSINTEGRATION
    Location ID...................................... 772
    Location Seg..................................... 25
    Category......................................... EBS2
    Category ID...................................... 28
    Period........................................... Jun - 2011
    Period ID........................................ 6/30/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
    ERROR:
    Code............................................. -2147217865
    Description...................................... Data access error.
    At line: 33
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 4424
    IDENTIFICATION:
    User............................................. ibisons
    Computer Name.................................... HOU-HYSDEV02
    App Name......................................... SWNFDMRC
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... FDMDEV
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... EBSINTEGRATION
    Location ID...................................... 772
    Location Seg..................................... 25
    Category......................................... EBS2
    Category ID...................................... 28
    Period........................................... Jun - 2011
    Period ID........................................ 6/30/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    I really think the issue is that I am not telling the script where to find the Oracle tables at. I left the code in where we were using the UDL to call in the opening of the record set, but since we are doing away with the record set how do I let FDM know where to find the Oracle tables?
    Thanks in advance - I've been wrestling with this for several days.
    Thanks you,
    Sarah

    Here's a script with INSERT INTO that works fine if FDM back-end is SQL DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
    Problem is when FDM back-end is Oracle DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
    I'm assuming the INSERT INTO statement needs to be written differently, syntax wise?
    Here's the error message displayed.
    ** Begin FDM Runtime Error Log Entry [2012-06-03 21:18:15] **
    ERROR:
    Code............................................. -2147217900
    Description...................................... ORA-00933: SQL command not properly ended
    INSERT INTO tWadmin476032843931 (PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) SELECT 752, 12, N'30-Apr-2012', N'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount FROM FDMHarris.dbo.tdataseg4;
    Procedure........................................ clsDataManipulation.fExecuteDML
    Component........................................ upsWDataWindowDM
    Version.......................................... 1112
    Thread........................................... 3284
    Function INSERTINTO(strLoc, lngCatKey, dblPerKey, strWorkTableName)
    'Oracle Hyperion FDM IMPORT Integration Script:
    'Created By:      admin
    'Date Created:      2012-06-03 11:31:39
    'Purpose:
    Dim objSS 'ADODB.Connection
    Dim strSQL 'SQL String
    Dim rs 'Recordset
    Dim rsAppend 'tTB table append rs Object
    Dim strPeriod
    Dim strYear
    'Period
    'strPeriod=MonthName(Month(RES.PdtePerKey))
    a=CStr(FormatDateTime(RES.PdtePerKey,1))
    'Tuesday,January 30, 2012
    b=Right(a,(Len(a)-Len(DW.Utilities.fParseString(a,1,1,",")))) '7
    c=DW.Utilities.fParseString(b,2,2,",")
    strPeriod=Left(c,3)
    'Year
    'strYear=Year(RES.PdtePerKey)
    strYear=Right(b,4)
    DW.DBTools.mLogError 1, CStr(strPeriod), CStr(strYear), Nothing
    'Initialize objects
    Set cnSS = CreateObject("ADODB.Connection")
    'Connect To SQL Server database
    cnss.open "Provider=SQLOLEDB.1;Password=datafusion;Persist Security Info=True;User ID=sa;Initial Catalog=FDMHarris;Data Source=dfv11122"
    'DW.DBTools.mLogError 1, CStr(strSQL), CStr(strSQL), Nothing
    'Initialize common SQL statement
    strSQL = "INSERT INTO " & _
    strWorkTableName & " " & _
    "(PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) " & _
    "SELECT " & RES.PlngLocKey & ", " & RES.PlngCatKey & ", " & _
    "'" & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & "', " & _
    "'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount " & _
    "FROM FDMHarris.dbo.tdataseg4;" '& _
    ' "WHERE Month = '" & strPeriod & "' And CalYear = '" & strYear & "'"
    DW.DBTools.mLogError 1, CStr(strSQL), CStr(strWorkTableName), Nothing
    DW.DataManipulation.fExecuteDML(strSQL)
    'cnss.Execute strSQL
    'Records loaded
    RES.PlngActionType = 6
    RES.PstrActionValue = "SQL Import successful!"
    'Assign Return value
    INSERTINTO = True
    cnss.Close
    Set cnss = Nothing
    End Function
    Edited by: user12152138 on Jun 3, 2012 6:43 PM

  • IDOC to JDBC scenario: Does INSERT command expect a result value?

    Hello,
    we have an IDoc-to-JDBC-scenario configured on our XI 3.0, which uses the INSERT command to put a dataset coming from R/3 into a SQL database. This works fine.
    Now a trigger has been activated on the database, which sets a flag to each dataset after inserting.
    Because of this a system error occurs in the Adapter Engine and I found in the AuditLog (logSQLStatement=true), that the INSERT command is processed correcty, but in the next step an error is shown up: 'SQLServerException. A result set was generated for update.'
    Could it be, that the trigger returns a result value, which can't be handled on the XI ?
    If yes, how can I solve this issue? I have read something about the different methods execute(), executeUpdate() and executeQuery(), but I don't know how and where this has to be configured...
    Thanks in advance,
    Juergen

    Hi Upendra,
    I got some more information from the database adminstrator:
    He used the following command 'exec xp_cmdshell @ExportCmd , no_output'
    whereas @ExportCmd contains the command.
    With the no_output option, the xp_cmdshell does not return a recordset.
    I hope this will be helpful to you.
    Grtz,
    Juergen

  • SISS package output using DTEXEC command

    Hello,
    I need a help in executing SISS package using DTEXEC command
    Here is the command i use
    DTEXEC.EXE /F "C:\\excel_to_table.dtsx" /set \package.variables[filepath].Value;"C:\sample.xlsx" /set \package.variables[servername].Value;"000.000.000.0" /set \package.variables[database].Value;"Databasename" /set \package.variables[username].Value;"username" /set \package.variables[password].Value;"password"
    In the package, I'm inserting the rows into a table. Now i want to display the number of records imported and number of  duplicate records. Is it possible to get the values and display as result in command prompt.
    Please advice.
    Thanks,
    Venkat.
    Best Regards, Venkat

    Hi Venkat,
    According to your description, you want to display the row count information in the result of the DTEXEC commands in the Command Prompt. If so, this cannot be done through the DTEXEC utility.
    If you can run other commands after the DTEXEC commands, you can first store the row count information to a SQL Server table using the methods posted by Jay and Visakh, and then run sqlcmd commands to display the data of a SQL Server table like:
    sqlcmd -S localhost -d TestDB -Q "SELECT * FROM MyTable"
    Reference:
    https://www.simple-talk.com/sql/sql-tools/sql-server-sqlcmd-basics/ 
    Regards,
    Mike Yin
    TechNet Community Support

  • Need Help Can i use Merge command along with exist function in oracle?

    I am using Merge command to update the destination table and updating the rows which are already in the destination table.
    But what i want is to delete the existing rows from the destination table and insert fresh rows instead of updating the existing rows in the destination table.
    So can we use exist function to check the existing rows and delete them and use merge command to insert the rows in the table.

    You definitely need to do a DELETE then INSERT since MERGE will not delete rows, although I'm not really sure what that gets you since the net effect would be the same as a MERGE over the same pair of tables.
    If you really want to do it this way, then I would likely do something like:
    DELETE FROM target_table
    WHERE (columns_you_would_match_on) IN (SELECT columns_you_would_match_on
                                           FROM source_table
                                           WHERE predicate_you_would_use_in_using);
    INSERT INTO target_table (column_list)
    SELECT column_list
    FROM source_table
    WHERE predicate_you_would_use_in_using;John

  • To handle cursor position in table control while using insert initial line

    hi,
          I have a requirement to handle cursor position in my table control in which i am using insert initial line by incrementing the index. Now i am handling the cursor position by using set cursor but after 14 records it is going to the first field of the screen. My table control length is 14 records.
          How to handle this, please reply me if anyone know.
    thanks & regards,
        sekhar.

    hi,
             I need to page down the page and then want to set cursor position but for this system command i am getting space for every command. Page down and cursor down or enter every thing it is taking as space. So for this how can i handle it.
    thanks & regards,
        sekhar.

  • Can I use Voice Commands (Speech) to control the DVD Player?

    Problem: I want to insert a DVD in the the DVD drive and use voice commands to stop, pause, play, move forward, move back, and quit the DVD Player. Is this possible? If so how would I do this?
    Thanks in advance for your help.
    Jim Minor

    You can create a speakable item. Use AppleScript Editor (Applications > Utilities > AppleScript Editor) to write the appropriate AppleScript to perform the desired action, and give it a name which is the command you want to speak. Then, make a subdirectory in the Speakable Items directory named "DVD Player" and copy your script to it. You should be able to speak the name of the script when DVD Player is in the foreground and have the script execute.
    An example script (Play.scpt):
    tell application "DVD Player"
    play dvd
    end tell
    Other commands that the DVD Player application understands:
    fast forward dvd
    pause dvd
    rewind dvd
    stop dvd
    step dvd
    go to \[ main menu / title menu / subpicture menu / audio menu / angle menu / beginning of disc \]
    press \[ up arrow key / down arrow key / left arrow key / right arrow key / enter key \]
    open VIDEO_TS
    open dvd video folder
    play next chapter
    play bookmark
    play named bookmark
    play video clip
    play named video clip
    exit clip mode
    obscure cursor
    eject dvd
    The DVD Player application also has a bunch of properties related to chapters, titles, subtitles, etc.

Maybe you are looking for

  • "HP laserjet professional utility" does not work in osx 10 (Yosemite)

    All the major functions of this printer work fine in Yosemite, but not the "HP laserjet professional utility"The driver shown in System Preferences/Printer for my Laserjet P1606dn is version 6.9 (I am unable to knowif this is the version provided by

  • Illustrator vs. InDesign for a VERY early starter

    Hello, I'm a highschooler and I am just starting to get into some Graphic Design. I've always done lots of drawing and other art, but I'm just starting on graphic design. Up to this point, I've only used some freeware online like SumoPaint and a prog

  • Apple Contacts Uses a lot of RAM?

    Since installing Mt Lion, and when running Contacts, I keep getting a lot of diskactivity, machine slows way down, and this one app uses 5GB of 6GB ram. What is going on?

  • IDoc adapter with Non SAP systems

    SAP XI 3.0 help says: You can use the IDoc adapter to connect SAP systems (as of release 3.1) and non-SAP systems with the Integration Server using native IDoc structures What does this mean? -Naveen.

  • Moving controlfiles in Oracle DB 10.2.0.4

    Dear Expert, <br><br> Please help me, how to move controlfile from C:\oracle\CE2\origlogA\cntrl\filename.DBF to D:\oracle\CE2\origlogA\cntrl\filename.DBF.  We are using Windows Server 2003 64 bit, and Oracle 10.2.0.4. Please guide me <br><br> Regards