Hello,
I am importing data from excel to oracle table. My excel has 5 columns, but my table has 6 columns
I want to send 5 columns from excel and want to send 6th column as Logged in user session value.
I am able to send 5 columns by mapping excel columns with db table, but as soon as i am adding extra 6th columns in code, it says - invalid cloumn mapping.
Thank you
Mohamed Azarudeen ZPosted May 16, 2023, 9:13 PM
If you want to send the 6th column as the logged-in user session value while importing data from Excel to an Oracle table, you'll need to modify your code accordingly. Here's a general approach you can follow:
1. Determine how you can retrieve the logged-in user session value in your code. The method to do this may depend on the programming language or framework you're using. For example, if you're using Java and JDBC to interact with Oracle, you can typically obtain the logged-in user using `java.security.Principal` or by executing a SQL query like `SELECT USER FROM DUAL`.
2. Once you have obtained the logged-in user session value, you can include it as an additional column in your code. Make sure the column name in your code matches the column name in the Oracle table.
3. When mapping the columns from the Excel file to the Oracle table, ensure that you map the 5 columns correctly based on their positions or names. The 6th column (representing the logged-in user session value) should be mapped to the corresponding column in the Oracle table.
4. Execute the import process, sending the data from the 5 columns of the Excel file and the logged-in user session value as the 6th column.
If you encounter an "invalid column mapping" error, double-check the column names and ensure they match exactly between the code and the Oracle table definition. Also, verify that you have the necessary privileges and permissions to access and modify the table.
It's worth noting that the specifics of your implementation may vary depending on the programming language, framework, and libraries you're using. Providing more details about your code or sharing a code snippet can help in providing more specific guidance.