title: How to load data from an uploaded excel sheet into Oracle database table using VB.NET
body: <p>I couldn't fit the full requirement in the title. So, here it is.</p>
  
  <p>I have a very old VB.NET web application which reads each row from an uploaded excel sheet and sends to database for a check. The excel can contain thousands of records. This is resulting in so many database calls and resulting in very poor performance.</p>
  
  <p>To avoid this, I have appended the key columns of each excel row into a string, constructed an SQL query in the code itself and passed to database for execution. I know it's not a recommended approach but, performance was main concern for us and I didn't know how many records users generally have in their excel sheets at that time. So, this was developed under the assumption that rows in excel do not exceed 500-600.</p>
  
  <p>Now we are facing another issue. When users upload huge excel files, the generated SQL is going out of the Oracle query length limits (4kb for SQL query and 32kb for PL/SQL Execute Immediate) resulting in query failure.</p>
  
  <p>What I am planning now is to load the excel into a temporary database table and perform the check through a stored procedure. However, I can't do each record insert, as that will result in more database calls which is exactly what I am trying to eliminate in the first place. I've googled and found about loading through sqlldr.exe from within VB.NET but that also doesn't seem like a proper approach.</p>
  
  <p>Do I have any other options?</p>