The INSERT DML command introduces new rows of data into an SQL table. INSERT is under the Create domain of the CRUD acronym. When using the Oracle SQL Developer IDE, instead of writing an INSERT INTO command, there are visual elements within the IDE interface which help facilitate an INSERT operation. Continue reading to learn how with a simple example…
Choose Table To Insert Data Into
In the left-hand pane of SQL Developer (not shown) double-click on the table, you want to INSERT data into. A new dashboard will appear containing several different tabs.
Shown below is the dashboard view and table description for table STAGE_WALKING_STATS::
The Constraints tab has information about any constraints on the table. In this example, table STAGE_WALKING_STATS has a PRIMARY KEY constraint on the DAY_WALKED column:
Insert A Single Row Using the Add Data Icon
To INSERT a row of data, click the Add Data icon which appears as a green plus symbol on top of a document:
Fill out the necessary fields’ values in the data row provided for each row you wish to INSERT. In the below example, I enter in all the column values for a single row of data:
To complete the INSERT, commit any newly added row(s). Simply click the Commit icon (noted by the Red arrow in the screenshot below) which appears as a green check mark on the well-known database container symbol:
If the INSERT is successful and no errors arise, SQL Developer displays a message indicating the successful commit:
Consider making a small donation on my behalf as I continue to provide valuable content here on my blog. Thank you!
Insert Multiple Rows Using the Add Data Icon
It is absolutely possible to INSERT multiple rows at a time using Oracle SQL Developer. As you fill out and complete a row of data, press TAB on the keyboard. SQL Developer generates a new blank row automatically. Fill out these rows’ – and any subsequent rows – column data values and proceed with committing the new rows:
Same as in the single row example, commit the data without any issues, and you will receive a committed successfully message. (Note: These 2 steps are not shown for this particular example. See the previous single-row INSERT section above for the same information, as they are identical. )
Table Constraints Are Enforced When Inserting Data
Any table constraints are honored even when using the visual elements of Oracle SQL Developer to INSERT data. Since a row with the DAY_WALKED column date value of ’29-APR-21′ already exists in the STAGE_WALKING_STATS table, attempting to INSERT an additional row with that value fails due to the PRIMARY KEY constraint on the DAY_WALKED column:
Instead of a committed successfully message, Oracle SQL Developer returns a unique constraint violation error as shown in this screenshot:
Additional Posts That May Interest You
- SUBSTR() Character Function – Oracle SQL Example
- How to find the first and last day of a month with Oracle SQL Date Functions
- Import CSV file with Oracle SQL Developer
And it is as easy as that to INSERT rows of data into a table using Oracle SQL Developer.
If you see any mistakes in the code or have questions or comments, feel free to add them in the comments section of the post. Thank you for reading.
Like what you have read? See anything incorrect? Please comment below and thank you for reading!!!
A Call To Action!
Thank you for taking the time to read this post. I truly hope you discovered something interesting and enlightening. Please share your findings here, with someone else you know who would get the same value out of it as well.
Visit the Portfolio-Projects page to see blog post/technical writing I have completed for clients.
Be sure and visit the “Best Of” page for a collection of my best blog posts.
Josh Otwell has a passion to study and grow as a SQL Developer and blogger. Other favorite activities find him with his nose buried in a good book, article, or the Linux command line. Among those, he shares a love of tabletop RPG games, reading fantasy novels, and spending time with his wife and two daughters.
Disclaimer: The examples presented in this post are hypothetical ideas of how to achieve similar types of results. They are not the utmost best solution(s). The majority, if not all, of the examples provided, is performed on a personal development/learning workstation-environment and should not be considered production quality or ready. Your particular goals and needs may vary. Use those practices that best benefit your needs and goals. Opinions are my own.