Insert data into another database with a script
Hello.
What is the best way to insert data into one database with a script
INSERT INTO BF_PRUEBASMTP.bf_mtp_agr_inscription (ain_agreementid, ain_customerid, ain_paymethodsid, ain_servicemoduleid, referencia)
SELECT AAG. AAG_AGREEMENTID, ACU. ACU_CUSTOMERID, 2, 2, ins. NUMERO_REFERENCIA
OF BF_PRUEBASMTP.bf_mtp_agr_biller ABI
JOIN IN-HOUSE
BF_PRUEBASMTP. BF_MTP_AGR_AGREEMENT AAG ON ABI. ABI_BILLERID = AAG. AAG_BILLERID
INNER JOIN 'CLIENTEUNICO. ALMUERZO" ins
ON THE AAG. AAG_AGREEMENTID = ins. CONVENIOID
INNER JOIN BF_PRUEBASMTP.bf_mtp_agr_customer ACU
ON ACU.acu_typedocumentid = ins. TIPO_DOCUMENTO
AND ACU.acu_numberid = ins. NUMERO_DOCUMENTO;
CLIENTEUNICO. INSCRIPCIONES = SELECT * DE INSCRIPCIONES - to a DIFFERENT DATABASE
Thank you very much.
2931095 wrote:
If I don't have permissions to create a database link. Is there another way to do this?
Thank you.
link to database IS the method by which an Oracle database accesses to a different database.
If you are the ADMINISTRATOR, you should have permission.
If you are not the ADMINISTRATOR, you should not have permission and need to talk to the ADMINISTRATOR that is allowed.
Tags: Database
Similar Questions
-
Insert data into a database with foreign key...
So I recently learned how to use oracle and am doing my first DB, I created the tables and added constraints, now I am trying to add data in my takes but I'm getting errors, below I listed all my tables, then the data im trying to insert followed by error messages. Please can somebody translate my error messages in plain English and tell me how to fix... Thank you
Ollie!
HERE'S OUR TABLES.
CREATE TABLE 'ASSESMENT_TYPE '.
(VARCHAR2 (15) 'ASSESMENT_TYPE',)
VARCHAR2 (70) "ASSESMENT_DESCRIPTION."
ENABLE 'ASSESMENT_TYPE_PK' CONSTRAINT PRIMARY KEY ('ASSESMENT_TYPE')
)
CREATE TABLE 'COURSES '.
(NUMBER OF 'COURSE_NO',
VARCHAR2 (30) "COURSE_NAME."
DATE OF THE "COURSE_START_DATE."
DATE OF THE "COURSE_END_DATE."
NUMBER OF "TOTAL_UNITS."
NUMBER OF "COURSE_COORDINATOR_STAFF_NO."
NUMBER OF "TOTAL_COURSE_COST."
NUMBER OF "THIRD_PARTY_SUPPLIER_NO."
ACTIVATE THE KEY PRIMARY CONSTRAINT 'COURSE_PK' ('COURSE_NO'),
"COURSE_CON_FK' FOREIGN KEY ('COURSE_COORDINATOR_STAFF_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'EMPLOYEE' ('EMPLOYEE_NO'),
"THPARTY_SUPPLIER_FK' FOREIGN KEY ('THIRD_PARTY_SUPPLIER_NO') CONSTRAINT
SELECT REFERENCES "THIRD_PARTY_SUPPLIER" ("THIRD_PARTY_SUPPLIER_NO")
)
CREATE TABLE 'COURSE_OUTCOME '.
(VARCHAR2 (5) 'COURSE_OUTCOME',)
VARCHAR2 (25) "COURSE_OUTCOME_DESCRIPTION."
ENABLE 'COURSE_OUTCOME_PK' CONSTRAINT PRIMARY KEY ('COURSE_OUTCOME')
)
CREATE TABLE 'DEPARTMENT '.
(NUMBER OF 'DEPARTMENT_NO',
VARCHAR2 (50) "DEPARTMENT_NAME."
VARCHAR2 (150) "DEPARTMENT_LOCATION."
NUMBER OF "DEPT_MANAGER_NO."
ACTIVATE THE KEY CONSTRAINT PRIMARY "DEPARTMENT_PK" ("DEPARTMENT_NO'),
"DEPTMANNO_FK' FOREIGN KEY ('DEPT_MANAGER_NO') CONSTRAINT
SELECT REFERENCES 'EMPLOYEE' ('EMPLOYEE_NO')
)
CREATE TABLE 'EDUCATIONAL_INSTITUTION '.
(VARCHAR2 (100) 'SCHOOL_UNIVERSITY_NAME',)
VARCHAR2 (200) "SCHOOL_UNIVERSITY_ADDRESS."
ENABLE 'EDUCATIONAL_INSTITUTION_PK' CONSTRAINT PRIMARY KEY ('SCHOOL_UNIVERSITY_NAME')
)
CREATE TABLE 'EMPLOYEE '.
(NUMBER OF 'EMPLOYEE_NO',
VARCHAR2 (50) "EMPLOYEE_NAME"
VARCHAR2 (150) "EMPLOYEE_ADDRESS."
VARCHAR2 (50) "JOB_DESCRIPTION."
'STATUS' VARCHAR2 (15).
'START_DATE' DATE,
NUMBER OF "SALARY_CODE."
NUMBER OF "SUPERVISOR_EMPLOYEE_NO."
NUMBER OF "DEPARTMENT_NO,"
ACTIVATE THE KEY PRIMARY CONSTRAINT 'EMPLOYEE_PK' ('EMPLOYEE_NO'),
"SALARYCODE_FK' FOREIGN KEY ('SALARY_CODE') CONSTRAINT
ACTIVATE THE REFERENCE 'SALARY' ('SALARY_CODE'),
"SUPEMNO_FK' FOREIGN KEY ('SUPERVISOR_EMPLOYEE_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'EMPLOYEE' ('EMPLOYEE_NO'),
"EMDEPNO_FK' FOREIGN KEY ('DEPARTMENT_NO") CONSTRAINT
ACTIVATE THE 'DEPARTMENT' ('DEPARTMENT_NO") REFERENCES
)
CREATE TABLE 'EMPLOYEE_COURSE_OUTCOME '.
(NUMBER OF 'EMPLOYEE_NO',
NUMBER OF "COURSE_NO."
VARCHAR2 (5) "COURSE_OUTCOME_CODE."
NUMBER OF "COURSE_EMPLOYEE_MARK."
ACTIVATE 'EMPLOYEE_COURSE_OUTCOME_PK' CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'COURSE_NO'),
"EM_FK' FOREIGN KEY ('EMPLOYEE_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'EMPLOYEE' ('EMPLOYEE_NO'),
"EMPLOYEE_COURSE_FK' FOREIGN KEY ('COURSE_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'COURSES' ('COURSE_NO'),
"EMPLOYEE_COURSE_OCODE_FK' FOREIGN KEY ('COURSE_OUTCOME_CODE') CONSTRAINT
SELECT REFERENCES "COURSE_OUTCOME" ("COURSE_OUTCOME")
)
CREATE TABLE 'EMPLOYEE_COURSE_UNIT_OUTCOME '.
(NUMBER OF 'EMPLOYEE_NO',
NUMBER OF "COURSE_NO."
NUMBER OF "UNIT_NO."
VARCHAR2 (5) "UNIT_OUTCOME_CODE."
NUMBER OF "EMPLOYEE_UNIT_MARK."
ACTIVATE 'EMPLOYEE_CUO_PK' CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'COURSE_NO', 'UNIT_NO'),
"EMPCU_FK' FOREIGN KEY ('EMPLOYEE_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'EMPLOYEE' ('EMPLOYEE_NO'),
CONSTRAINT 'EMCU-FK' FOREIGN KEY ('UNIT_NO')
SELECT REFERENCES 'UNIT' ('UNIT_NO')
)
CREATE TABLE 'EMPLOYEE_CRS_UNIT_ASSESMENT '.
(NUMBER OF 'EMPLOYEE_NO',
NUMBER OF "COURSE_NO."
NUMBER OF "UNIT_NO."
VARCHAR2 (15) "ASSESMENT_TYPE."
NUMBER OF "EMPLOYEE_ASSESMENT_MARK."
ACTIVATE A KEY PRIMARY ('EMPLOYEE_NO', 'COURSE_NO', 'UNIT_NO') CONSTRAINT 'EMPLOYEE_CRS_PK '.
)
CREATE TABLE 'EMPLOYEE_QUALIFICATION '.
(NUMBER OF 'EMPLOYEE_NO',
VARCHAR2 (5) "QUALIFICATION_TYPE."
'SUBJECT' VARCHAR2 (20).
NUMBER OF "QUALITY."
VARCHAR2 (100) "SCHOOL_UNIVERSITY_NAME."
VARCHAR2 (50) "AWARDING_BODY."
NUMBER OF "DATE_QUALIFICATION_OBTAINED."
TURN ON THE PRIMARY CONSTRAINT "EMPLOYEE_QUALIFICATION_CON_PK" ("EMPLOYEE_NO", "QUALIFICATION_TYPE", "SUBJECT").
"DEPTNO_FK' FOREIGN KEY ('EMPLOYEE_NO') CONSTRAINT
ACTIVATE THE REFERENCE 'EMPLOYEE' ('EMPLOYEE_NO'),
"EMQUALREF_FK' FOREIGN KEY ('QUALIFICATION_TYPE') CONSTRAINT
ACTIVATE THE REFERENCE 'QUALIFICATION_TYPE' ('QUALIFICATION_TYPE'),
"SCHUNINAME_FK' FOREIGN KEY ('SCHOOL_UNIVERSITY_NAME') CONSTRAINT
SELECT REFERENCES "EDUCATIONAL_INSTITUTION" ("SCHOOL_UNIVERSITY_NAME")
)
CREATE TABLE 'QUALIFICATION_TYPE '.
(VARCHAR2 (5) 'QUALIFICATION_TYPE',)
VARCHAR2 (25) "QUALIFICATION_DESCRIPTION."
ENABLE 'QUALIFICATION_TYPE_PK' CONSTRAINT PRIMARY KEY ('QUALIFICATION_TYPE')
)
CREATE TABLE 'WAGES. "
(NUMBER OF 'SALARY_CODE',
NUMBER OF "SALARY_AMOUNT."
ENABLE 'SALARY_PK' CONSTRAINT PRIMARY KEY ('SALARY_CODE')
)
CREATE TABLE 'THIRD_PARTY_SUPPLIER '.
(NUMBER OF 'THIRD_PARTY_SUPPLIER_NO',
VARCHAR2 (100) "THIRD_PARTY_NAME."
VARCHAR2 (100) "THIRD_PARTY_CONTACT_NAME."
ENABLE 'THIRD_PARTY_SUPPLIER_PK' CONSTRAINT PRIMARY KEY ('THIRD_PARTY_SUPPLIER_NO')
)
CREATE TABLE "UNIT".
(NUMBER OF 'UNIT_NO',
VARCHAR2 (30) "UNIT_NAME"
NUMBER (7.2) "UNIT_COST"
ENABLE 'UNIT_PK' CONSTRAINT PRIMARY KEY ('UNIT_NO')
)
CREATE TABLE 'UNIT_OUTCOME '.
(VARCHAR2 (5) 'UNIT_OUTCOME_CODE',)
VARCHAR2 (25) "UNIT_OUTCOME_DESCRIPTION."
ENABLE 'UNIT_OUTCOME_PK' CONSTRAINT PRIMARY KEY ('UNIT_OUTCOME_CODE')
)
NOW, WE TRY TO ENTER DATA.
insert into values used (0002, "Mitch Vaughan', '145 a Green Street', 'Administrator', 'Active', December 1, 2010", 1,1,1 ");
insert into values used (0001, "Ollie Marriott", "12 the Ghetto Street', 'Administrator', 'Active', 2 December 2010", 2,2,1);
insert into values employee (0003, "Tim Reynolds, '12 Shoebury Way', 'Cleaner', ' Inactive', December 2, 2000, 3,0002,3);
insert into values used (0004, "Tom Watson", ' 90 Seymour Road","Data Analyst","Active", December 10, 2008", 4 000 104 ");
insert into values used (0005, "Wajj is', 125 hamlet Court ', 'Clean', 'Active', September 15, 2007", 5 000 105 ");
insert into values used (0006, "Nathan Mann', '33 a Bushey Hill Road', 'Receptionist', 'Active'", December 2, 2010 ", 6 000 406);
insert into values used (0007, "Tim DeLong', ' 34 Buena Vista Drive", "Receptionist", "Active", December 21, 2010 ', 7, 1, 06);
NOW WE'RE GETTING THESE ERROR MESSAGES.
Connected.
SQL > insert into values used (0002, "Mitch Vaughan', '145 a Green Street', ' has)
dministrator ', 'Active»(, 1er décembre 2010', 1,1,1);
insert into values used (0002, "Mitch Vaughan', '145 a Green Street', ' administrative)
strator ', 'Active', 1 December 2010 "(, 1,1,1).
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0001, 'Ollie Marriott', ' 12 Ghetto Road', ' SMA)
made ', 'Active»(, 2 décembre 2010', 2,2,1);
insert into values used (0001, 'Ollie Marriott', ' 12 Ghetto Road', ' Directors)
Rator ', 'Active»(, 2 décembre 2010', 2,2,1)'.
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0003, 'Tim Reynolds, 12 Shoebury way', ' Clea)
NER ","inactive»(, 2 décembre 2000', 3,0002,3);
insert into values used (0003, "Tim Reynolds', ' 12 Shoebury Way", "Cleaner")
("Inactive", 2 December 2000', 3,0002,3)
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0004, 'Tom Watson", ' 90 Seymour Road', ' data one)
nalyst ","Active»(, 10 décembre 2008', 4 000 104);
insert into values used (0004, 'Tom Watson", ' 90 Seymour Road', ' data Analys)
t ', 'Active', December 10, 2008 "(, 4 000 104).
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0005, 'Wajj is', ' 125 hamlet Court', ' Clean)
St ', 'Active»(, 15 septembre 2007', 5 000 105);
insert into values used (0005, "Wajj is', 125 hamlet Court ', 'Clean',')
Active ", September 15, 2007"(, 5 000 105).
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0006, "Nathan Mann', '33 a Bushey Hill Road', ')
Receptionist ', 'Active', December 2, 2010 "(, 6 000 406);
insert into values used (0006, "Nathan Mann', '33 a Bushey Hill Road', ' Recep)
tionist ', 'Active»(, 2 décembre 2010', 6 000 406)'.
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
SQL > insert into values used (0007, "Tim DeLong', ' 34 Buena Vista Drive," ' R)
Eceptionist ', 'Active»(, 21 décembre 2010', 7, 1, 06);
insert into values used (0007, "Tim DeLong', ' 34 Buena Vista Drive," ' Recept)
ionist ', 'Active»(, 21 décembre 2010', 7, 1, 06)'.
*
ERROR on line 1:
ORA-02291: integrity constraint (ISAD2. SALARYCODE_FK) violated - parent key not
found
SQL >
PLEASE HELP ME UNDERSTAND THIS! / / /Sounds like you have a problem with your tables. It should not be necessary to insert a "preliminary" to the employee record, and then eventually complete.
Should not be possible. In your case, it is, for all columns is NULL allowed, which is really bad.In your case, it is necessary because you have a circular reference;
Department of references used, which refers to employee. If you really want it to be like that, one of them should be DEFERRABLE (search)
You need to go through all your tables, you seem to have missed additional / more than one foreign key.
I proposed (all) in NOT NULL columns. At least give some thoughts to each column;
'Should I a value here'-> NOT NULL
"Do I always have value here"-> NOT NULL
If it is in each case, perhaps that this cvolumn is not at this table. This could be the case for DEPARTMENT_MANAGER, which would also solve your circular reference.Do not use the NUMBER with any precision. Many point for example, 'COURSE_NO' NUMBER will it means it's a flutter. For example, use Number (38), personally I use 'always' NUMBER (13) for identifiers - this will insert in a Java int.
Also, give thoughts to CHECK constraints, probably, he does not give meaning have a negative salaray, and so on.
A good practice is to first create all tables, then all primary keys and finally all foreign keys. That decouple the tables, so no specific order of creation is necessary.
When these changes have been made, then start by inserting tables which do not reference other tables and then take it from there, one table at a time.
Concerning
PeterEdit: One last thing, I don't get the need for a TREATMENT table. Think you should get rid of it.
Published by: Peter on April 26, 2011 14:53
-
Cannot insert data into the database
Hello world
I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.
Problem is use Labiew 8.2. So try to answer accordingly
Try it with a cluster instead of a string or an array.
-
How to insert data into the database using smartview
Hello
I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
My database is empty.
I opened an ad hoc network, it returns * "#missing" * in all cells
I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.
I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?
--
VINETYou go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.
See you soon
John
http://John-Goodwin.blogspot.com/ -
Error when trying to insert data into a database through a mediator
I build a simple project on 11g TP$, which consists of a mediator, a file adapter, that reads an xml file and a DB adapter that inserts data in a database.
The mediator connects to the file adapter and the DB adapter through a routing rule that it inserts the data in a table in the database.
When I try to run this project, the input file is consumed by the adapter file, but after I get the following error
SEVERE: Part {body} returns a null value in the message: in
December 5, 2008 14:24:55 oracle.tip.mediator.service.transformation.XSLTransformer getPartDocument
SEVERE: message load useful map source: {opaque=oracle.xml.parser.v2.XMLElement@19b0076}
December 5, 2008 14:24:55 oracle.tip.mediator.service.transformation.MediatorTransformationHandler transform
SERIOUS: Failure of Transformation
oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
to $Proxy70.post (Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
December 5, 2008 14:24:55 oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
GRAVE: update flaw treatment metric DMS
December 5, 2008 14:24:55 oracle.tip.mediator.serviceEngine.MediatorServiceEngine process
GRAVE: Got an exception: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
to $Proxy70.post (Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
GRAVE: JCABinding = > ReadAdapter Service read could not perform the sending of an incoming message to the composite due to: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
GRAVE: JCABinding = > read
oracle.fabric.common.FabricInvocationException: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:599)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.post (MediatorServiceEngine.java:634)
at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:138)
at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:152)
at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
to $Proxy70.post (Unknown Source)
at oracle.integration.platform.blocks.adapter.fw.jca.mdb.AdapterServiceMDB.onMessage (AdapterServiceMDB.java:574)
at oracle.integration.platform.blocks.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage (MessageEndpointImpl.java:295)
at oracle.tip.adapter.file.inbound.ProcessWork.publishMessage(ProcessWork.java:2127)
at oracle.tip.adapter.file.inbound.ProcessWork.doTranslation(ProcessWork.java:1719)
at oracle.tip.adapter.file.inbound.ProcessWork.translateAndPublish(ProcessWork.java:677)
at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:320)
at oracle.integration.platform.blocks.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51)
at oracle.integration.platform.blocks.adapter.fw.common.ThreadPool.run(ThreadPool.java:283)
at java.lang.Thread.run(Thread.java:595)
Caused by: oracle.tip.mediator.infra.exception.MediatorException: error occurred by transforming the payload!
Please see the load XSL or source. Contact the Oracle Support if error not repairable
at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument (XSLTransformer.java:191)
at oracle.tip.mediator.service.transformation.XSLTransformer.transform (XSLTransformer.java:102)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:103)
at oracle.tip.mediator.service.transformation.MediatorTransformationHandler.transform (MediatorTransformationHandler.java:196)
at oracle.tip.mediator.service.DataActionHandler.getNextPayload (DataActionHandler.java:145)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:74)
at oracle.tip.mediator.service.BaseActionHandler.requestProcess (BaseActionHandler.java:53)
at oracle.tip.mediator.service.OneWayActionHandler.oneWayRequestProcess (OneWayActionHandler.java:67)
at oracle.tip.mediator.service.OneWayActionHandler.process (OneWayActionHandler.java:34)
at oracle.tip.mediator.service.ActionProcessor.onMessage (ActionProcessor.java:61)
at oracle.tip.mediator.dispatch.MessageDispatcher.executeCase (MessageDispatcher.java:103)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCase (InitialMessageDispatcher.java:465)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:361)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.processCases (InitialMessageDispatcher.java:254)
at oracle.tip.mediator.dispatch.InitialMessageDispatcher.dispatch (InitialMessageDispatcher.java:149)
at oracle.tip.mediator.serviceEngine.MediatorServiceEngine.process (MediatorServiceEngine.java:533)
... 24 more
December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
WARNING: JCABinding = > ReadonReject reading: the adapter resources 'file' asked a malformed incoming message processing. However, the following Service property has not been set: "rejectedMessageHandlers." Please define and redeploy the module. Will use the default rejection file://jca \Read\rejectedMessages directory at the moment.
December 5, 2008 14:24:55 oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl Journal
WARNING: JCABinding = > ReadonReject reading: Send incoming message invalid to the exception handler:
December 5, 2008 14:24:55 oracle.tip.mediator.common.error.ErrorMessageEnqueuer$ EnqueuerThread run
CRITICAL: Doesn't have a queue error message
javax.jms.TransactionInProgressException: cannot call commit on a JMS session capable XA.
at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:595)
at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:846)
at oracle.j2ee.ra.jms.generic.RAUtils.toTransactionInProgressException(RAUtils.java:840)
at oracle.j2ee.ra.jms.generic.SessionWrapper.commit(SessionWrapper.java:197)
to oracle.tip.mediator.common.error.ErrorMessageEnqueuer$ EnqueuerThread.run (ErrorMessageEnqueuer.java:187)
at java.lang.Thread.run(Thread.java:595)
I checked the .xsd file and my xml several times and it seems that they are correct. In addition, the .xsl file is also correct.
Does anyone have an idea of what can produce this problem?
Thank youI was finally able to get my project work. Heidi - you were right, there was a problem with the XSL generated the XSL map editor.
I'm trying to locate if this issue has already been reported, but I'm pointing out here, in case someone else has to face the same.The generated XSL was as follows:
< xsl: stylesheet version = "1.0".
xmlns:DVM = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue]".
xmlns:bpws = "[http://schemas.xmlsoap.org/ws/2003/03/business-process/]".
xmlns:ns1 = "[http://xmlns.oracle.com/pcbpel/adapter/db/ReadEmps/Read/DB/]".
xmlns:PLT = "[http://schemas.xmlsoap.org/ws/2003/05/partner-link/]".
xmlns:ns0 = "[http://www.w3.org/2001/XMLSchema]."
xmlns:HWF = "[http://xmlns.oracle.com/bpel/workflow/xpath]".
xmlns:XP20 = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20]".
xmlns:xref = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions]".
xmlns:TNS = "[http://xmlns.oracle.com/pcbpel/adapter/file/ReadEmps/Read/Read/]".
xmlns: xsl = "[http://www.w3.org/1999/XSL/Transform]."
xmlns:ORA = "[http://schemas.oracle.com/xpath/extension]".
xmlns: xsi = "[http://www.w3.org/2001/XMLSchema-instance]."
' xmlns:imp1 = ' [www.TargetNameSpace.com/EmpTrack |] ' http://www.targetnamespace.com/EmpTrack] * ' *.
xmlns:top = "[http://xmlns.oracle.com/pcbpel/adapter/db/top/DB]".
xmlns:IDs = "[http://xmlns.oracle.com/bpel/services/IdentityService/xpath]".
xmlns:ORCL = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc]".
xmlns:MHDR = "[http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.GetRequestHeaderExtnFunction]".
exclude-result-prefixes = "xsl plt ns0 ns1 imp1 tns superior dvm APO hwf xp20 Xref ora ID orcl mhdr" >
< xsl: template match = "/" >
< EmployeeTrackingCollection: top >
< xsl: select for each * = "/ imp1:ROWSET / imp1:ROW *" >
< EmployeeTracking: top >
< top: locationId >
< xsl: value-of select = "* imp1:LOCATION_ID *" / >
< / top: locationId >
< top: employeeId >
< xsl: value-of select = "* imp1:EMPLOYEE_ID *" / >
< / top: employeeId >
< employeeX: top >
< xsl: value-of select = "* imp1:EMPLOYEE_X *" / >
< / high: employeeX >
< upper: employeeY >
< xsl: value-of select = "* imp1:EMPLOYEE_Y" * / >
< / top: employeeY >
< / high: EmployeeTracking >
< / xsl: foreach >
< / high: EmployeeTrackingCollection >
< / xsl: template >
< / xsl: stylesheet >The Xpath expression includes the "imp1:" tag to reference namespace. I tested this XSL and it did not work. However, on the removal of namespace ' imp1: ' the XPath, XSL works fine and I am able to insert into the database. "" Any appropriate driver "does not appear in the newspaper, but all lines of XML are inserted into the database.
Heidi - do you think it is a bug?
-
Dreamweaver server behaviors, can not insert data into the database
Hi, I tried to use server behaviors to add registration information in my database in my registration page.
(1) that I created a login page, and it works very well. This means that connections and the connection works fine database so it can match the record in my database.
(2) but when I tried to download the news in the form of database, it does not work. When I clicked on the service behavior to double check the action "insert data", it always jumps the error message: "When executing inspectserverbehavior in InsertRecord.htm, a javascript error occurred."
I copied my code below. Except the form code and a little jquery is written by me, most of the code generated by Dreamweaver.
<? php require_once('Connections/MAMPPRO.php');? >
<? PHP
If (! function_exists ("GetSQLValueString")) {}
function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
If (via PHP_VERSION < 6) {}
$theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
}
$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);
Switch ($theType) {}
case 'text ':
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "long":
case "int":
$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
break;
case "double":
$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
break;
case "date":
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "set":
$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
break;
}
Return $theValue;
}
}
$editFormAction = $_SERVER ['PHP_SELF'];
If (isset {}
$editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
}
If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "Register_Form")) {}
$insertSQL = sprintf ("INSERT INTO"user identity"(Ui_LastName, Ui_Email, Ui_FirstName, Ui_Password) VALUES (%s, %s, %s %s)", ")
GetSQLValueString ($_POST ['Register_Firstname'], "text").
GetSQLValueString ($_POST ['Register_Lastname'], "text").
GetSQLValueString ($_POST ['Register_Email'], "text").
GetSQLValueString ($_POST ['Register_Password'], "text"));
@mysql_select_db ($database_MAMPPRO, $MAMPPRO);
$Result1 = mysql_query ($insertSQL, $MAMPPRO) or die (mysql_error ());
$insertGoTo = "LoginSuccessful.php";
If (isset {}
$insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
$insertGoTo. = $_SERVER ['QUERY_STRING'];
}
header (sprintf ("location: %s", $insertGoTo));
}
@mysql_select_db ($database_MAMPPRO, $MAMPPRO);
$query_Recordset1 = "SELECT *"IDENTITY of the user;"
$Recordset1 = mysql_query ($query_Recordset1, $MAMPPRO) or die (mysql_error ());
$row_Recordset1 = mysql_fetch_assoc ($Recordset1);
$totalRows_Recordset1 = mysql_num_rows ($Recordset1);
? >
<! doctype html >
< html >
< head >
< meta charset = "UTF-8" >
Registeration < title > < / title >
"< link href="jquery-mobile/jquery.mobile-1.3.0.min.css "rel ="stylesheet"type =" text/css">
"< script src="jquery-mobile/jquery-1.8.3.min.js "type =" text/javascript"> < / script >
"< script src="jquery-mobile/jquery.mobile-1.3.0.min.js "type =" text/javascript"> < / script >
< / head >
< body >
< div data-role = 'page' id = "registrationpage" >
< div data-role = "header" >
< h1 > welcome! < / h1 >
< h1 > register yourself! < / h1 >
< / div >
< data-role = 'content' div > < / div >
< do action = "<?" PHP echo $editFormAction;? ">" method = "POST" id = "Register_Form" name = "Register_Form" >
< p >
< label > Email < / label >
< input name = "Register_Email" type = "email" required id = form register_email = "Register_Form" title = "Register_Email" >
< label > < br >
Password < / label >
< input name = "Register_Password" type = "password" required id = form register_password = "Register_Form" title = "Register_Password" value = "" >
< /p >
< p >
< label > name < / label >
< input name = "Register_Lastname" type = "text" required id = form register_lastname = "Register_Form" title = "Register_lastname" value = "" >
< label > < br >
First name < / label >
< input name = "Register_Firstname" type = "text" required id = form register_firstname = "Register_Form" title = "Register_Firstname" value = "" >
< /p >
< name of entry = "MM_insert" type = 'submit' form 'Register_Form' value = 'Registration' = >
< input type = "hidden" name = "MM_insert" value = "Register_Form" >
< / make >
< a href = "index.php" data-role = "button" > return to connection < /a > "
< div data-role = "footer" >
footer < h4 > < / h4 >
< / div >
< / div >
< / body >
< / html >
<? PHP
mysql_free_result ($Recordset1);
? >
Finally I found the problem.
It seems in my setting, MAIL does not work in live mode DW. But if moved to any explores, it works fine.
Adobe really needs to improve its management of PHP.
-
Error inserting data into the database of JSF
Hi all
I have a form and a button of validation. I created the form using the editable view object created on an entity object. When the student has table (base table of data in which I have to enter data) was empty, I managed to insert the data into the table.when I run the same second time application it shows data that I entered previously. But iam able to modify this data and insert the new record again. What should I do so that it does not show the data I already inserted previously when I run again. I think that iam missing something. Please suggest.
Thank you.Here are two ways to achieve the same thing:
-If you use taskflows, you can add createInsert action as activity by default and then have a navigation from this at the registration page so that the creation form will be shown on the loading of the page. As a result, you can directly enter and validate.
-If not, have binding action createInsert in your pagedef and add an executable invokeAction for the same thing with prepareModel so that the registration form empty appears when loading the pageJean Lou
-
updated line and insert them into another table with trigger.
Hi guys I have a table that looks like this.
I'm going to insert the col1 and col2 values, but I need to get the value of column 3 of table 2 and then insert the complete record in table 3. I love doing that with a trigger. I get an error message and I can't for the life of me figuere out what im doing wrong.CREATE TABLE TEST ( "COL1" VARCHAR2(20 BYTE), "COL2" VARCHAR2(20 BYTE), "COL3" VARCHAR2(20 BYTE) )
So here is my nonfunctional trigger.
Here are the two table
HERE IS THE CODE OF THE TRIGGERCREATE TABLE TESTTABLE ( "COLUMN1" NUMBER(15,0), "COLUMN2" NUMBER(15,0) ) Insert into TESTTABLE (COLUMN1,COLUMN2) values (1,5);
I get an error of trigger mutation that I tried the other iterations of the above but I'm not getting anywhere. I have dumb down my problem at these 3 table.CREATE OR REPLACE TRIGGER TRIGGER1 AFTER INSERT ON TEST FOR EACH ROW BEGIN update TEST SET COL3 = (SELECT COLUMN2 FROM TEST, TESTTABLE WHERE COLUMN1 = :new.COL1); END
Can someone point me in the right direction.You'll have to do some reading, but it comes down to process the data on education instead of line level.
You may even be not at all a trigger.
See:
http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936 -
How to insert data into the database of the fields that have already been assigned values?
Hi all
I'm sorry for the question, I'm still new to the OPS
Here's the thing.
I have 4 points messageTextInput in my page. each of these 4 field is associated with an attribute of the VO.
3 of these items have their value already defined in the processRequest of the Commander, like this:
OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem"); factureItem.setValue(pageContext,pnumfacture); OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem"); actionItem.setValue(pageContext,pidaction); Date sysDate = new Date(); OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem"); dateSystemItem.setValue(pageContext,sysDate);
The user must enter the value of the 4th field.
I used the classic entry code for data as follows:
in the AM, I added,
public void insertRecord(){ OAViewObject vo = getTraceVO1(); OADBTransaction trans = getOADBTransaction(); if (!vo.isPreparedForExecution()) { vo.executeQuery(); } TraceVORowImpl v_row; v_row = (TraceVORowImpl)vo.createRow(); vo.insertRow(v_row); v_row.setNewRowState(v_row.STATUS_INITIALIZED); } public void apply() { getTransaction().commit(); }
In the processRequest of the Commander, I added:
if (!pageContext.isFormSubmission()) { am.invokeMethod("insertRecord",null); }
in the processFormRequest of the CO, I added:
if(pageContext.getParameter("submitButtonItem")!=null){ am.invokeMethod("apply"); throw new OAException("Trace Created successfuly",OAException.CONFIRMATION); }
When I run my page, I get the error message saying that myVO not records, the records were removed or the view instance has been initialized incorrectly.
Can someone please tell me what this means?
Kind regards
Afaf
Afaf,.
Please try to use the code below and see what happens:
Replace the insertRecord in the AM method with this.
Import oracle.jbo.domain.Number;
public void insertRecord(String pnumfacture, String pidaction){ System.out.println("been in insert method"); OAViewObject traceVO = getTraceVO1(); OADBTransaction trans = getOADBTransaction(); /*if (!traceVO.isPreparedForExecution()) { traceVO.executeQuery(); } */ traceVO.setWhereClause(null); traceVO.setWhereClauseParams(null); traceVO.setWhereClause("1=2"); traceVO.executeQuery(); Number pidAction; try{ pidAction = new Number(pidaction); }catch(Exception e) {} TraceVORowImpl traceVORow; traceVORow = (TraceVORowImpl)traceVO.createRow(); traceVORow.setIdFacture(pnumfacture); traceVORow.setIdAction(pidAction); traceVORow.DateSysteme(this.getOADBTransaction().getCurrentDBDate()); traceVO.insertRow(traceVORow); //traceVORow.setNewRowState(traceVORow.STATUS_INITIALIZED); System.out.println("been in insert method"); }
Replace the processRequest of the second Commander by this:
public void processRequest(OAPageContext pageContext, OAWebBean webBean) { System.out.println("first time in processForm of CO2"); String pnumfacture = null; String pidaction = null; super.processRequest(pageContext, webBean); OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); if(pageContext.getParameter("pnumfacture")!=null) { pnumfacture = pageContext.getParameter("pnumfacture").toString(); } if(pageContext.getParameter("pidaction")!=null) { pidaction = pageContext.getParameter("pidaction").toString(); } System.out.println("been in processRequest before assign variables of CO2"); System.out.println("pnumfacture :" + pnumfacture); System.out.println("pidaction :" + pidaction); /*assign values to the 3 fields*/ /* Date sysDate = new Date(); OAMessageTextInputBean factureItem = (OAMessageTextInputBean)webBean.findChildRecursive("factureItem"); factureItem.setValue(pageContext,pnumfacture); System.out.println("been in processRequest after assign variables of CO2"); OAMessageTextInputBean actionItem = (OAMessageTextInputBean)webBean.findChildRecursive("actionItem"); actionItem.setValue(pageContext,pidaction); OAMessageDateFieldBean dateSystemItem = (OAMessageDateFieldBean)webBean.findChildRecursive("dateSystemItem"); if(dateSystemItem != null) { dateSystemItem.setValue(pageContext,sysDate); } */ Serializable parameters[] = {pnumfacture, pidaction}; Class paramTypes[] = {String.class, String.class}; am.invokeMethod("insertRecord",parameters, paramTypes); System.out.println("been in processRequest of CO2 after invokeMethod"); }
Let us know what happens.
You can get an error that I have just change this in Textpad and may have syntax errors. If you can't fix those apply here.
See you soon
AJ
-
Insert data into the database of the text box
Hi all
I'm new to ADF. I have 5 text entry fields and a button "submit" in a JSF page. Whenever I click the button submit data entered by the user must be updated in the database. Please view the example code if possible.
Thank you.First, you will need to create EO and then create from VO EO.
Add create VO to AM using the data model section.
Refresh data control and create the jsff page and drag - created déposer VO on the page.
Then select shape > ADF form in the next window check the box include a Submit button.
You can now enter data in table
Samples
http://wiki.Oracle.com/page/ADF+faces+features+examples
Published by: sameera.sac on June 27, 2011 18:01
Published by: sameera.sac on June 27, 2011 18:03
-
Insert data into the database lines selected in a gridview
Good night.
I have a little doubt who would like to see clarified.
I want / need to select several rows in a gridview and then insert the selected value of the line in the database.
What should I do to take only the values and send them to the database to help, for example, a stored procedure?
Thank you.Hello
Assuming that already find you a way to determine the selected line in the gridview, the next steps are as simple as,
1 loop through the selected lines in gridview
2. generate the sql insert statement and OracleCommand based on line
3. open OracleConnection
4. call the ExecuteNonQuery methodSee you soon,.
[Nur Hidayat | http://nur-hidayat.net/] -
Hi all
I use forms [32 bit] Version 6.0.8.24.1 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
I have settings such as the (optional) emp_code and the year (mandatory field - four digits).
Based on the setting that I have to get the detail of a table and these must be inserted at the other table with columns of additions (to hardcode the additional columns).
To achieve this, I intend to get a cursor by selecting the required fields in the table by the way the where clause of the cursor parameters.
by making a loop through the cursor I will insert the records in the other table.
Here, the thing is that the data is going to be huge (since the year is the parameter).
so my approach causes the performance issue.
I heard that there is a different method of insetions
can anyone suggest me the best way (performance wise) other than what I mentioned (if you are aware of)...
Thank you...user13329002 wrote:
Thanks for everyone.
I have to take the data from the table as e_name, e_code, of the table and insert it into another table with some other values such as
e_name, e_code, as well as I add 'n', 'o'.
its something likeinsert into e_emp(emp_name,emp_code,emp_add,emp_status,emp_type) select e_name,e_code,e_add,'O','N') from e_table where e_date = Parameter.
in other words, the values for Emp_status, emp_type I have no values in the e_table.so table and enter in e_table I have to hard code it.
CAL I hard code as I mentioned in my statement examplecan someone clear me of the foregoing.
Thank you...
Published by: user13329002 on February 15, 2011 20:11
Yes... You can hardcode the values for Emp_status, emp_type.
SQL> CREATE TABLE e_emp(emp_code NUMBER(10),emp_status VARCHAR2(1),emp_type VARCHAR2(1)); Table created. SQL> create table e_table as (select * from e_emp); Table created. SQL> INSERT INTO e_table(emp_code) VALUES('1111'); 1 row created. SQL> insert into e_table(emp_code) values('2222'); 1 row created. SQL> select * from e_table; EMP_CODE E E ---------- - - 1111 2222 SQL> insert into e_emp(emp_code,emp_status,emp_type) (select emp_code,'0','N' from e_table); 2 rows created. SQL> select * from e_emp; EMP_CODE E E ---------- - - 1111 0 N 2222 0 N SQL>
I hope this helps.
Kind regards
Claudy -
Reading file and dump the data into the database using BPEL process
I have to read the CSV file and insert data into the database... To do this, I created some asynchronous bpel process. Adapter filed added and associated with the receive activity... Adapter DB has added and associated with the Invoke activity. Receive two total activity are available in the process when trying to Test em, receive only the first activity is complete and awaits the second receive activity. Please suggest how to proceed with...
Thanks, Maury.
Hi Maury,
There is no need in step 2 that u mentioned above. I donot find useless a webservice?
The process will be launched by the CSV file, then using the processing activity, you can put it in the DB.
There should be no way where you can manually test it by giving an entry. All you can do to test is to put the file in the folder you mentioned when configuring the file adapter.
You just need to have the composite as below:
ReadCSVFile---> BPEL--> DB adapter
And in your BPEL process:
Recieve--> Transformation activity--> call activity
Try to work on some samples listed on the oracle site and go through the below URL:
The playback of the file adapter feature using
Thank you
Deepak.
-
Error with PL/SQL procedure to import data into the database
When you run the procedure below, I get the message:
Compilation failure, line 448
PLS-00103: encountered the symbol "LOOP" when expecting one of the following values: case of the symbol "case" was substituted for the "LOOP" continue. Compilation failure, line 450
PLS-00103: encountered the symbol ";" when expecting one of the following values: case
Can someone help me understand what im missing? Thank you
Deanna
CREATE OR REPLACE PROCEDURE PURSUITS.IMPORT_LEGACY_PURSUIT IS CURSOR DATA_CURSOR IS SELECT * FROM PURSUITS.IMPORT_LEGACY_PURSUIT; CR DATA_CURSOR%ROWTYPE; V_PURSUIT_DATE DATE; V_ROADWAY_TYPE VARCHAR2(5); V_TRAFFIC_FLOW VARCHAR2(8); V_REASON_FOR_INITIATION VARCHAR2(6); V_VEHICLE_MARKING VARCHAR2(8); V_VEHICLE_LIGHTS_ON VARCHAR2(1); V_VEHICLE_SIREN_ON VARCHAR2(1); V_AIRCRAFT_AVAILABLE VARCHAR2(1); V_AIRCRAFT_INVOLVED VARCHAR2(1); V_OTHER_AGENCY_INVOLVED VARCHAR2(1); V_OTHER_AGENCY_STATUS VARCHAR2(8); V_OTHER_AGENCY_COUNT NUMBER(2,0); V_SUSPECT_VEHICLE_TYPE VARCHAR2(2); V_SUSPECT_RACE VARCHAR2(1); V_SUSPECT_ETHNICITY VARCHAR2(1); V_SUSPECT_ID_KNOWN VARCHAR2(1); V_SUSPECT_POSSESS_WEAPON VARCHAR2(1); V_REASON_FOR_TERMINATION VARCHAR2(6); V_REASON_FOR_FLIGHT VARCHAR2(6); V_ACCIDENT VARCHAR2(1); V_ACCIDENT_TYPE VARCHAR2(8); V_ACCIDENT_PARTIES_INVOLVED VARCHAR2(8); V_CASE_COUNT NUMBER; BEGIN OPEN DATA_CURSOR; LOOP FETCH DATA_CURSOR INTO CR; EXIT WHEN DATA_CURSOR%NOTFOUND; --PURSUIT DATE -- IF CR.PURSUIT_DATE = 0 THEN -- V_PURSUIT_DATE :=NULL; -- ELSE -- V_PURSUIT_DATE :=TO_DATE(CR.PURSUIT_DATE,CONCAT('MONTH'/'DAY'/'YEAR'); -- END IF; --ROADWAY TYPE CASE WHEN CR.ROADWAY = 1 THEN V_ROADWAY_TYPE := 'URBAN'; WHEN CR.ROADWAY = 2 THEN V_ROADWAY_TYPE := 'RURAL'; ELSE V_ROADWAY_TYPE := NULL; END CASE; --TRAFFIC FLOW CASE WHEN CR.TRAFFICFLO = 1 THEN V_TRAFFIC_FLOW := 'LIGHT'; WHEN CR.TRAFFICFLO = 2 THEN V_TRAFFIC_FLOW := 'MODERATE'; WHEN CR.TRAFFICFLO = 3 THEN V_TRAFFIC_FLOW := 'HIGH'; ELSE V_TRAFFIC_FLOW := NULL; END_CASE; --INITIATION CODES CASE WHEN CR.INITREASON = 1 THEN V_REASON_FOR_INITIATION := 'SUSACT'; WHEN CR.INITREASON = 2 THEN V_REASON_FOR_INITIATION := 'TRAFVI'; WHEN CR.INITREASON = 3 THEN V_REASON_FOR_INITIATION := 'MISCCR'; WHEN CR.INITREASON = 4 THEN V_REASON_FOR_INITIATION := 'FELONY'; WHEN CR.INITREASON = 5 THEN V_REASON_FOR_INITIATION := 'DUIARR'; WHEN CR.INITREASON = 6 THEN V_REASON_FOR_INITIATION := 'NCICHT'; WHEN CR.INITREASON = 7 THEN V_REASON_FOR_INITIATION := 'OTHERR'; ELSE V_REASON_FOR_INITIATION := NULL; END_CASE; --VEHICLE MARKING CASE WHEN CR.CARMARKS = 1 THEN V_VEHICLE_MARKING := 'MRKLIGHT'; WHEN CR.CARMARKS = 2 THEN V_VEHICLE_MARKING := 'MRKCLEAN'; WHEN CR.CARMARKS = 3 THEN V_VEHICLE_MARKING := 'UNMARKED'; ELSE V_VEHICLE_MARKING := NULL; END CASE; --LIGHTS CASE WHEN CR.LIGHTS_ON = 1 THEN V_VEHICLE_LIGHTS_ON := 'Y'; WHEN CR.LIGHTS_ON = 2 THEN V_VEHICLE_LIGHTS_ON := 'N'; ELSE V_VEHICLE_LIGHTS_ON := NULL; END CASE; --SIREN CASE WHEN CR.SIREN_ON = 1 THEN V_VEHICLE_SIREN_ON := 'Y'; WHEN CR.SIREN_ON = 2 THEN V_VEHICLE_SIREN_ON := 'N'; ELSE V_VEHICLE_SIREN_ON := NULL; END CASE; --AIRCRAFT AVAILABLE CASE WHEN CR.AIRCRAFTAV = 1 THEN V_AIRCRAFT_AVAILABLE := 'Y'; WHEN CR.AIRCRAFTAV = 2 THEN V_AIRCRAFT_AVAILABLE := 'N'; WHEN CR.AIRCRAFTAV = 3 THEN V_AIRCRAFT_AVAILABLE := 'U'; ELSE V_AIRCRAFT_AVAILABLE := NULL; END CASE; --AIRCRAFT INVOLVED CASE WHEN CR.AIRCRAFTIN = 1 THEN V_AIRCRAFT_INVOLVED := 'Y'; WHEN CR.AIRCRAFTIN = 2 THEN V_AIRCRAFT_INVOLVED := 'N'; ELSE V_AIRCRAFT_INVOLVED := NULL; END CASE; --AGENCY INVOLVED CASE WHEN CR.OTHRAGENCY = 1 THEN V_OTHER_AGENCY_INVOLVED := 'Y'; WHEN CR.OTHRAGENCY = 2 THEN V_OTHER_AGENCY_INVOLVED := 'N'; ELSE V_OTHER_AGENCY_INVOLVED := NULL; END CASE; --AGENCY STATUS CASE WHEN CR.STATUS = 1 THEN V_OTHER_AGENCY_STATUS := 'INITIATE'; WHEN CR.STATUS = 2 THEN V_OTHER_AGENCY_STATUS := 'ASSISTED'; ELSE V_OTHER_AGENCY_STATUS := NULL; END CASE; --SUSPECT VEHICLE TYPE CASE WHEN CR.VEHICLETYP = 1 THEN V_SUSPECT_VEHICLE_TYPE := 'SD'; WHEN CR.VEHICLETYP = 2 THEN V_SUSPECT_VEHICLE_TYPE := 'MC'; WHEN CR.VEHICLETYP = 3 THEN V_SUSPECT_VEHICLE_TYPE := 'VN'; WHEN CR.VEHICLETYP = 4 THEN V_SUSPECT_VEHICLE_TYPE := 'PK'; WHEN CR.VEHICLETYP = 5 THEN V_SUSPECT_VEHICLE_TYPE := 'DS'; WHEN CR.VEHICLETYP = 6 THEN V_SUSPECT_VEHICLE_TYPE := 'OT'; ELSE V_SUSPECT_VEHICLE_TYPE := NULL; END CASE; --SUSPECT RACE AND ETHNICITY IF CR.RACE = 'H' THEN V_SUSPECT_RACE := 'W'; ELSE V_SUSPECT_RACE := CR.RACE; END IF; --SUSPECT ETHNICITY IF CR.RACE = 'H' THEN V_SUSPECT_ETHNICITY := 'H' ELSE V_SUSPECT_ETHNICITY := NULL; END IF; --SUSPECT ID CASE WHEN CR.ID_KNOWN = 1 THEN V_SUSPECT_ID_KNOWN := 'Y'; WHEN CR.ID_KNOWN = 2 THEN V_SUSPECT_ID_KNOWN := 'N'; ELSE V_SUSPECT_ID_KNOWN := NULL; END CASE; --SUSPECT WEAPON CASE WHEN CR.WEAPON = 1 THEN V_SUSPECT_POSSESS_WEAPON := 'Y'; WHEN CR.WEAPON = 2 THEN V_SUSPECT_POSSESS_WEAPON := 'N'; ELSE V_SUSPECT_POSSESS_WEAPON := NULL; END CASE; --TERMINATION REASON CASE WHEN CR.TERMREASON = 1 THEN V_REASON_FOR_TERMINATION := 'DVRVOL'; WHEN CR.TERMREASON = 2 THEN V_REASON_FOR_TERMINATION := 'ALATER'; WHEN CR.TERMREASON = 3 THEN V_REASON_FOR_TERMINATION := 'VEHDIS'; WHEN CR.TERMREASON = 4 THEN V_REASON_FOR_TERMINATION := 'VEHWRK'; WHEN CR.TERMREASON = 5 THEN V_REASON_FOR_TERMINATION := 'ROADBL'; WHEN CR.TERMREASON = 6 THEN V_REASON_FOR_TERMINATION := 'STOPST'; WHEN CR.TERMREASON = 7 THEN V_REASON_FOR_TERMINATION := 'RAMMED'; WHEN CR.TERMREASON = 8 THEN V_REASON_FOR_TERMINATION := 'WEAPON'; WHEN CR.TERMREASON = 9 THEN V_REASON_FOR_TERMINATION := 'DVRINJ'; WHEN CR.TERMREASON = 10 THEN V_REASON_FOR_TERMINATION := 'OFFTER'; WHEN CR.TERMREASON = 11 THEN V_REASON_FOR_TERMINATION := 'SUPTER'; WHEN CR.TERMREASON = 12 THEN V_REASON_FOR_TERMINATION := 'PATDIS'; WHEN CR.TERMREASON = 13 THEN V_REASON_FOR_TERMINATION := 'PATWRK'; WHEN CR.TERMREASON = 14 THEN V_REASON_FOR_TERMINATION := 'LOSTEM'; WHEN CR.TERMREASON = 15 THEN V_REASON_FOR_TERMINATION := 'FLEDAB'; WHEN CR.TERMREASON = 16 THEN V_REASON_FOR_TERMINATION := 'FLEDWK'; WHEN CR.TERMREASON = 17 THEN V_REASON_FOR_TERMINATION := 'OFFINJ'; WHEN CR.TERMREASON = 18 THEN V_REASON_FOR_TERMINATION := 'OTHAGY'; ELSE V_REASON_FOR_TERMINATION := NULL; END CASE; --FLIGHT REASON CASE WHEN CR.FLI_REASON = 1 THEN V_REASON_FOR_FLIGHT := 'SUMMON'; WHEN CR.FLI_REASON = 2 THEN V_REASON_FOR_FLIGHT := 'DUIARR'; WHEN CR.FLI_REASON = 3 THEN V_REASON_FOR_FLIGHT := 'FELONY'; WHEN CR.FLI_REASON = 4 THEN V_REASON_FOR_FLIGHT := 'STOLEN'; WHEN CR.FLI_REASON = 5 THEN V_REASON_FOR_FLIGHT := 'MISDEM'; WHEN CR.FLI_REASON = 6 THEN V_REASON_FOR_FLIGHT := 'DRUGAR'; WHEN CR.FLI_REASON = 7 THEN V_REASON_FOR_FLIGHT := 'FEARPO'; WHEN CR.FLI_REASON = 8 THEN V_REASON_FOR_FLIGHT := 'NODVRL'; WHEN CR.FLI_REASON = 9 THEN V_REASON_FOR_FLIGHT := 'NOINSU'; WHEN CR.FLI_REASON = 10 THEN V_REASON_FOR_FLIGHT := 'PARENT'; WHEN CR.FLI_REASON = 11 THEN V_REASON_FOR_FLIGHT := 'MENTAL'; WHEN CR.FLI_REASON = 12 THEN V_REASON_FOR_FLIGHT := 'OTHERR'; ELSE V_REASON_FOR_FLIGHT := NULL; END CASE; --ACCIDENT CASE WHEN CR.ACCIDENT = 1 THEN V_ACCIDENT := 'Y'; WHEN CR.ACCIDENT = 2 THEN V_ACCIDENT := 'N'; ELSE V_ACCIDENT := NULL; END CASE; --ACCIDENT TYPE CASE WHEN CR.ACCDNTTYPE = 1 THEN V_ACCIDENT_TYPE := 'PROPERTY DAMAGE'; WHEN CR.ACCDNTTYPE = 2 THEN V_ACCIDENT_TYPE := 'INJURY'; WHEN CR.ACCDNTTYPE = 3 THEN V_ACCIDENT_TYPE := 'FATALITY'; ELSE V_ACCIDENT_TYPE := NULL; END CASE; --ACCIDENT PARTIES INVOLVED CASE WHEN CR.ACCPARTIES = 1 THEN V_ACCIDENT_PARTIES_INVOLVED := 'SUSPONLY'; WHEN CR.ACCPARTIES = 2 THEN V_ACCIDENT_PARTIES_INVOLVED := 'THRDONLY'; WHEN CR.ACCPARTIES = 3 THEN V_ACCIDENT_PARTIES_INVOLVED := 'POLIONLY'; WHEN CR.ACCPARTIES = 4 THEN V_ACCIDENT_PARTIES_INVOLVED := 'POLISUSP'; WHEN CR.ACCPARTIES = 5 THEN V_ACCIDENT_PARTIES_INVOLVED := 'POLITHRD'; WHEN CR.ACCPARTIES = 6 THEN V_ACCIDENT_PARTIES_INVOLVED := 'SUSPTHRD'; WHEN CR.ACCPARTIES = 7 THEN V_ACCIDENT_PARTIES_INVOLVED := 'ALLPARTY'; ELSE V_ACCIDENT_PARTIES_INVOLVED := NULL; END CASE; SELECT COUNT(*) INTO V_CASE_COUNT FROM PURSUITS.IMPORT_LEGACY_PURSUIT WHERE CASE_NUMBER = CR.LOCCASENUM; CASE WHEN V_CASE_COUNT = 0 THEN DBMS_OUTPUT.PUT_LINE ('DONE'); --INSERT DATA INTO TABLE INSERT INTO PURSUITS.IMPORT_LEGACY_PURSUIT( CASE_NUMBER, OFFICER_LNAME, OFFICER_FNAME, OFFICER_MI, OFFICER_NAME_HP261, OFFICER_RADIO, OFFICER_VEH_UNIT, OFFICER_TROOP, OFFICER_ZONE, OFFICER_YEARS_SERVICE, PURSUIT_TIME_BEGAN, PURSUIT_DATE, PURSUIT_DOW, PURSUIT_TIME_ENDED, DURATION_MILES, DURATION_MINUTES, SPEED_MAX, ROADWAY_TYPE, TRAFFIC_FLOW, REASON_FOR_INITIATION, REASON_FOR_INITIATION_OTHER, VEHICLE_MARKING, VEHICLE_LIGHTS_ON, VEHICLE_SIREN_ON, VEHICLE_COUNT_MARKED_TOPLIGHT, VEHICLE_COUNT_UNMARKED, VEHICLE_COUNT_MARKED_CLEAN, AIRCRAFT_AVAILABLE, AIRCRAFT_INVOLVED, OTHER_AGENCY_INVOLVED, OTHER_AGENCY_STATUS, OTHER_AGENCY_COUNT, SUSPECT_VEHICLE_TYPE, SUSPECT_VEHICLE_TYPE_OTHER, SUSPECT_AGE, SUSPECT_GENDER, SUSPECT_RACE, SUSPECT_ETHNICITY, SUSPECT_ID_KNOWN, SUSPECT_POSSESS_WEAPON, SUSPECT_DUI, SUSPECT_BAC, REASON_FOR_TERMINATION, REASON_FOR_FLIGHT, REASON_FOR_FLIGHT_OTHER, ACCIDENT, ACCIDENT_TYPE, ACCIDENT_PARTIES_INVOLVED, IMMEDIATE_SUPERVISOR, TROOP_COMMANDER) VALUES( CR.LOCASENUM, NULL, NULL, NULL, CR.N/A, CR.RADIO_NUM, CR.UNIT_NUM, CR.TROOP, CR.ZONE, CR.YRSSERVICE, CR.TIMEBEGAN, V_PURSUIT_DATE, CR.DAYOFWEEK, CR.TIME_ENDED, CR.MILES, CR.MINUTES, CR.MPH, V_ROADWAY_TYPE, V_TRAFFIC_FLOW, V_REASON_FOR_INITIATION, CR.OTHER1, V_VEHICLE_MARKING, V_VEHICLE_LIGHTS_ON, V_VEHICLE_SIREN_ON, CR.MARKED_TL, CR.UNMARKED, CR.MARKED_CR, V_AIRCRAFT_AVAILABLE, V_AIRCRAFT_INVOLVED, V_OTHER_AGENCY_INVOLVED, V_AGENCY_STATUS, CR.NUM_VEH, V_SUSPECT_VEHICLE_TYPE, CR.OTHER2, CR.AGE, CR.SEX, V_SUSPECT_RACE, CR.N/A, V_SUSPECT_ID_KNOWN, V_SUSPECT_POSSESS_WEAPON, CR.DUI, CR.BAC_PERCNT, V_REASON_FOR_TERMINATION, V_REASON_FOR_FLIGHT, CR.OTHER3, V_ACCIDENT, V_ACCIDENT_TYPE, V_ACCIDENT_PARTIES_INVOLVED, NULL, NULL); END LOOP; CLOSE DATA_CURSOR; END;
Deanna,
Question, I don't understand why you're selecting in import_legacy_pursuit and insertion in the same table?
It would be wonderful if you can display the structure of the table and 1 or 2 fictitious example of records.
cursor cr is SELECT * FROM import_legacy_pursuit; ... ... INSERT INTO import_legacy_pursuit ( case_number, officer_lname, .... .. ) values (..... ...);
In any case, I made some changes to the procedure, you must replace the Insert with your statement and post if it worked for you.
DECLARE CURSOR data_cursor IS SELECT * FROM import_legacy_pursuit; cr data_cursor%ROWTYPE; v_pursuit_date DATE; v_roadway_type VARCHAR2 (15); v_traffic_flow VARCHAR2 (18); v_reason_for_initiation VARCHAR2 (16); v_vehicle_marking VARCHAR2 (18); v_vehicle_lights_on VARCHAR2 (11); v_vehicle_siren_on VARCHAR2 (11); v_aircraft_available VARCHAR2 (11); v_aircraft_involved VARCHAR2 (11); v_other_agency_involved VARCHAR2 (11); v_other_agency_status VARCHAR2 (18); v_other_agency_count NUMBER (4, 0); v_suspect_vehicle_type VARCHAR2 (20); v_suspect_race VARCHAR2 (11); v_suspect_ethnicity VARCHAR2 (11); v_suspect_id_known VARCHAR2 (11); v_suspect_possess_weapon VARCHAR2 (11); v_reason_for_termination VARCHAR2 (11); v_reason_for_flight VARCHAR2 (11); v_accident VARCHAR2 (11); v_accident_type VARCHAR2 (18); v_accident_parties_involved VARCHAR2 (18); v_lo_number VARCHAR2 (50); v_case_count NUMBER; BEGIN OPEN data_cursor; LOOP FETCH data_cursor INTO cr; EXIT WHEN data_cursor%NOTFOUND; --PURSUIT DATE -- IF CR.PURSUIT_DATE = 0 THEN -- V_PURSUIT_DATE :=NULL; -- ELSE -- V_PURSUIT_DATE :=TO_DATE(CR.PURSUIT_DATE,CONCAT('MONTH'/'DAY'/'YEAR'); -- END IF; --ROADWAY TYPE CASE WHEN cr.roadway = 1 THEN v_roadway_type := 'URBAN'; WHEN cr.roadway = 2 THEN v_roadway_type := 'RURAL'; ELSE v_roadway_type := NULL; END CASE; --TRAFFIC FLOW CASE WHEN cr.trafficflo = 1 THEN v_traffic_flow := 'LIGHT'; WHEN cr.trafficflo = 2 THEN v_traffic_flow := 'MODERATE'; WHEN cr.trafficflo = 3 THEN v_traffic_flow := 'HIGH'; ELSE v_traffic_flow := NULL; END CASE; --INITIATION CODES CASE WHEN cr.initreason = 1 THEN v_reason_for_initiation := 'SUSACT'; WHEN cr.initreason = 2 THEN v_reason_for_initiation := 'TRAFVI'; WHEN cr.initreason = 3 THEN v_reason_for_initiation := 'MISCCR'; WHEN cr.initreason = 4 THEN v_reason_for_initiation := 'FELONY'; WHEN cr.initreason = 5 THEN v_reason_for_initiation := 'DUIARR'; WHEN cr.initreason = 6 THEN v_reason_for_initiation := 'NCICHT'; WHEN cr.initreason = 7 THEN v_reason_for_initiation := 'OTHERR'; ELSE v_reason_for_initiation := NULL; END CASE; --VEHICLE MARKING CASE WHEN cr.carmarks = 1 THEN v_vehicle_marking := 'MRKLIGHT'; WHEN cr.carmarks = 2 THEN v_vehicle_marking := 'MRKCLEAN'; WHEN cr.carmarks = 3 THEN v_vehicle_marking := 'UNMARKED'; ELSE v_vehicle_marking := NULL; END CASE; --LIGHTS CASE WHEN cr.lights_on = 1 THEN v_vehicle_lights_on := 'Y'; WHEN cr.lights_on = 2 THEN v_vehicle_lights_on := 'N'; ELSE v_vehicle_lights_on := NULL; END CASE; --SIREN CASE WHEN cr.siren_on = 1 THEN v_vehicle_siren_on := 'Y'; WHEN cr.siren_on = 2 THEN v_vehicle_siren_on := 'N'; ELSE v_vehicle_siren_on := NULL; END CASE; --AIRCRAFT AVAILABLE CASE WHEN cr.aircraftav = 1 THEN v_aircraft_available := 'Y'; WHEN cr.aircraftav = 2 THEN v_aircraft_available := 'N'; WHEN cr.aircraftav = 3 THEN v_aircraft_available := 'U'; ELSE v_aircraft_available := NULL; END CASE; --AIRCRAFT INVOLVED CASE WHEN cr.aircraftin = 1 THEN v_aircraft_involved := 'Y'; WHEN cr.aircraftin = 2 THEN v_aircraft_involved := 'N'; ELSE v_aircraft_involved := NULL; END CASE; --AGENCY INVOLVED CASE WHEN cr.othragency = 1 THEN v_other_agency_involved := 'Y'; WHEN cr.othragency = 2 THEN v_other_agency_involved := 'N'; ELSE v_other_agency_involved := NULL; END CASE; --AGENCY STATUS CASE WHEN cr.status = 1 THEN v_other_agency_status := 'INITIATE'; WHEN cr.status = 2 THEN v_other_agency_status := 'ASSISTED'; ELSE v_other_agency_status := NULL; END CASE; --SUSPECT VEHICLE TYPE CASE WHEN cr.vehicletyp = 1 THEN v_suspect_vehicle_type := 'SD'; WHEN cr.vehicletyp = 2 THEN v_suspect_vehicle_type := 'MC'; WHEN cr.vehicletyp = 3 THEN v_suspect_vehicle_type := 'VN'; WHEN cr.vehicletyp = 4 THEN v_suspect_vehicle_type := 'PK'; WHEN cr.vehicletyp = 5 THEN v_suspect_vehicle_type := 'DS'; WHEN cr.vehicletyp = 6 THEN v_suspect_vehicle_type := 'OT'; ELSE v_suspect_vehicle_type := NULL; END CASE; --SUSPECT RACE AND ETHNICITY IF cr.race = 'H' THEN v_suspect_race := 'W'; ELSE v_suspect_race := cr.race; END IF; --SUSPECT ETHNICITY IF cr.race = 'H' THEN v_suspect_ethnicity := 'H'; ELSE v_suspect_ethnicity := NULL; END IF; --SUSPECT ID CASE WHEN cr.id_known = 1 THEN v_suspect_id_known := 'Y'; WHEN cr.id_known = 2 THEN v_suspect_id_known := 'N'; ELSE v_suspect_id_known := NULL; END CASE; --SUSPECT WEAPON CASE WHEN cr.weapon = 1 THEN v_suspect_possess_weapon := 'Y'; WHEN cr.weapon = 2 THEN v_suspect_possess_weapon := 'N'; ELSE v_suspect_possess_weapon := NULL; END CASE; --TERMINATION REASON CASE WHEN cr.termreason = 1 THEN v_reason_for_termination := 'DVRVOL'; WHEN cr.termreason = 2 THEN v_reason_for_termination := 'ALATER'; WHEN cr.termreason = 3 THEN v_reason_for_termination := 'VEHDIS'; WHEN cr.termreason = 4 THEN v_reason_for_termination := 'VEHWRK'; WHEN cr.termreason = 5 THEN v_reason_for_termination := 'ROADBL'; WHEN cr.termreason = 6 THEN v_reason_for_termination := 'STOPST'; WHEN cr.termreason = 7 THEN v_reason_for_termination := 'RAMMED'; WHEN cr.termreason = 8 THEN v_reason_for_termination := 'WEAPON'; WHEN cr.termreason = 9 THEN v_reason_for_termination := 'DVRINJ'; WHEN cr.termreason = 10 THEN v_reason_for_termination := 'OFFTER'; WHEN cr.termreason = 11 THEN v_reason_for_termination := 'SUPTER'; WHEN cr.termreason = 12 THEN v_reason_for_termination := 'PATDIS'; WHEN cr.termreason = 13 THEN v_reason_for_termination := 'PATWRK'; WHEN cr.termreason = 14 THEN v_reason_for_termination := 'LOSTEM'; WHEN cr.termreason = 15 THEN v_reason_for_termination := 'FLEDAB'; WHEN cr.termreason = 16 THEN v_reason_for_termination := 'FLEDWK'; WHEN cr.termreason = 17 THEN v_reason_for_termination := 'OFFINJ'; WHEN cr.termreason = 18 THEN v_reason_for_termination := 'OTHAGY'; ELSE v_reason_for_termination := NULL; END CASE; --FLIGHT REASON CASE WHEN cr.fli_reason = 1 THEN v_reason_for_flight := 'SUMMON'; WHEN cr.fli_reason = 2 THEN v_reason_for_flight := 'DUIARR'; WHEN cr.fli_reason = 3 THEN v_reason_for_flight := 'FELONY'; WHEN cr.fli_reason = 4 THEN v_reason_for_flight := 'STOLEN'; WHEN cr.fli_reason = 5 THEN v_reason_for_flight := 'MISDEM'; WHEN cr.fli_reason = 6 THEN v_reason_for_flight := 'DRUGAR'; WHEN cr.fli_reason = 7 THEN v_reason_for_flight := 'FEARPO'; WHEN cr.fli_reason = 8 THEN v_reason_for_flight := 'NODVRL'; WHEN cr.fli_reason = 9 THEN v_reason_for_flight := 'NOINSU'; WHEN cr.fli_reason = 10 THEN v_reason_for_flight := 'PARENT'; WHEN cr.fli_reason = 11 THEN v_reason_for_flight := 'MENTAL'; WHEN cr.fli_reason = 12 THEN v_reason_for_flight := 'OTHERR'; ELSE v_reason_for_flight := NULL; END CASE; --ACCIDENT CASE WHEN cr.accident = 1 THEN v_accident := 'Y'; WHEN cr.accident = 2 THEN v_accident := 'N'; ELSE v_accident := NULL; END CASE; --ACCIDENT TYPE CASE WHEN cr.accdnttype = 1 THEN v_accident_type := 'PROPERTY DAMAGE'; WHEN cr.accdnttype = 2 THEN v_accident_type := 'INJURY'; WHEN cr.accdnttype = 3 THEN v_accident_type := 'FATALITY'; ELSE v_accident_type := NULL; END CASE; --ACCIDENT PARTIES INVOLVED CASE WHEN cr.accparties = 1 THEN v_accident_parties_involved := 'SUSPONLY'; WHEN cr.accparties = 2 THEN v_accident_parties_involved := 'THRDONLY'; WHEN cr.accparties = 3 THEN v_accident_parties_involved := 'POLIONLY'; WHEN cr.accparties = 4 THEN v_accident_parties_involved := 'POLISUSP'; WHEN cr.accparties = 5 THEN v_accident_parties_involved := 'POLITHRD'; WHEN cr.accparties = 6 THEN v_accident_parties_involved := 'SUSPTHRD'; WHEN cr.accparties = 7 THEN v_accident_parties_involved := 'ALLPARTY'; ELSE v_accident_parties_involved := NULL; END CASE; SELECT COUNT ( * ) INTO v_case_count FROM import_legacy_pursuit WHERE case_number = cr.loccasenum; IF v_case_count = 0 THEN DBMS_OUTPUT.put_line ('DONE'); -- PLEASE assign all cursor values to some variables ; e.g v_lo_number := cr.loccasenum; INSERT INTO import_legacy_pursuit ( case_number, fli_reason ) VALUES (v_lo_number, v_reason_for_flight); ELSE DBMS_OUTPUT.put_line ('Nothing inserted'); END IF; END LOOP; COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 300)); RAISE; END;
Concerning
-
How can I insert data from another table into a table containing a timestamp column
How you insert data from another table in a table if the target table contains a timestamp column. I tried to set the default value of GETDATE() column in the target table, but it does not work.
I use MS SQLSorry, I managed to get around this by inserting null as the value
Maybe you are looking for
-
Impossible to paste into the e-mail after updating ios 10.0.1
After 10 ios update cannot paste into emails on iphone 6, iphone 5 and ipad.
-
Satellite L300-01:00 - Win 7 hangs after 10-15 minutes of use
Hello people! So, I installed Windows 7 Ultimate on my laptop, but I have problems...Everything seems to work fine for a while, but when I leave work (also with no programs running in the backround) for 10-15 minutes and I'll be back, system crashed.
-
17 Alienware r3 CPU temperatures.
Hello, I had 17 r3 with intel 6700hq processor, or even when Idle, cpu is about 50 celsius, hits 60. When I did a comparison test on UERX he hit 86 celsius... should I worry?
-
How to make an app a favorite to BPB app?
Someone knows how to make an application a favorite on the PlayBook app?
-
Network Access Protection agent
Windows maintenance Center reports that the 'Network Access Protection Agent' is turned OFF. How do I activate it?