Upload excel sheet data through sqlloader into oracle tables
hi everyone,
i am working with excel sheet with following records
8501 Jacob Marshall 15000 21/10/2009 Finance
8502 Chris Campell 50000 13/06/2008 R&D
8503 Simon Dough 50000 3/07/2008 Engineering
8504 Mark Haggai 75000 9/3/2006 Product Management
8505 Verica Beverley 45000 7/2/2008 HR
and i saved it in emp_details.csv
after that when i write following code to make control file
load data
infile 'C:\Documents and Settings\prashant_dabral\Desktop\a.txt'
into table tmp
field terminated by','optionally enclosed by" "
(emp_no,emp_name,salary,doj,dept_name)
after this pl\sqldev returning me error message that ORA-00900:invalid sql statement
can anybody tell me how to resolve issue
or
another method to Upload excel sheet data through sqlloader into oracle tables
A control file is a file located on the operating system, not some SQL or PL/SQL code you try and execute.
Create the control file as a file and then use that to load your data with SQL*Loader from the command line.
http://www.morganslibrary.org/reference/sqlloader.html
Or better still, create it as an external table and then you don't need a seperate control file or need to use sql loader from the command line...
http://www.morganslibrary.org/reference/externaltab.html
Similar Messages
-
Uploading Excel sheet data into internal table
Hi All,
I want to upload Excel file data into internal table. My problem is that my excel file having more than one sheets. I want to upload the data of particula Excel sheet..
Please suggest me how can I upload particulat Excel sheet data .
Thanks and regards
Praveencheck this link
Uploading multiple excel sheets
You can check Satish's answer in the above link
Re: uploading data from excel sheets through BDC's into sap system
<b>Award points if found helpful</b> -
Best Practice to fetch SQL Server data and Insert into Oracle Tables
Hello,
I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
We do not have any database dblinks from oracle to sqlserver and vice versa.
Any help is highly appreciable?
ThanksWell, that's easy:
use a TimerTask to do the following every half an hour:
- open a connection to sql server
- open two connections to the oracle databases
- for each row you read from the sql server, do the inserts into the oracle databases
- commit
- close all connections -
Error in uploading excel sheet data into internal table
Dear all,
i am facing problem when uploading data from excel. i used KD_GET_FILENAME_ON_F4.i select the file and pass on to ALSM_EXCEL_INTO_INTERNAL_TABLE.and i get the ERROR....
Illegal type when transferring an internal table to a FORM. this is my code .
types : begin of ty_mm01,
matnr like rmmg1-matnr,
mbrsh like rmmg1-mbrsh,
mtart like rmmg1-mtart,
maktx like makt-maktx,
meins like mara-meins,
matkl like mara-matkl,
bismt like mara-bismt,
spart like mara-spart,
mtpos like mara-mtpos_mara,
end of ty_mm01.
data : tt_mm01 type standard table of ty_mm01,
wa_mm01 like TT_MM01.
data : t_bdcdata like standard table of bdcdata,
t_bdcmsgcoll like standard table of bdcmsgcoll.
constants: begcol TYPE i value 1 ,
begrow TYPE i value 1,
endcol TYPE i value 100,
endrow TYPE i value 32000.
selection-screen : begin of block bdc with frame.
parameter : tfile like rlgrap-filename obligatory.
selection-screen : end of block bdc.
at selection-screen on value-request for tfile.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = 'ZMM_MAT_MAS_BASIC_DATA'
DYNPRO_NUMBER = '1000'
FIELD_NAME = 'TFILE'
STATIC = 'X'
MASK = ',*.xls,'
CHANGING
FILE_NAME = tfile
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = tfile
I_BEGIN_COL = begcol
I_BEGIN_ROW = begrow
I_END_COL = endcol
I_END_ROW = endrow
TABLES
INTERN = tt_mm01
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in advanceHi,
Check these FM : KCD_EXCEL_OLE_TO_INT_CONVERT
Report ZPSP_TEST.
data: bdc_DATA like bdcdata occurs 0 with header line,
mess_tab like bdcmsgcoll occurs 0 with header line.
DATA: BEGIN OF ITAB OCCURS 0 ,
tcnt TYPE i, "Table Counter &H0D
WERKS LIKE T001W-WERKS,
BNFPO LIKE EBAN-BNFPO,
MATNR LIKE MARA-MATNR,
MENGE LIKE EBAN-MENGE,
END OF ITAB.
start-of-selection.
PERFORM upload_data.
loop at itab.
perform bdc_dynpro using 'SAPMM06B' '0100'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-BSART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-BSART'
'NB'.
perform bdc_field using 'RM06B-LPEIN'
'T'.
perform bdc_field using 'EBAN-WERKS'
ITAB-WERKS.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-EKGRP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM06B-BNFPO'
ITAB-BNFPO.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-MATNR(01)'
ITAB-MATNR.
perform bdc_field using 'EBAN-MENGE(01)'
ITAB-MENGE.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_010.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_011.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_012.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_013.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_014.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_015.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_016.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_017.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_018.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'RM06B-BNFPO'
record-BNFPO_019.
*perform bdc_field using 'EBAN-MATNR(02)'
record-MATNR_02_020.
*perform bdc_field using 'EBAN-MENGE(02)'
record-MENGE_02_021.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'EBAN-MENGE'
ITAB-MENGE_023.
*perform bdc_field using 'RM06B-EEIND'
record-EEIND_024.
*perform bdc_field using 'RM06B-LPEIN'
record-LPEIN_025.
*perform bdc_field using 'EBAN-EKGRP'
record-EKGRP_026.
*perform bdc_field using 'EBAN-BADAT'
record-BADAT_027.
*perform bdc_field using 'EBAN-FRGDT'
record-FRGDT_028.
*perform bdc_field using 'EBAN-PREIS'
record-PREIS_029.
*perform bdc_field using 'EBAN-WAERS'
record-WAERS_030.
*perform bdc_field using 'EBAN-PEINH'
record-PEINH_031.
*perform bdc_field using 'EBAN-REPOS'
record-REPOS_032.
perform bdc_field using 'EBAN-TXZ01'
'BEARING 2"X2"'.
perform bdc_field using 'EBAN-MENGE'
'65'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 1,120.00'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0102'.
perform bdc_field using 'BDC_CURSOR'
'EBAN-MENGE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EBAN-TXZ01'
'DRILLING PIPE 10"'.
perform bdc_field using 'EBAN-MENGE'
'75'.
perform bdc_field using 'RM06B-EEIND'
'2005/01/03'.
perform bdc_field using 'RM06B-LPEIN'
'D'.
perform bdc_field using 'EBAN-EKGRP'
'M11'.
perform bdc_field using 'EBAN-BADAT'
'2005/01/03'.
perform bdc_field using 'EBAN-FRGDT'
'2005/01/03'.
perform bdc_field using 'EBAN-PREIS'
' 0.53'.
perform bdc_field using 'EBAN-WAERS'
'EUR'.
perform bdc_field using 'EBAN-PEINH'
'1'.
perform bdc_field using 'EBAN-REPOS'
'X'.
perform bdc_dynpro using 'SAPMM06B' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RM06B-BNFPO'
perform bdc_field using 'BDC_OKCODE'
'&H3DBU'.
*perform bdc_field using 'RM06B-BNFPO'
CALL TRANSACTION 'ME51' USING BDC_DATA MODE 'A'.
endLOOP.
FORM upload_data.
*local variable declaration
DATA : lv_index TYPE i,
l_count TYPE i.
*local constants declaration
CONSTANTS:
lc_start_col TYPE i VALUE '1' ,
lc_start_row TYPE i VALUE '2' ,
lc_end_col TYPE i VALUE '256' ,
lc_end_row TYPE i VALUE '65536'.
*local field symbol declaration
FIELD-SYMBOLS : <lf_s>.
*loacal internal table declaration
DATA : li_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
*refresh internal table for each loop
CLEAR: li_intern,
l_count .
REFRESH li_intern.
to upload the data in excel on the presentation server this function
module converts the data from excel file into an internal table
containing row no col no and value
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename &H3D 'Give file location here'
i_begin_col &H3D lc_start_col
i_begin_row &H3D lc_start_row
i_end_col &H3D lc_end_col
i_end_row &H3D lc_end_row
TABLES
intern &H3D li_intern
EXCEPTIONS
inconsistent_parameters &H3D 1
upload_ole &H3D 2.
checking for data in internal table
CHECK NOT li_intern[] IS INITIAL.
sorting internal table
SORT li_intern BY row col.
collecting data into an internal table
LOOP AT li_intern.
MOVE: li_intern-col TO lv_index.
lv_index &H3D lv_index + 1.
ASSIGN COMPONENT lv_index OF STRUCTURE itab TO <lf_s>.
MOVE : li_intern-value TO <lf_s>.
AT END OF row.
l_count &H3D l_count + 1.
itab &H3D l_count.
APPEND itab.
ENDAT. " at end of row
ENDLOOP. " loop at li_intern
Reg,
Siva
Edited by: Siva Prasad on Jun 1, 2009 8:41 AM
Edited by: Siva Prasad on Jun 1, 2009 4:25 PM -
Uploading an excel sheet data using Oracle APEX 3.2
Hi All,
Please help me out to upload excel sheet data using oracle APEX 3.2.
Am following the steps mentioned in the below link, but even after that am getting an error saying no data found
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Please help me to proceed further.
Regards,
SakthiHi Andy,
Thank you very much for looking into my thread.
Actually i followed everything that is been mentioned in "http://avdeo.com/2008/05/21/uploading-excel-sheet- using-oracle-application-express-apex/" and i got a successful result.
But, with the above process I can only upload a .csv format excel and not a .xls format excel file.
Thats where i got stucked and unable to find any clue on how to move further to achieve in uploading .xls file.
It would be very great if you guide me through in this process.
Shiva -
Map Excel worksheet into Oracle tables repository
I am new to VB2005. I am working on VB code that can map(read) any table from excel worksheet and load it into Oracle table. Oracle table that I have are: 1)META_OBJECTTYPES(OBJECTTYPEID pk,OBJECTTYPENAME,OBJECTTYPEDESC, OBJECTMETATYPE,OBJECTDOMAIN).
2) META_OBJECTS(OBJECTKEY PK,OBJECTTYPEID FK,OBJECTNAME,OBJECTDESC).
3)META_OBJECTDEPENDENCIES(SRCOBJECTKEY FK, TGTOBJECTKEY FK,DEPENDENCYTYPE PK)
4)META_OBJECTATTRIBUTES((OBJECTKEY FK, OBJECTATTRNAME PK,OBJECTATTRVALUE). NOTICE META_OBJECTTYPES IS PARENT TO META_OBJECTS AND META_OBJECTS IS PARENT TO (META_OBJECTDEPENDENCIES AND META_OBJECTATTRIBUTES) AND ALL PARENT HAS 1 TO MANY REALTIONSHIP TO CHILD TABLES. For example I have employee table in Excel worksheet that has two columns employee_id number, employee_name varchar2(50) I need my vb code map table name employee with its 2 columns into my 4 tables that I have in Oracle repository,
My code so far just insert values into oracle tables in repository, but what is require is mapping table with contents into oracle tables.
Imports System
Imports System.Data ' VB.NET
Imports Oracle.DataAccess.Client ' ODP.NET Oracle data provider
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
'System.Data.OracleClient lets you access Oracle databases.
Public con As System.Data.OracleClient.OracleConnection = New System.Data.OracleClient.OracleConnection() 'Oracle.DataAccess.Client.OracleConnection()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim range As Excel.Range
Dim rCnt As Integer
Dim cCnt As Integer
Dim Obj As Object
xlApp = New Excel.ApplicationClass
xlApp.Visible = True
xlWorkBook = xlApp.Workbooks.Open("c:\employee.xls")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
range = xlWorkSheet.UsedRange
For rCnt = 2 To range.Rows.Count
For cCnt = 1 To range.Columns.Count
Obj = CType(range.Cells(rCnt, cCnt), Excel.Range)
MsgBox(Obj.value)
Next
Next
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
End Sub
Private Sub releaseObject(ByVal obj As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
obj = Nothing
Catch ex As Exception
obj = Nothing
Finally
GC.Collect()
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim daOracle As New OracleDataAdapter
Dim InsertCommand As New OracleCommand
daOracle.InsertCommand = New OracleCommand
'1.Create connection object to Oracle database
Dim con As OracleConnection = New OracleConnection()
Try
'2.Specify connection string
con.ConnectionString = ("Data Source=dprod;User Id=smughrabi; Password=Sul9966")
'3. Open the connection through ODP.NET
con.Open()
Dim cmd As OracleCommand = New OracleCommand
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "insert into meta_objecttypes values (4,'TABLE', 'TABLES','ERstudio','Demo')"
cmd.ExecuteNonQuery()
'You have to commit to be inserted into DB
cmd.CommandText = "commit"
cmd.ExecuteNonQuery()
'Catch ex As Exception
'4.display if any error occurs
'MsgBox(ex.Message, Microsoft.VisualBasic.MsgBoxStyle.Exclamation, "OraScan")
Finally
' Close and Dispose OracleConnection object
con.Close()
con.Dispose()
End Try
End Sub
Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add.Click
Dim daOracle As New OracleDataAdapter
Dim InsertCommand As New OracleCommand
daOracle.InsertCommand = New OracleCommand
'1.Create connection object to Oracle database
Dim con As OracleConnection = New OracleConnection()
Try
If TableName.Text = "" Then
MsgBox("Please enter the tablename", MsgBoxStyle.Exclamation, "OraScan")
Exit Sub
End If
MsgBox(TableName.Text, MsgBoxStyle.Exclamation, "OraScan")
'2.Specify connection string
con.ConnectionString = ("Data Source=gema;User Id=dare; Password=rtae")
'3. Open the connection through ODP.NET
con.Open()
Dim cmd As OracleCommand = New OracleCommand
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "select * from user_objects where object_name='" + UCase(TableName.Text) + "' and object_type='TABLE'"
cmd.ExecuteNonQuery()
'You have to commit to be inserted into DB
'cmd.CommandText = "commit"
'cmd.ExecuteNonQuery()
MsgBox("Command executed successfully", MsgBoxStyle.Exclamation, "OraScan")
'Catch ex As Exception
'4.display if any error occurs
'MsgBox(ex.Message, Microsoft.VisualBasic.MsgBoxStyle.Exclamation, "OraScan")
Finally
' Close and Dispose OracleConnection object
con.Close()
con.Dispose()
End Try
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TableName.TextChanged
End Sub
End ClassThanks Lyndon, what I need is map any table someone create in Excel worksheet to Oracle repository.For example to map Excel worksheet(employee)table with its 2 columns to oracle table META_OBJECTTYPES(OBJECTTYPEID pk,OBJECTTYPENAME,OBJECTTYPEDESC, OBJECTMETATYPE,OBJECTDOMAIN). In my case I have 2 objecttypes 1)table(employee) and 2nd columns:employee_id,employee_name
--for inserting table info manually into DB:
INSERT INTO META_OBJECTS
(OBJECTKEY, OBJECTTYPEID,OBJECTNAME,OBJECTDESC)
VALUES
(META_OBJECTS_SEQ.NEXTVAL,
4, --TABLE
'employee',--notice this is table name from Excel worksheet
'Table to store employee info')
--for inserting columns info:
INSERT INTO META_OBJECTS
(OBJECTKEY, OBJECTTYPEID,OBJECTNAME,OBJECTDESC)
VALUES
(META_OBJECTS_SEQ.NEXTVAL,5,'employee_id or name','employee column')
notice above I insert manually Excel worksheet employee table with its two cols into oracle meta_objecttypes. What I want is VB to do this I mean if I go to Toad and erase what I insert in meta_objecttypes when I run vb, the program should map table employee with its 2 cols to Toad(DB). I hope it is clear now. Please refer to 1 st post for 3 other tables in DB -
Map Excel worksheet into Oracle tables in repository
I am new to VB2005. I am working on VB code that can map(read) any table from excel worksheet and load it into Oracle tables. Oracle tables that I have are: 1)META_OBJECTTYPES
(OBJECTTYPEID pk,OBJECTTYPENAME,OBJECTTYPEDESC, OBJECTMETATYPE,OBJECTDOMAIN).
2) META_OBJECTS(OBJECTKEY PK,OBJECTTYPEID FK,OBJECTNAME,OBJECTDESC).
3)META_OBJECTDEPENDENCIES(SRCOBJECTKEY FK, TGTOBJECTKEY FK,DEPENDENCYTYPE PK)
4)META_OBJECTATTRIBUTES
(OBJECTKEY FK, OBJECTATTRNAME PK,OBJECTATTRVALUE).
NOTICE META_OBJECTTYPES IS PARENT TO META_OBJECTS AND META_OBJECTS IS PARENT TO (META_OBJECTDEPENDENCIES AND META_OBJECTATTRIBUTES) AND ALL PARENT HAS 1 TO MANY REALTIONSHIP TO CHILD TABLES. For example, I have employee table in Excel worksheet that has two columns employee_id number, employee_name varchar2(50) I need my vb code map table name employee with its 2 columns into my 4 tables that I have in Oracle table repository,
My code so far just insert values into oracle tables in repository, but what is require is mapping table with contents into oracle tables. If my expanation isn't clear plz let me know.
Imports System
Imports System.Data
Imports Oracle.DataAccess.Client '
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
'System.Data.OracleClient lets you access Oracle databases.
Public con As System.Data.OracleClient.OracleConnection = NewSystem.Data.OracleClient.OracleConnection()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim range As Excel.Range
Dim rCnt As Integer
Dim cCnt As Integer
Dim Obj As Object
xlApp = New Excel.ApplicationClass
xlApp.Visible = True
xlWorkBook = xlApp.Workbooks.Open("c:\employee.xls")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
range = xlWorkSheet.UsedRange
For rCnt = 2 To range.Rows.Count 'rows in Excel start from row2
For cCnt = 1 To range.Columns.Count 'column in Excel start from col1
Obj = CType(range.Cells(rCnt, cCnt), Excel.Range)
MsgBox(Obj.value)
Next
Next
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
End Sub
Private Sub releaseObject(ByVal obj As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
obj = Nothing
Catch ex As Exception
obj = Nothing
Finally
GC.Collect()
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim daOracle As New OracleDataAdapter
Dim InsertCommand As New OracleCommand
daOracle.InsertCommand = New OracleCommand
'1.Create connection object to Oracle database
Dim con As OracleConnection = New OracleConnection()
Try
'2.Specify connection string
con.ConnectionString = ("Data Source=gema;User Id=dare; Password=rtae")
'3. Open the connection through ODP.NET
con.Open()
Dim cmd As OracleCommand = New OracleCommand
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "insert into meta_objecttypes values (4,'TABLE', 'TABLES','ERstudio','Demo')"
cmd.ExecuteNonQuery()
'You have to commit to be inserted into DB
cmd.CommandText = "commit"
cmd.ExecuteNonQuery()
Finally
' Close and Dispose OracleConnection object
con.Close()
con.Dispose()
End Try
End Sub
Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add.Click
Dim daOracle As New OracleDataAdapter
Dim InsertCommand As New OracleCommand
daOracle.InsertCommand = New OracleCommand
'1.Create connection object to Oracle database
Dim con As OracleConnection = New OracleConnection()
Try
If TableName.Text = "" Then
MsgBox("Please enter the tablename", MsgBoxStyle.Exclamation, "OraScan")
Exit Sub
End If
MsgBox(TableName.Text, MsgBoxStyle.Exclamation, "OraScan")
'2.Specify connection string
con.ConnectionString = ("Data Source=gema;User Id=dare; Password=rtae")
'3. Open the connection through ODP.NET
con.Open()
Dim cmd As OracleCommand = New OracleCommand
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "select * from user_objects where object_name='" + UCase(TableName.Text) + "' and object_type='TABLE'"
cmd.ExecuteNonQuery()
'You have to commit to be inserted into DB
'cmd.CommandText = "commit"
'cmd.ExecuteNonQuery()
MsgBox("Command executed successfully", MsgBoxStyle.Exclamation, "OraScan")
Finally
' Close and Dispose OracleConnection object
con.Close()
con.Dispose()
End Try
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TableName.TextChanged
End Sub
End ClassDon't know if this will help you or not, but I have some code that will read from and Excel spreadsheet and put the data into a DataSet (i'm sure something else could be used).
string connectionString =
@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\\testRead.xls;Excel 12.0;HDR=YES;IMEX=1";
DbProviderFactory factory =
DbProviderFactories.GetFactory("System.Data.OleDb");
DbDataAdapter adapter = factory.CreateDataAdapter();
DbCommand selectCommand = factory.CreateCommand();
selectCommand.CommandText = "SELECT * FROM [dogs$]";
DbConnection connection = factory.CreateConnection();
connection.ConnectionString = connectionString;
selectCommand.Connection = connection;
adapter.SelectCommand = selectCommand;
DataSet cities = new DataSet();
adapter.Fill(cities);
GridView1.DataSource = cities;
GridView1.DataBind();
Your provider might be different; the one above is for Office 2007. The [dogs$] in the selectCommand.commandText is the name of the worksheet in Excel.
Hope this helps -
Importing excel data into oracle tables
Hello gurus,
Importing excel data into oracle tables..
I know this is the most common question on the thread ...First, i searched the forum, i found bunch of threads with loading data using sqlloader, converting excel into .Txt, tab delimited file, .csv file etc....
Finally i was totally confused in terms how to get this done....
Here is wat i have
- Excel file on local computer.
- i have laod data into dev environment tables(So no risk involved, but want to try something simple)
- Oracle version 11.1.0.7
- Sqlplus and toad (editors)
Here is wat i like to do ....i dont know if its possible
- Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
SQLLOADER might be one option...but i dont want to go the unix server for placing files and logs and stuff.
Wat will be best and simplest option to do?? and wat format will best to convert from excel into csv, or txt or tab delimited etc.....
If you suggest sqlloader, any code example will be greatly appriciated.
Thank you so much!!!Hi,
user642297 wrote:
Imran,
This is increadible option in toad!!! It works absolutely sweet!! I have toad 9.7 version. IT works great. Thank you so much!!You are welcome :)
Well i have further discussion on this ....this option is great if you doing in staging or development area. What if your doing in prod?? If you automating the sqlloader then how do u do it?? I think we still need to stick with traditional approach of laoding data by making use of SQLLoader right ?? If m wrong please correct me.well, in our case, we do have access to a custom schema in prod where we create the staging table and load the data from datafiles.
try this:
load data
infile 'C:\dest.csv'
into table dest_table
fields terminated by "~" optionally enclosed by '"'
TRAILING NULLCOLS
(name,
owner_nm,
description_column,
UPDT_DT DATE 'MM/DD/YYYY')
{code}
you can get more info about sql loader and your error here:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch05.htm
http://www.allinterview.com/showanswers/53766.html
And one more quick question ...i found an example of control file , in that i see .dat format file. Is it a data file ?? can i try that option ?? But in excel i didnt see to convert the .dat format file.
Any thoughts ???
It is same as a delimiter text file.
steps to create a .dat file (from a excel file):
1. Insert a column between two columns and populate it with the delimiter (in our case, it is ~)
2. Save the file as unicode text.
3. Open the file in text editor and remove all the tabs (find an replace with blank)
4. Save the file as "DEST.dat". Select encoding as UTF-8 while saving.
5. Your .dat file is ready.
Regards
Imran
Edited by: Imran Soudagar on Apr 22, 2010 10:22 PM -
Upload Excel sheet using Data Integrator 6.1?
hi all ,
Upload Excel sheet using Data Integrator? and how to create ODBC for the PC and jobserver i am using version 6.1? i am using excel as my one of the data source and tell me how to use different types of data sources in DI . after uploading the xl file if i apply any transform on the excel data i will give error like
Posted: 25 Sep 2008 04:30
Post subject: Re: Upload Excel sheet using Data Integrator?
I am getting the error like
3128 292 CON-120302 09-25-08 09:59:40 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
3128 292 CON-120302 09-25-08 09:59:40 default driver specified>. Notify Customer Support.
1512 2992 CON-120302 09-25-08 09:59:41 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
1512 2992 CON-120302 09-25-08 09:59:41 default driver specified>. Notify Customer Support.
Please help me out
Thank uHi Shonti,
The DI 11.7 installer can be used to upgrade a DI 6.1 local repository (e.g. the upgrade is supported). This will migrate all jobs and flows. They will remain intact, however, this is always a major migration effort and should not be taken lightly. If you do upgrade, please make sure this is a planned effort with rigorous testing and validation. You should also ensure that you consult the release notes and [supported platforms documentation|https://websmp110.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000712240&_SCENARIO=01100035870000000202] for the 11.7 package you intend to install. The DI 11.7 documentation also contains info about how to install and configure the Excel Adapter, and what functionality it provides.
Thanks,
~Scott -
Help Required :Excel Upload Into Oracle Table Using PLSQL Procedure/Package
Please Help , Urgent Help Needed.
Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
Case's are :
1. Excel File is On Users/ Client PC.
2. Application is on Remote Server(Oracle Forms D2k).
3. User Is Using Application Using Terminal Server LogIn.
4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
6. we are Using Oracle 8.7
So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
Jus help to Sort This Issue ........
you can also write me on :
[email protected], [email protected]I also Tried to Use This
But How can i Use SQLLDR Command In Stored Procedure.
Well IN SQL*PlUS it is successfull but in Stored Procedure /Package ,PL/SQL does not recognise the OS commands.
So now my Question How can I recognise the SQLLDR Commnad in Stored Procedure. -
Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure
Please Help , Urgent Help Needed.
Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
Case's are :
1. Excel File is On Users/ Client PC.
2. Application is on Remote Server(Oracle Forms D2k).
3. User Is Using Application Using Terminal Server LogIn.
4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
6. we are Using Oracle 8.7
So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
Jus help to Sort This Issue ........
you can also write me on :
[email protected], [email protected]TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
Justin -
How to read ecel sheet and insert into oracle table
hi all,
am working on forms builder 6i. and i want , from a trigger to read from a a sheet excel file the data and insert into a table that i had aleady created.
i whrite a code that can till now open the excel file but i cant read the data to insert it into the table.
am using TEXT_IO.IS_OPEN to open the file
TEXT_IO.GET_LINE to take each line
and subst(x as variable) to read the first line , but the subsrt return nohing
any solution??There's already a topic made on this: how to copy data from excel to oracle forms
-
I am facing problem with uploading Excel sheet in LSMW. However, when I try to upload same data through tabulated file, its working perfectly fine.
Please suggest the required solution.Thanks a lot !!! Your solution really helped. However, one correction :- When we use "No Delimiter" option.. data gets populated erroneously. I tried using "Comma Separated" and it is working.
If there is any deviation please tell. -
Load Huge data into oracle table
Hi,
I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
How to do the mass upload of data into oracle table need experts suggestion on this requirement.
Thanks
SudhirSudhir_Meru wrote:
Hi,
I am using oracle 11g Express Edition, I have a file of .csv forma, Which has a data of size 500MB which needs to be uploaded into oracle table.
Please suggest which would be the best method to upload the data into table. Data is employee ticket history which is of huge data.
How to do the mass upload of data into oracle table need experts suggestion on this requirement.
Thanks
SudhirOne method is to use SQL Loader (sqlldr)
Another method is to define an external table in Oracle which is allowing you to view your big file as a table in database.
You may want to have a look at this guide: Choosing the Right Export/Import Utility and this Managing External Tables.
Regards.
Al
Edited by: Alberto Faenza on Nov 6, 2012 10:24 AM -
Regarding uploading excel sheet in eCATT
Hi,
I would like to know how to upload excel sheet in ecatt.I am using 6.4 version.I have created a test script and test configuration.It would be great if anyone suggests me the procedure or path how to upload excel sheet to test the scripts.
Thanks,
Aparna.Hi
See the links
check these link,
eCATT- An Introduction
/people/sumeet.kaul/blog/2005/07/26/ecatt-an-introduction
Creating Test Scripts
/people/sumeet.kaul/blog/2005/08/10/ecatt-creating-test-scripts
eCATT Logs
/people/sapna.modi/blog/2006/04/18/ecatt-logs-part-vi
eCATT Scripts Creation TCD Mode
/people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
Creation of Test Data Container
/people/sumeet.kaul/blog/2005/08/24/ecatt-creation-of-test-data-container
eCATT Scripts Creation - SAPGUI Mode
/people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
Integrating ECATT & MERCURY QTP Part -1
/people/community.user/blog/2007/01/02/integrating-ecatt-mercury-qtp-part-1
Using eCatt to Test Web Dynpro ABAP
/people/thomas.jung/blog/2006/03/21/using-ecatt-to-test-web-dynpro-abap
and
-command reference
http://help.sap.com/saphelp_nw04/helpdata/en/c6/3c333b40389c46e10000000a114084/content.htm
/people/sapna.modi/blog/2006/04/10/ecatt--an-introduction-part-i
http://prasadbabu.blogspot.com
https://www.sdn.sap.com/sdn/developerareas/was.sdn?page=test_tool_integration_for_sap_e-catt.htm
http://help.sap.com/saphelp_nw04/helpdata/en/1b/e81c3b84e65e7be10000000a11402f/frameset.htm
http://www.erpgenie.com/ecatt/index.htm
hope this helps.
Reward points if useful
Regards
Anji
Maybe you are looking for
-
I have a displayed version and a printing version of a report. I want the end-user to print the "printing version". Therefore, I cannot use print window and also because the entire report does not show in the window. I want to create a button or hype
-
How to simulate the defect in dev environment
I have a qa database and the issue i got is some unwanted data getting inserted into the table.this is given as a defect. The qa environment cannot be used for testing because it can only be queried (select) but no insert , update. And the objects ca
-
RSS not working in Mail after MobileMe instal
The title pretty much says it all "RSS not working in Mail after MobileMe instal" The names of the RSS feeds are still there but all have the triangle error message beside them.
-
Unexpected error forwarding or redirecting to login page
Hello Everybody!! I am having problem with JEE 5 update 3. after starting the server http://localhost:4848/ fails to open the login page . The log in >domain>domain1>log>server shows the following error Unexpected error forwarding or redirecting to l
-
What happen to this view V$STANDBY_APPLY_SNAPSHOT ?
I first saw reference to this view in Oracle Data Guard 11g Handbook on Page 121. "This view provides the current redo apply rate in KB/second:" We are running 11g R2 so I am wondering WHY would Oracle remove this view? Edited by: user10260925 on Jul