473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Simple question on how to insert record?

How to create a pl sql program which enable to insert record into database?

Can anyone can give details or steps in creating a pl sql program which enable to insert record into database using the Oracle SQL Developer program?

Please help me....

Thank you!!
Jun 14 '07 #1
10 3700
debasisdas
8,127 Expert 4TB
Hi
oracle newbie
Welcome to TSDN.

You have reached the right place for knowledge shairing.

Here you will find a vast resource of related topics and code.

Feel free to post more doubts/questions in the forum.

But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.

It will help Experts in the forum in solving/underestanding your problem in a better way.

Please follow the posting guidelines in every new post/reply.

Don't expect complete code here .

First u need to post what is your problem and how/what u have tried to solve it.
Jun 14 '07 #2
Ok Thanks.

Just 1 question: Can Oracle SQL Developer be use to create a PL SQL PROGRAM to insert record?

Yes or No.
Jun 14 '07 #3
debasisdas
8,127 Expert 4TB
U can try this sample code to create a procedure to insert record to a table
================================================== ====

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE DEPTINS
  2. (
  3. DNO DEPT.DEPTNO%TYPE,
  4. DN DEPT.DNAME%TYPE,
  5. LC DEPT.LOC%TYPE
  6. )
  7. IS
  8. BEGIN
  9. INSERT INTO DEPT VALUES(DNO,DN,LC);
  10. DBMS_OUTPUT.PUT_LINE('ONE ROW INSERTED......!');
  11. COMMIT;
  12. EXCEPTION
  13. WHEN DUP_VAL_ON_INDEX THEN
  14. DBMS_OUTPUT.PUT_LINE('DUPLICATE VALUE......!');
  15. END;
  16.  

Note:--It is also possible to insert record without writing any procedure ,on with the help of an anonymous block.
Jun 14 '07 #4
debasisdas
8,127 Expert 4TB
Try the sample code to get your answer.
Jun 14 '07 #5
debasisdas Thank You for your sample code.

Can the codes be use using Oracle SQL Developer.

Because, there's a error at the DNO.
Jun 14 '07 #6
debasisdas
8,127 Expert 4TB
can you please post what exactly is the error that you are getting.
Jun 14 '07 #7
PL/SQL: Compliation unit analysis is terminated at the line of Create or replace

PLS-00201: Identifier DEPT.DEPTNO must declared at the line of DEPT.DEPTNO%TYPE,


Thanks. I hope I wouldn't trouble you.
Jun 14 '07 #8
debasisdas
8,127 Expert 4TB
since it is a sample code

try executing in scott schema


and check for the the existance of the default DEPT table.
Jun 14 '07 #9
I will try to do it.

Do you have any websites to recommend on creating pl sql program using Oracle sql developer ?

Once again Thanks.
Jun 14 '07 #10
debasisdas
8,127 Expert 4TB
You can use this link for some demo programs. That You may find useful.
Jun 14 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mike R | last post by:
Hi, I cant figure out how to do this.... for example: Select name from mytab order by col1 could return Mike
9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
2
by: Miguel Dias Moura | last post by:
Hello, i am working in an ASP.net / VB web site. I have a form. Does anyone knows a script to insert the form values in an Access Database? I was looking and looking and i couldn't find...
4
by: olafmol | last post by:
Hello, i am wondering if there is a simple way to insert a new record into an MS Access db and read out the newly created auto-ID field. Using ASP this was rather simple, but in ASP.NET (VB) it...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
2
by: Deano | last post by:
Problem is that there are lots and lots of fields in an employee record. I specify a form control as the criterion for one of those fields which is the value of the primary key for that record. ...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
8
by: MLH | last post by:
I would like to modify the following SQL... INSERT INTO tblPmtsRcd (VehicleJobID, PmtAmt) SELECT GetCurrentVehicleJobID() AS MyVehicleJobID, !! AS MyPmtAmt; somehow so that an extra field in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.