[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

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
0
egovernment
Asked:
egovernment
  • 3
  • 2
1 Solution
 
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
 
OP_ZaharinCommented:
- is this what you require?:

UPDATE tablename SET Field5 = Field1 || '~' || Field2 || '~' || Field3 || '~' || Field4 || '~' ||
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
OP_ZaharinCommented:
- 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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now