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

Similar Messages

  • I have a Nikon AW100 and I use a SanDisk for the memory and I download that with My Pictures and Videos but I cant get my videos onto IMovie

    I have a Nikon AW100 and I use a SanDisk for the memory and I download that with My Pictures and Videos but I cant get my videos onto IMovie

    Hi
    I import all from my Nikon - into iPhoto
    Then closing it and opening iMovie
    In the Event window like
    • iPhoto-videor - Here I find mine.
    Yours Bengt W

  • How to use INSERT INTO ALL statement in jdbc prepared statement with beans

    Kindly give me some example that how we can use "INSERT INTO ALL STATEMENT" in jdbc prepared statement inside a jsf bean?
    Actually i want to take employee id's of present employees using single jsf page and using one textbox for each employee id.
    How can i use INSERT INTO ALL statement to achieve this?
    Following is my code snippet.
    AttendanceBean.java:
    public class AttendanceBean {
    private int atteid;
    private String attdname;
    private int attday;
    private int attmonth;
    private int attyear;
    public static Connection getAttConnection() throws Exception {
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@localhost:1521:globldb3";
    String username = "scott";
    String password = "tiger";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;
    public String addAttendance(){
    Connection conn = null;
    PreparedStatement pstmt = null;
    boolean committed = false;
    try {
    conn = getAttConnection();
    conn.setAutoCommit(false);
    String query = "INSERT ALL INTO attendance VALUES (?,?,?,?,?)";
    pstmt = conn.prepareStatement(query);
    pstmt.setInt(1,this.atteid);
    pstmt.setString(2,this.attdname);
    pstmt.setInt(3,this.attday);
    pstmt.setInt(4,this.attmonth);
    pstmt.setInt(5,this.attyear);
    pstmt.executeUpdate();
    conn.commit();
    conn.setAutoCommit(true);
    committed = true;
    return "home.xhtml";
    } catch (Exception e) {
    e.printStackTrace();
    return "CRM.xhtml";
    } finally {
    try{
    if (!committed) conn.rollback();
    if (pstmt != null) pstmt.close();
    if (conn != null) conn.close();
    }catch(Exception e){
    e.printStackTrace();
    }

    Check this program for some info on Push buttons:
    1-DEMO_DYNPRO_PUSH_BUTTON
    2-DEMO_DYNPRO_MODULE
    3-DEMO_DYNPRO_ON_CONDITION
    Suppose Your screen is 101
    Then in that screen create one push button and assign it a function code.
    Now in the PAI of the 101 screen
    Create Module for user command
    Inside that module checc the sy-ucomm if sy-ucomm eq <Function code of your push button>
    Insert the values in database.
    *& Module USER_COMMAND_0101 INPUT
    process after input for screen 0101 *
    MODULE USER_COMMAND_0101 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    *Insert the values here
    WHEN 'DISP'.
    ENDCASE.
    CLEAR OK_CODE.
    ENDMODULE. " USER_COMMAND_0101 INPUT
    Regards
    Neha
    Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
    Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
    Edited by: Neha Shukla on Dec 3, 2008 1:06 AM

  • How do I insert cells using INSERT INTO & SET? (Excel oledb)

    Updating a cell works:
        oledbConnect = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\__\\test.xls;Extended Properties='Excel 12.0 Xml;HDR=NO;'");
        oledbConnect.Open();
        oledbCmd.Connection = oledbConnect;
        string stSheetName = "Sheet2";
        string sql;
        sql = "UPDATE [" + stSheetName + "$A1:B1] SET F1=1";
        oledbCmd.CommandText = sql;
        oledbCmd.ExecuteNonQuery();
    Inserting a cell does not:
        sql = "INSERT INTO [" + stSheetName + "$A2:B2] SET F1=2'";
        oledbCmd.CommandText = sql;
        oledbCmd.ExecuteNonQuery();
    I understand that inserting will add a new row ... but this doesn't work either.
        sql = "INSERT INTO [" + stSheetName + "$] SET F1=3";
        oledbCmd.CommandText = sql;
        oledbCmd.ExecuteNonQuery();
    bhs67

    Hi hbs67,
    No, we can't use Insert into with Set, it's the basic syntax in SQL statement. Give the worksheet a header row, then use Insert into or Update syntax with the field name.
    Check more information in this kb article:
    https://support.microsoft.com/en-us/kb/316934?wa=wsignin1.0
    If you have Office application installed on your machine, you could also automate the Excel files with Excel PIA:
    How to automate Microsoft Excel from Microsoft Visual C#.NET
    It's easy to insert or update cell values with the cell address.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using insert statements for creating objects..pls help

    Hello all,
    I have 2 databases DB1 (which is running on 8i) and DB2( Running on 10G).
    How can I copy all the objects of a particular schema (user1) from DB1 to DB2, only by using INSERT statements. I do not want to use import/export since it is taking huge time for the operation.
    Could anybody help me on this?
    Regards,
    chotu

    Since I have allready imported indexes,procedures etc , now I need only to copy tables from DB1 to DB2.
    I have truncated all the tables of user1 in DB2
    Now I am using,
    insert into my_tab as select * from user1.my_tab@DB2_db_link;
    Thanks for the help...
    chotu.

  • ORA-01461: can bind a LONG value only for insert into a LONG column - Issue

    We are getting an error from Oracle DB --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    The application was working fine with Oracle 10.2.0.4 and ojbc14 driver 10.2.0.1 Error occurs only after an upgrade to Oracle 10g 10.2.0.5. So after some googling, we found that a driver upgrade would eliminate this error. So the 10.2.0.5 version of the driver was used. But the ORA error still occurs. The readme of ojdb14.jar specified this - BUG 8847022 - ORA-01461: CAN BIND A LONG VALUE ONLY FOR INSERT INTO A LONG COLUMN
    The problem is that we are not able to reproduce this using a sample program however it is happening consistently in the client environment.
    we get the error ORA-01461, when the oracle version is upgraded to 10.2.0.5. This error occurs when we try to insert a file(BLOB) data with the file length greater than 4KB to a table.
    Exception trace
    uncategorized SQLException for SQL []; SQL state [72000]; error code [1461];
    --- The error occurred in nl/sss/gict/mcb/data/dao/config/StateQueries.xml.
    --- The error occurred while applying a parameter map.
    --- Check the setReceivedFile-InlineParameterMap.
    --- Check the statement (update failed).
    --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
    --- The error occurred in nl/sss/gict/mcb/data/dao/config/StateQueries.xml.
    --- The error occurred while applying a parameter map.
    --- Check the setReceivedFile-InlineParameterMap.
    --- Check the statement (update failed).
    --- Cause: java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Oracle version installed in acceptance:
    1 Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    2 PL/SQL Release 10.2.0.5.0 - Production
    3 CORE 10.2.0.5.0 Production
    4 TNS for Linux: Version 10.2.0.5.0 - Production
    5 NLSRTL Version 10.2.0.5.0 - Production

    Is the server running Java 1.4? If it is Java 5 or higher there is no need to keep using OJDBC14, you can upgrade to OJDBC5.
    If you cannot do that, then I ask you: why make this post? What are you expecting someone to do? Your problem is with the OJDBC driver, you are not going to get tech support for it in this Java programming forum.

  • How to use "insert into & select" in format search

    Hello,
    I am just wonderring whether you can help me solve this issue.
    I want to change the value of a field in the title area for a sales quotation. however, this field is not shown up on the interface.
    For example, there is a field in the title area, "OQUT.Ref1". You actually cannot see this field from the quotation interface or any other doc. Now I want to update the value of this field.
    What I am now trying to do is to create an field named "update" in the title area, use format search to update. the code for the command will be something like
    Insert into $[OQUT.Ref1.0]
    select $[OQUT.U_MFG#]
    here, U_MFG# is UDF. as you may understand, I want to copy the value in the U_MFG# to the field of "Ref1".
    However, when I run "Execute", it gives me error. I believe there is something wrong with the code of "Insert into $[OQUT.Ref1.0]
    Does anyone know how to write the code?
    many thanks
    Stanley

    Thanks both Suda and sagar. The reason I wanted to do this is because I wanted to have UDF info be shown on the  MS word-templated quotation document.
    As you know, when you click the word symbol, a word-templated doc will be generated. The client needs two completely different format of quotation printout. thus I plan to print one type from PLD and other type by clicking the Word symbol. but later, I found out that the UDF field cannot be selected on the MS word template, or only system fields.
    Thus, the only way I can do is to copy the value from udf to some unused sytem fields and then show that system fields on the MS word template.
    any idea do you have?
    I wanted to tell SAP that It is not useful if the udf fields cannot be inserted into word template.
    thanks
    Stanley

  • System getting hanged whilst using Insert into table select * from table

    I have a peculiar problem.
    I am using the below statements:
    Query 1:
    insert into table ppms.erin_out@ppms_dblink select * from erin_out;
    Query 2:
    insert into table ppms.erin_out@ppms_dblink values(23,'dffgg',12',dfdfdgg,dfdfdg);
    I am in 'interfaces' schema (testing server) and executing above statements. We have testing server and development server, both are identical, i.e one is clone of the other.
    ppms_dblink is created in interfaces schema. ppms_dblink points to different database server which has two schemas 'clarity' and 'ppms'. ppms_dblink is create through authentication details of clarity schema.
    erin_out table is created on ppms schema on the same dababase server pointed by ppms_dblink.
    Question is :
    TOAD hangs while running query 1.
    Query 2 is working perfectly.
    As I have pl/sql script which is using query 1. I want to know why query 1 is creating problem.
    If I use query 2 in my pl/sql query then it may create performance issue as i have to use cursor then.
    On clarity schema, I have insert, update, select, modify rights on ppms.erin_out.
    I have tried same queries from another database server.
    That is I tried queries from 'interfaces' schema of development server ( clone of the testing server ). Its working perfectly.
    Message was edited by:
    user484158

    Dhanchik:
    The table from which I select rows, to insert into table on dblink, is having only one record. It may contatin maximum 100 rows at a time because I am scheduling the procedure through daemon process. Anyway transaction is not more than 100 records. I am trying with just 1 record for testing.
    So 1) Problem is not about the cost, TOAD is getting hanged ( to insert 1 record, cost does not mean much)
    2) there is no large amount of data, so no question of deteriorated performance
    Aron Tunzi:
    I think that should not be problem, because I am able to insert a record through query 2.
    Warren Tolentino :
    I am testing with 1 record only. Its not performance issue.
    Message was edited by:
    &#2352;&#2330;&#2367;&#2340;

  • Problem inserting record using INSERT INTO

    I am an amateur web builder using some ColdFusion functionality to access information on an Access database. I know very little about ColdFusion syntax, but I'm using Dreamweaver CS3 to help generate most of the code. I'm working on an insert record page to create a user database with login information. I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Syntax error in INSERT INTO statement.
    The error occurred in C:\ColdFusion9\wwwroot\Everett\register.cfm: line 22
    Below is the entire page with line 22 (referenced in the error message) in red. Any ideas?
    <cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
    <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "register">
      <cfquery datasource="everettweb">  
        INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    VALUES (<cfif IsDefined("FORM.first_name") AND #FORM.first_name# NEQ "">
    <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.last_name") AND #FORM.last_name# NEQ "">
    <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.email") AND #FORM.email# NEQ "">
    <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
    , <cfif IsDefined("FORM.password") AND #FORM.password# NEQ "">
    <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_clob" maxlength="255">
    <cfelse>
    </cfif>
      </cfquery>
      <cflocation url="register_success.cfm">
    </cfif>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Everett Music Department, Everett, MA</title>
    <!-- InstanceEndEditable -->
    <style type="text/css">
    <!--
    body {
    background-color: #660000;
    -->
    </style>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    <!-- InstanceBeginEditable name="head" -->
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    <!-- InstanceEndEditable -->
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    a:link {
    color: #660000;
    a:visited {
    color: #A01D22;
    a:hover {
    color: #FFCC00;
    -->
    </style>
    <link href="main.css" rel="stylesheet" type="text/css" />
    </head>
    <body onload="MM_preloadImages('menu_about_over','menu_ensembles_over.jpg','menu_schools_over.j pg','menu_events_over.jpg','menu_faculty_over.jpg','menu_contacts_over.jpg','menu_home_ove r.jpg','menu_about_over.jpg','menu_links_over.jpg','menu_login_over.jpg')">
    <table width="960" align="center" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="3"><img src="top_border.jpg" width="960" height="20" align="top" /></td>
      </tr>
      <tr align="center">
        <td colspan="3"><a href="index.php"><img src="e_oval_top.jpg" height="100" width="270" border="0" /></a><a href="index.php"><img src="header.jpg" height="100" width="690" border="0" /></a></td>
      </tr>
      <tr>
        <td height="35" width="301"><a href="index.php"><img src="e_oval_bottom.jpg" height="35" width="234" border="0" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','menu_home_over.jpg',1)"><img src="menu_home.jpg" width="67" height="35" name="home" border="0" id="home" /></a></td>
        <td width="251"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('about','','menu_about_over.jpg',1)"><img src="menu_about.jpg" width="71" height="35" name="about" border="0" id="about" /></a>
            <ul>
              <li><a href="#">News</a></li>
              <li><a href="#">History</a></li>
              <li><a href="#">Media</a></li>
            </ul>
          </li>
          <li><a class="MenuBarHorizontal" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('ensembles','','menu_ensembles_over.jpg',1)"><img src="menu_ensembles.jpg" width="98" height="35" name="ensembles" border="0" id="ensembles" /></a>
            <ul>
              <li><a href="#">Band</a></li>
              <li><a href="#">Chorus</a></li>
              <li><a href="#">Strings</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('schools','','menu_schools_over.jpg',1)"><img src="menu_schools.jpg" width="82" height="35" name="schools" border="0" id="schools" /></a>
            <ul>
              <li><a href="#">Everett High School</a></li>
              <li><a href="#">English School</a></li>
              <li><a href="#">Keverian School</a></li>
              <li><a href="#">Lafayette School</a></li>
              <li><a href="#">Parlin School</a></li>
              <li><a href="#">Webster School</a></li>
              <li><a href="#">Whittier School</a></li>
            </ul>
          </li>
        </ul>
        </td>
               <td width="408"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('events','','menu_events_over.jpg',1)"><img src="menu_events.jpg" width="74" height="35" name="events" border="0" id="events" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('faculty','','menu_faculty_over.jpg',1)"><img src="menu_faculty.jpg" width="79" height="35" name="faculty" border="0" id="faculty" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('links','','menu_links_over.jpg',1)"><img src="menu_links.jpg" width="66" height="35" name="links" border="0" id="links" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('login','','menu_login_over.jpg',1)"><img src="menu_login.jpg" name="login" width="69" height="35" border="0" id="login" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','menu_contact_over.jpg',1)"><img src="menu_contact.jpg" width="100" height="35" name="contact" border="0" id="contact" /></a><img src="menu_spacer_end.jpg" width="20" height="35" /></td>
      </tr>
      <tr height="10">
        <td colspan="3"><img src="menu_bottom_spacer.jpg" height="10" width="960" /></td>
      </tr>
    </table>
    <table width="960" cellpadding="0" cellspacing="0" align="center">
      <tr height="50">
        <td width="30" background="left_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
        <td width="900" bgcolor="#FFFFFF">
          <table width="900" cellpadding="0" cellspacing="0">
            <tr>
              <td width="900" height="350" valign="top"><!-- InstanceBeginEditable name="PageBody" -->
          <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" name="register" preloader="no" id="register">
                <table width="100%">
                  <tr>
                    <td colspan="2" class="heading1">Fill in the information below to register for this site:</td>
                  </tr>
                  <tr>
                    <td colspan="2"><img src="clear.gif" height="15" /></td>
                  </tr>
                  <tr>
                    <td width="50%" class="form" align="right">First Name:</td>
                    <td width="50%"><span id="sprytextfield1">
                      <input type="text" name="first_name" required="yes" id="first_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Last Name:</td>
                    <td><span id="sprytextfield2">
                      <input type="text" name="last_name" required="yes" id="last_name" width="150" typeahead="no" showautosuggestloadingicon="true" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Email Address:</td>
                    <td><span id="sprytextfield3">
                    <input type="text" name="email" validate="email" required="yes" id="email" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Email Address:</td>
                    <td><span id="sprytextfield4"><span id="ConfirmWidget">
                    <input type="text" name="email_confirm" validate="email" required="yes" id="email_confirm" width="150" typeahead="no" showautosuggestloadingicon="true" />
                    <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Password:</td>
                    <td><span id="sprytextfield5">
                      <input type="password" name="password" required="yes" id="password" width="150" />
                      <span class="textfieldRequiredMsg">A value is required.</span></span></td>
                  </tr>
                  <tr>
                    <td class="form" align="right">Confirm Password:</td>
                    <td><span id="sprytextfield6"><span id="ConfirmWidget">
                      <input type="password" name="password_confirm" required="yes" id="password_confirm" width="150" />
                      <span class="confirmInvalidMsg">The values do not match</span></span></span></td>
                  </tr>
                  <tr>
                    <td> </td>
                    <td><input name="submit" type="submit" id="submit" value="Register" /></td>
                  </tr>
                </table>
          <input type="hidden" name="MM_InsertRecord" value="register" />
          </form>
          <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email");
    var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5");
    var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6");
    //-->
    </script>
    <script type="text/javascript">
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield4", "email");
    var ConfirmWidgetObject = new Spry.Widget.ValidationConfirm("sprytextfield6", "password");
    </script>
              <!-- InstanceEndEditable --></td>
            </tr>
          </table>
        </td>
        <td width="30" background="right_border.jpg"><img src="clear.gif" width="30" height="50" /></td>
      </tr>
      <tr>
        <td colspan="3" background="footer.jpg" class="footer" height="80"/>This website best viewed using:<br /><a href="http://www.firefox.com"><img src="firefox_logo.gif" width="110" height="40" border="0" /></a></td>
      </tr>
    </table>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    <!-- InstanceEnd --></html>

    Syntax error in INSERT INTO statement.  INSERT INTO Users ([First Name], [Last Name], [Email Address], Password)
    That oh-so-uninformative error is because "Password" is a reserved word with your database driver.  Either escape it by putting square brackets around it too, or rename the column permanently. It is best to avoid using reserved words whenever possible. So renaming the column is the better option.  Also, I would try and avoid using invalid characters like spaces in column names ie "First Name". It is technically allowed, but it requires special handling everywhere which adds unecessary complexity.
    I'm not sure what the problem is, but I'm getting a syntax error referencing this particular portion of the code:
    Do not take the error line numbers as gospel. Sometimes they just indicate that the error is within the vincinty of that line.
    I'm using Dreamweaver CS3 to help generate most of the code
    Unforutnately, DW wizards generate some truly awful and verbose code.  To give you an idea, here is what the query should look like, without all the wizard nonsense.
      <cfparam name="FORM.first_name" default="">
      <cfparam name="FORM.last_name" default="">
      <cfparam name="FORM.email" default="">
      <cfparam name="FORM.FORM.password" default="">
      <cfquery datasource="YourDSNName"> 
        INSERT INTO Users ([First Name], [Last Name], [Email Address], [Password])
        VALUES (
          <cfqueryparam value="#FORM.first_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.last_name#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_varchar">
         , <cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_varchar">
      </cfquery>
    CF is pretty easy to learn. You might want to begin perusing the CF documentation and a few tutorials to get more familiar with the language. Since you are working with a database, I would also recommend a  SQL tutorial.

  • How to use insert into...select * from...if source table is huge in size

    The source tables are having crores of data (growing tables). Tables with 4crores, 17cr. We want these tables to be copied frequently to our local database. Previously it was done by export-import through windows scheduled task. but now we are planning to do it as database jobs. We are fetching the datas with query
    insert into dest_tablee( select * from source_table@dblink) when we tried with this it was throwing exception like enough table space is not there. And also it was found that frequent commits has to be used while populating datas from big tables. So tried with cursor But it was very slow and again we got the exception like 'the table space unable to extend segment by 16 in undo tablespace 'UNDOTBS1'.
    After that we tried with the group by. In this case we got the exception like unable to extend table and also index in the table space. For this the solution is to add datafile. Again we have increase the table space. Now the procedure is running very slow(taking much time. It might be because of the conditions used in the query).
    Is there any other option to copy the datas from such a big tables? can we use the same sort of query?
    Friends please help me to sort it out.
    Thanks in Advance

    Hi,
    you have lot of data DONT use cursor, did you try using the COPY command.
    How frequently you will be doing the COPYING of the data ?
    If you have any constraints you can disable and enable after all the records have been copied.
    Please look at this link this should help.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869
    Thanks
    Message was edited by:
    hkandpal
    Link added

  • Problem with using INSERT INTO script

    Hi guys,
    I was trying to duplicate a table with the following script:
    CREATE TABLE TAB3(
    KEYATTR     NUMBER(3)     NOT NULL,
    BODY1     CHAR(1000)     NOT NULL,
    BODY2      CHAR(1000)     NOT NULL,
    BODY3     CHAR(1000)     NOT NULL,
         CONSTRAINT TAB3_PKEY PRIMARY KEY(KEYATTR) )
    INSERT INTO TAB3
         SELECT      *           
         FROM system.table3
         ORDER BY DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DESC, KEYATTR DESC
    However, when I execute the script, I keep getting a 'missing right parenthesis' error. Any idea what went wrong?

    You don't need braces.
    Just
    INSERT INTO TAB3
    SELECT *
    FROM system.table3
    ORDER BY DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DESC, KEYATTR DESCshould work.

  • Using XSQL programmatically for in-memory docs

    HI!
    I wonder if there is a way to use XSQLRequest-class without URLs? Is it possible to make XSQLRequest prosess in-memory XSQL-documents(XMLDocument,string or stream)? I want XSQL to parse the XSQL-document I've created programmatically. Now the only way I see is to write my XSQL-doc to file and then get it from file-based URL. Is there more elegant method?
    Thanks in advance.
    null

    HI!
    I wonder if there is a way to use XSQLRequest-class without URLs? Is it possible to make XSQLRequest prosess in-memory XSQL-documents(XMLDocument,string or stream)? I want XSQL to parse the XSQL-document I've created programmatically. Now the only way I see is to write my XSQL-doc to file and then get it from file-based URL. Is there more elegant method?
    Thanks in advance.
    null

  • FDM Import  - INSERT INTO

    Hi,
    I`m doing an import from FDM using SqlIntegration script, as suggested in the manual. This script use rsappend, and this command has a memory limit of 2GB. When the limit was reached the process stops with error OUT OF MEMORY. Oracle suggests that I use INSERT INTO. I`m not able to execute this command using API.
    Somebody has an example like that?
    Thanks advanced.

    You are not limited to the API when it comes to database handling; however, it obviously makes your life easier.
    You can use ADO and create any type of query you want.
    http://msdn.microsoft.com/en-us/library/ms676589(v=VS.85).aspx
    Execute is the method you'll want to focus on to execute the SQL you'd need.
    http://msdn.microsoft.com/en-us/library/ms681559(v=vs.85).aspx

  • PHP create array/variable for two dropdowns and insert into one column

    Hello,
    I have been trying for days to get this to work. Any help would be very appreciated.
    The dropdown code:
    <?php //Dropdowns for hours and minutes
    $hour = array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
    $min = array (.00, .25, .50 ,.75);
    echo '<span class="red">Hours :</span><select name="hour">';
    foreach ($hour as $value1) {
    echo "<option value=\"$value1\">$value1</option>\n";
    echo '</select>';
    echo '<span class="red">Quarter Hours :</span><select name="min"';
    foreach ($min as $value2) {
    echo "<option value=\"$value2\">$value2</option>\n";
    echo '</select>';
    //Dropdowns for hours and minutes
    //Create variable to send to the time field using a hidden field
    function input_time($value1, $value2) {
    $time = count($value1 + $value2);
    return $input_time;
    ?>
    <input name="time" type="hidden" value="<?php echo "$input_time";?>" />
    The Schema:
    CREATE TABLE `ND_time_sheet` (
      `time_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `day` varchar(10) NOT NULL DEFAULT '',
      `date` varchar(8) NOT NULL DEFAULT '',
      `project_id` varchar(8) DEFAULT NULL,
      `non_bill` tinytext,
      `staff_id` varchar(5) NOT NULL DEFAULT '',
      `time` decimal(3,2) unsigned zerofill DEFAULT NULL,
      `type` varchar(30) NOT NULL DEFAULT '',
      PRIMARY KEY (`time_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1
    Thanks!

    9677670421 wrote:
    hi... i am trying to do the same but i am having the 2D array of data when first time if i clicked in table it should show the the first row values and if i again clicked same value should show in the second row and so on... but insted in my code if clicked (using insert into array ) at a time it is showing two rows of the data pl help me ..........
    This seems to be a different problem, so you should have started a new thread instead.
    Can you show us your code, tell us what you are clicking, tell us what you get and what you expect to get instead. Thanks.
    LabVIEW Champion . Do more with less code and in less time .

  • 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>

Maybe you are looking for