Oracle Insert Statement

I want to use Insert statement in Oracle to do the following

Field1~Field2~Field3~Field4

The syntax in previous will be stored in new record

How I can make that
egovernmentAsked:
Who is Participating?
 
OP_ZaharinConnect With a Mentor Commented:
- do you mean to insert field5 during the insert of the field1,field2,field3,field4 at the same time?

INSERT INTO tablename
(Field1, Field2, Field3, Field4, Field5)
VALUES
(val1, val2, val3, val4, val1 || '~' || val2 || '~' || val3 || '~' || val4)
0
 
sdstuberCommented:
I don't know what you're asking,  please post sample data and expected output
0
 
egovernmentAuthor Commented:
Ok sdstuber


Field1.Name = "EmpId"
Field1 = '5690000321'

Field2.Name = "EmpName"
Field2 = 'John Smith'

Field3.Name = "DateOfBirth"
Field3 = '15/12/1975'

Field4.Name = "Occupation"
Field4 = 'Programmer'

What I need now
There Field5 I want to store this value inside
Field1~Field2~Field3~Field4
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
OP_ZaharinCommented:
- is this what you require?:

UPDATE tablename SET Field5 = Field1 || '~' || Field2 || '~' || Field3 || '~' || Field4 || '~' ||
0
 
OP_ZaharinCommented:
sorry i got extra ~ sign at the end:

UPDATE tablename SET Field5 = Field1 || '~' || Field2 || '~' || Field3 || '~' || Field4
0
 
egovernmentAuthor Commented:
I want to use Insert not update
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.