The Oracle procedure update
We have two tables.
1 EMP_STAGE 2. FM3
Finding the structure for the two tables above.
EMP_STAGE EMP
----------------- --------
EMP_ID ID
PAN EMP_PAN
STATUS STATUS
LAST_DAY EMP_FLAG
END_DATE
one of our table EMP_STAGE requests get data then the EMP_STAGE of the table data will be loaded into the EMP table.
I need to write a procedure, based on the results of the table EMP_STAGE table EMPLOYEE should as update.
1. If the employee is still with the organization that the STATE is 'Active' in the EMP_STAGE table if he resigns or terminated its status should be 'inactive' and LAST_DAY (date format) of data used has also updated in the EMP_STAG table.
2. during the loading of data into the EMP table based on the data of EMP_STAGE, in the employee table employee STATUS = "ACTIVE/INACTIVE" and end_date = LAST_DAY (from table EMP_STAGE) based on both the EMP_FLAG column updates as EMP_FLAG = (If employee was then 'YES' else 'NO');
Please give me your opinion on this.
Thanks for posting the sample data, I'm unable to reproduce your problem. As Hoek said, it is because of duplicates in your data. You can check the link above to understand the issue.
However, my illustration here is how to do it.
Suppose that the emp table has only a single folder, if a new employee is in EMP_STAGE table, his information should be added in the transactional table EMP.
Under scenario
101 is the new employee, then inserted
100 is used existing, as well as its details are updated.
SQL >
SQL > select * from v version $;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE Production 11.2.0.2.0
AMT for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL >
SQL > DROP SEQUENCE emp_id_seq;
Sequence has fallen.
SQL > DROP TABLE emp;
Deleted table.
SQL > DROP TABLE emp_stage;
Deleted table.
SQL >
SQL > CREATE SEQUENCE emp_id_seq
2. START WITH 1
MAXVALUE 3 100
MINVALUE 4 0;
Order of creation.
SQL >
SQL > CREATE TABLE emp
() 2
3 IDENTIFICATION NUMBER,
NUMBER OF EMP_PAN 4.
5 SITUATION VARCHAR2 (10),
6 EMP_FLAG VARCHAR2 (1).
End_date DATE 7
8 );
Table created.
SQL >
SQL > CREATE TABLE emp_stage
() 2
NO. 3,
4 STATUS VARCHAR2 (10),
5 LAST_DAY DATE
6 );
Table created.
SQL >
SQL >
SQL > INSERT INTO emp
2. SELECT 1 id,
3 100 emp_pan,
4 'active ',.
5 'Y',
6 SYSDATE - 1
7 FROM DUAL;
1 line of creation.
SQL >
SQL > INSERT INTO emp_stage
2. SELECT 100 pan, 'Active', SYSDATE FROM DUAL;
1 line of creation.
SQL >
SQL > INSERT INTO emp_stage
2. SELECT pan 101, 'Active', NULL FROM DUAL;
1 line of creation.
SQL >
SQL > MERGE IN emp e
2 use emp_stage
3 on (es. PAN = e.emp_PAN)
4 WHEN MATCHED
5 THEN
6 UPDATE SET e.end_date =. LAST_DAY, e.status = es.status
7 WHEN NOT MATCHED
8 THEN
9. INSERT (e.id,
emp_pan 10,
11 end_date
12 status)
13 VALUES (emp_id_seq. NEXTVAL,
ES.Pan 14,
15 es. LAST_DAY,
16 es.status);
2 lines merged.
SQL > commit;
validation complete.
SQL > SELECT * FROM emp;
ID EMP_PAN STATUS E END_DATE
---------- ---------- ---------- - ---------
1 100 Y active 27 August 13
2 101 active
SQL >
SQL > SELECT * from emp_stage;
PAN STATUS LAST_DAY
---------- ---------- ---------
100 active 27 August 13
Active 101
Thank you
GPU
Tags: Database
Similar Questions
-
Can someone tell me the exact procedure updated the BIOS on an Aspire V5 - 122P.
Can someone tell me the exact procedure updated the BIOS on an Aspire V5 - 122P. I upgraded from Windows 8.1 for Windows 10. I read somewhere that the upgrade of BIOS ver 2.10 and 2.12 will improve the speed at which it runs. It seems that here are slow running problems with this machine.
I also know enough to know that an executed incorrecly BIOS update can cause a wipe on then, please, if you have done this correctly, please share your experience.
I downloaded the file and the readme says: Windows flash: Please click on "SOBI0210.exe" for updating the bios.
I didn't get this in case it defines something moving that I don't understand.
[subject line changed to reflect the new topic]
Hello
There is nothing special for the update of the BIOS.
Just download the BIOS, make sure that your laptop is plugged in (and also that he above 60% battery in any case), and run the file that you downloaded.
BIOS Acer BIOS 2.12 3.2 MB 24/07/2014 Download -
Access to the Oracle procedure table
Hi all
I can pass the array as a parameter of procedure Oracle object?
Application procedure for the environment to run Java and we pass the java array object as a parameter
Thanks in advance...
Kind regards...http://lmgtfy.com/?q=Java+pass+array+to+Oracle+procedure
-
How to debug the Oracle procedure
Hi friends,
I've migrated oracle procedure from Oracle 8.0.4 DB of NT to DB Oracle 9.2.0 on IBM AIX.
When I test/execute the procedure on the Db 9.2.0, she still runs and did not end.
How to debug an Oracle procedure to check if it's a loop on the same block foever, what "current" values is owner and what tables he read to, or procedure does never loops as if it is not to satisfy one of the conditions?
Thank you very muchIs coding "infinite loop" a bad habit of programming?
Yes, you can call it such.
Personally, I prefer to use loops.
See http://tahiti.oracle.com for the different types of loops that you can use.How can I change this infinite loop in a "finite" without changing the logic of the program?
You can use EXIT WHEN "certain conditions."
For example, you can add OUTPUT WHEN cursorname % notfound, or some counter to reach a specific value in your loop, to 'force' the loop to stop.
See the docs or do a search on this forum for more examples. -
Number of declaration in the oracle procedure
Hi guys,.
SELECT col1_name IN the host_name FROM tbl_name WHERE col2_name = 'XXX ';
DECLARE
l_url VARCHAR2 (256): = ' host_name? XXXX & xxxxx & xxxx';
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
BEGIN
l_http_request: = UTL_HTTP.begin_request (l_url);
l_http_response: = UTL_HTTP.get_response (l_http_request);
Utl_http.end_response (l_http_response);
END;
Above is the my code. I am trying to set the value of col1_name in the host_name and call host_name in the query string. But iam unable to send the request such that it does not touch the host machine.
value of HOST_NAME is already added inside the table_name.
Help, please.
Correct code
DECLARE
l_url VARCHAR2 (256);
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
BEGIN
SELECT col1_name INTO host_name
FROM col2_name WHERE table_name = 'XXX ';
l_url: = host_name |'? xxxx xxxxx & &xxxx';
l_http_request: = UTL_HTTP.begin_request (l_url);
l_http_response: = UTL_HTTP.get_response (l_http_request);
Utl_http.end_response (l_http_response);
END;
Obviously the SELECT statement must be IN a BEGIN END block, is not outside of the
and you need concatenate the variable with the string hard-coded.
-------------------
Sybrand Bakker
Senior Oracle DBA
-
Hello
I am currently on version Oracle Database 10 g Release 10.2.0.3.0 - Production
Our client will upgrade the application with Tridion 2011 and it supports 10.2.0.5.0 and beyond.
Then they asked for 10.2.0.5.0 and 11.2.0.1.
Please tell me license cost for oracle 11.2.0.1 (10.2.0.3 upgrade)
Thank you
HimanshuYou should be able to download the Group of hotfixes (8202632) with your first support account. For download of the PSU, you need extended support.
-
SSL mutual authentication using the Oracle stored procedure
Hello
DB version:
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Is possible to perform mutual authentication SSL uses the Oracle stored procedure?
I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs). But I would like to know if it's possible and how.
In other is words there a way to incorporate the client certificate information into a procedure that calls a Web service.
I read the articles to do it in JAVA or .net. But please advice how we can achieve using Oracle procedures.
Thank you.934451 wrote:
Is possible to perform mutual authentication SSL uses the Oracle stored procedure?
To learn more. SSL what for?
Oracle PL/SQL only supports client standard TCP sockets. However, interface for HTTP, Oracle PL/SQL also supports HTTPS - which requires the certificates of authentication of the server to be stored in a portfolio of Oracle web and used during the transmission via HTTPS. See the code example {message identifier: = 1925297} for more details.
I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs).
Forums and articles written by idiots. For idiots.
And no, I'm not to embellish my response to this pitch that you met. It is false. It is written by ignorant people who don't know ANYTHING about the use of Oracle and PL/SQL. And feel free to forward my response to these idiots. They find me here if they want to argue...
As an example of how to call a web service, see {message identifier: = 10158148} and {message: id = 10448611}.
-
Friends and experts, DB: 11 GR 2
Can someone guide me how can I write the Oracle procedure to query data in a loop?
Sounds really complicated and do not know, even if it is possible.
Table contains 500 lines of millet
Basically, I try to find below in the output
1. what host/pid continuously for 5 minutes with more than 75% of cpu
2. get the average start and end with CPU time
3. get top 5 folders for each type of host by avg_cpu
Table: tab1
Data in the table:
Date server pid cpu_used
01/01/2015-02:00 75 1234 s1
01/01/2015-02:01 75 1234 s1
01/01/2015 s1 02:02 80 1234
01/01/2015 s1 02:03 75 1234
01/01/2015 02:04 90 1234 s1
01/01/2015 s1 02:05 1234 75
01/01/2015 s1 02:06 70 1111
01/01/2015 s2 02:04 85 5678
01/01/2015 s2 02:05 90 5678
01/01/2015 s2 02:06 75 5678
01/01/2015 s2 02:07 80 5678
01/01/2015 s2 02:08 90 5678
01/01/2015 s2 02:09 90 5678
01/01/2015 s1 02:09 60 1234
Example of output
Server pid start_date end_date avg_cpu
S1 1234 01/01/2015 02:00 01/01/2015 02:05 85
S2 01/01/2015 5678, 02; 04:00 01/01/2015 02:09 84
with
tab1 as
(select to_date (1 January 2015 02:00 "," mm/dd/yyyy hh) date_, 's1' server, 1234 pid, 75 cpu_used Union double all the)
Select to_date (1 January 2015 02:01 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (1 January 2015 02:02 "," mm/dd/yyyy hh), "s1", 1234, 80 of double union all
Select to_date (1 January 2015 02:03 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (1 January 2015 02:04 ',' dd/mm/yyyy hh), "s1", 1234, 90 double Union all
Select to_date (1 January 2015 02:05 ',' dd/mm/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (1 January 2015 02:06 "," mm/dd/yyyy hh), "s1", 1234, 78 double Union all
Select to_date (1 January 2015 02:07 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (January 1, 2015 08:02 "," mm/dd/yyyy hh), "s1", 1234, 80 of double union all
Select to_date (1 January 2015 02:09 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (1 January 2015 02:10 "," mm/dd/yyyy hh), "s1", 1234, 90 double Union all
Select to_date (1 January 2015 02:11 "," mm/dd/yyyy hh), "s1", 1234, 75 double Union all
Select to_date (1 January 2015 02:12 "," mm/dd/yyyy hh), "s1", 1111, 70 double Union all
Select to_date (1 January 2015 02:04 ',' dd/mm/yyyy hh), 's2', 5678, 85 double Union all
Select to_date (1 January 2015 02:05 ',' dd/mm/yyyy hh), 's2', 5678, 90 double Union all
Select to_date (1 January 2015 02:06 "," mm/dd/yyyy hh), 's2', 5678, 75 double Union all
Select to_date (1 January 2015 02:07 "," mm/dd/yyyy hh), 's2', 5678, 80 of double union all
Select to_date (January 1, 2015 08:02 "," mm/dd/yyyy hh), 's2', 5678, 90 double Union all
Select to_date (1 January 2015 02:09 "," mm/dd/yyyy hh), 's2', 5678, 90 double Union all
Select to_date (1 January 2015 02:15 "," mm/dd/yyyy hh), "s1", 1234, 60 double
)
Select Server pid, start_date, end_date, avg_cpu
(select Server,
nest,
start_date to_char (min (date_), ' mm/dd/yyyy HH'),
End_date to_char (max (date_), ' mm/dd/yyyy HH'),
Round (AVG (cpu_used), 2) avg_cpu.
ROW_NUMBER() on rn (partition by order of servers by avg (cpu_used) desc)
(select date_, pid, cpu_used,
5 * ceil (row_number () over (partition by server, pid, case when cpu_used > = 75 then 1 by date_ end order) / 5) w,
ROW_NUMBER() over (partition by order of servers by pid, date_).
ROW_NUMBER() over (partition by server, pid, case when cpu_used > = 75 then 1 by date_ end order) g
of tab1
)
Group server, pid, g, w
having count (*) > = 5
and avg (cpu_used) > = 75
)
SERVER PID START_DATE END_DATE AVG_CPU S1 1234 02:00 01/01/2015 02:04 01/01/2015 79 S1 1234 02:05 01/01/2015 02:09 01/01/2015 76.6 S2 5678 02:04 01/01/2015 02:08 01/01/2015 84 Concerning
Etbin
-
Need help to understand the oracle plsql design phase.
I am new user oracle plsql for learning. I wanted to know the following points.
(1) is there any process that we follow before developing procedures for oracle.
(2) is there any algorithm, flowchart, diagrams that we use for the Oracle procedure development.
(3) what I should learn in order to begin to develop procedures for the oracle.
organization charts
data flow diagrams
There any standard used in industry? comments or pointers would be usefuluser507531 wrote:
Meanwhile, I would also like to know if there are any designs / charts, high level design, low level of design, ER diagrams to create before you start any development of Oracle plsql.
It depends on the environment, work in and value standards. Some expect a case of use (UML) before a single line of code is written. At the time of Cobol, an organizational chart was generally expected.
With some new programming approaches, the test cases are often used to define the program (as in turn, which defines the objectives of the program).
ERDs come with database design - with the design of the PL/SQL program. You can use an ERD for a PL/SQL program, but is not part of the design of a PL/SQL program. It describes the database instead.
-
Procedure of APEX 3.1 to 3.1.2 on the Oracle XE database update
Hello
How to make an update of APEX full 3.1 to 3.1.2 on an Oracle XE database with the installation package (which you can normally get to OTN)? I mean the patches from Metalink 7313609 group will not work on a XE database because there is no built-in opatch.
Is it possible the procedure of normal update should I use for this:
@apexins password TEMP SYSAUX SYSAUX is
Thanks in advance,
TobiasTobias,
The 3.1.2 patch does not use opatch since it is not patch the Oracle binaries, etc, it's just a SQL script that you run that updates the PLSQL packages, code, etc. inside the database (more than news images, javascript, etc.).
As such, there is no reason that the patch could not be run on XE (assuming that you are allowed to download the patch etc.).
John.
--------------------------------------------
http://Jes.blogs.shellprompt.NET
http://www.apex-evangelists.com -
Open and close the connection in oracle procedure
Here is the procedure I'm in I insert data into the table temp_soap_monitoring using the select statement. I have soap_monitoring table
FONIC_RETAIL
database where I want to take the data and insert into the table temp_soap_monitoring. I play the position of planner of all 5 minutes for this procedure so that I get always the latest data in soap_monitoring@fonic_retail table. The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure. Whenever he tries to extract the data from db link and save my local database. I remember in Java, php, and other programming languages, we have method in order to open the db connection when we tried to extract data from db link and then once integration is complete, we can close the db connection. So the performance improves and also has no load on db link. In this method, we have to assign link db to retrieve the data. So I think is it possible to apply this logic in my oracle procedure. The question arises because at this moment I am hard code the link db, but now I have 3 db more links and I will not reproduce the same procedure by assigning diffferent db links.PROCEDURE "EXT_SOAP_MONITORING" AS
LAST_SM_ID Number := 0;
LAST_CAPT_DATE DATE;
BEGIN
SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';
insert into TEMP_SOAP_MONITORING(ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE)
select ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE from
SOAP_MONITORING@FONIC_RETAIL WHERE WEB_SERVICE_NAME ='RatorWebShopService' and WEB_METHOD_NAME = 'placeShopOrder' and ID > LAST_SM_ID order by ID desc;
update
CAPTURING set LAST_TASK_ID=
CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID IS NULL) THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
CAPTURING_DATE = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';
END EXT_SOAP_MONITORING;I have it here is the procedure which I insert data in
temp_soap_monitoring table by using the select statement. I have
soap_monitoring table of
FONIC_RETAIL
database where I want to take the data and insert into the table temp_soap_monitoring.WHY? Why you are moving the data? Why not just use it table, is it already?
The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure.
The solution is to FIND THE PROBLEM. Troubleshoot the code and find out where is the problem, if any.
Based SOLELY on what you have posted the solution might be to add just an appropriate index.
Whenever he tries to extract the data from db link and save my local
database. I remember in Java, php, and other programming languages, we
method to open the db connection when we tried to extract data of
DB link and then once integration is complete, we can close the db
connection. So the performance improves and also has no load on db link.
What? The LAST thing you want to do is keep the closing and opening of the connections. I don't know how 'remember you' from Java or other languages. The main reasons pools of connections were invented to AVOID have to repeatedly open and close connections.
A db link not a NOT a "charge" - the "charge" is the query is made. If you write a poor query or have a poor data without the necessary index model, or have missing statistics, then you will get poor results.
In this method, we have to assign link db to retrieve the data. So I have
is it possible to apply this logic in my oracle procedure to belive. The
question arises because at the moment, I'm hardcode db link but now I
have more ties db 3 and I will not reproduce the same procedure by
assigning diffferent db links.You can certainly write Java code to connect to each database with a direct connection. But all write code PL/SQL must include the database link. And the only way to avoid hard-coding the link is to keep the names of link in a table and use dynamic sql statements to build and run the query. This isn't what you want to do if you're looking for performance.
SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING'
;
For all we know which could be the WHOLE CAUSE of your problem. If there is no index on the table, you could do a full table to a table with lines scan 800 billion;
We have NO WAY of knowing since you haven't posted info. Please read the faq to find out how to post a request for tuning and the info you provide.
1. the query
2. the table and index DDL
3. the execution plan
4 RowCounts for tables and query predicates
5. the info on the stats: how you collected them and if they are up to date
update
CAPTURING set LAST_TASK_ID=
CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID IS NULL) THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
CAPTURING_DATE = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';My guess is that TERRIBLE method of trying to get a 'LAST ID' is what's causing ALL your problems of performance. This method will not scale, and it will NOT properly work in a multiuser environment.
You need create a good BATCH_CONTROL table that all processes use during the creation and execution of lots.
The MASTER of the process batch:
1 Gets a new BATCH_ID using a sequence
2 locks the current row in the table control and uses / change the value "last".
3 creates a new line in the control table for the new batch process
4. the line of control to date with the start time, end time, result State, County, etc. for the batch
Your likely PROBLEM of has NOTHING to do with the links of the db.
-
Mutex in the oracle stored procedure... How to get there?
Hello
I have the series of insert/update statements in an oracle stored procedure. The stored procedure is called composite Oracle SOA.
The procedure works like this:
a. download a request and checks to see if the file is already in the database. If she's here, we update, elsewhere insert.
b. that I check for 10 tables and make the necessary inserts/updations.
But sometimes, when I get the huge volume of transactions in the stored procedure, I see this violation of unique constraint violated due to lack of appropriate controls to ensure that no other parallel forum is trying to update the same record.
How to do this so that no two execution of stored procedure doesn't work on the same record in the same table?
Thank you!!
Hello
you might consider something like this
create table t1( id number primary key, action varchar2(10), who varchar2(10) ) ; declare p_id number := 1; p_action varchar2(10) := 'Insert'; p_who varchar2(9) := 'Session 1'; -- procedure update_t1(p_id number, p_action varchar2, p_who varchar2) is begin update t1 set action = p_action, who = p_who where id = p_id; end; begin -- try to insert or update row for PK p_id merge into t1 d using ( select p_id id, p_action action, p_who who from dual ) s on (d.id = s.id) when matched then update set d.action = 'Update', d.who = s.who when not matched then insert values (s.id, s.action, s.who) ; exception when dup_val_on_index then -- insert is no option, update when lock is released update_t1(p_id, 'Update', p_who); end; / drop table t1 purge ;
Scenario (two sessions trying to insert/updated updated for id 1):
session 1 inserts ("1" "insert" "Session 1") and the data is not visible to the session 2
session 2 inserts same id but crashes because of the locking session 1
validation of the session 1
session 2 insert fails but who manages updating instead
session 2 commits, values for the id 1 is now ('1' 'Update' "Session 2")
-
Execution of the stored procedure Oracle EF6 error.
Hello
Need help with the oracle error
{"ORA-06550: line 1, column 8:"}
PLS-00306: wrong number or types of arguments in the call to "sp_name".
ORA-06550: line 1, column 8:
{"PL/SQL: statement ignored '}
This error occurs when the code runs the line in Vb.net application in Model Designer
MyBase.ExecuteFunction ("sp_name" para1, para2, para3, dOBpara4, para5)
I create the SSDL and CSDL, MSL files for oracle to MS SQL connection by the method mentioned in the link JasonShort - professional profile - CodeProject it worked perfectly fine without the stored procedures. I managed to insert, update, and delete records. Then, I created stored procedures for Insert, Update, Delete. It worked fine with MS SQL. I copied and updated oracle files respectively. I gives me the error mentioned above.
I executed stored procedures in Oracle SQL Developer, and it works without error. But when it is executed via the model there is light of the error. Can anyone let me know the solution for this error. I'm using VS2010, EF6, Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Thank you
Prachin Soparkar
Hello
Sorry for the inconvenience. After I posted this question I took a break and saw that the error was nothing, but I had given FNAME as parameter name in MS SQL. In oracle when I created the sp I created the parameter with p_FNAME. Where the schema defined in the language SSDL and CSDL, MSL had to be changed to MS, but since I want to that it would be same in different databases, I choose to have changed it in oracle stored procedure. The error msg is confusing, it should be something not found parameter or incompatibility etc.
Thank you
Prachin Soparkar
-
How to have an Oracle procedure send and receive the value of a java program.
The procedure below is the place within a package. This "get_extract_ready_headers" procedure to select the columns store_number, terminal_number, tran_number, tran_date, cust_id in the REX_HEAD_EXTRACT of source table. This information is selected in a ref cursor The data were field cust_id which is encrypted. How can I change the get_extract_ready_headers procedure and accomplish 2 things?
1. make this procedure the "cust_id" reading the table source and send the value of a Java program "getheaderinfo" (this java program decrypts the cust_id field).
2. when we get the value unencrypted to the Java program, make the procedure to accept this decrypted value and use it to update the CUST_ID to the table TRAN_HEAD table value target. I use Oracle 11.2.0.2 and TOAD 10.5.1.3.
-The code of procedure
-Table Structure for the table source REX_HEAD_EXTRACTPROCEDURE get_extract_ready_headers (p_records OUT SYS_REFCURSOR) IS BEGIN OPEN p_records FOR SELECT store_number, terminal_number, tran_number, tran_date, cust_id FROM REX_HEAD_EXTRACT; END;
-Create table DDL for the target TRAN_HEAD tableCREATE TABLE REX_HEAD_EXTRACT ( REX_SEQ_NBR NUMBER(20), REVISION_NUMBER NUMBER, DAY NUMBER(3), RESA_TRAN_SEQ_NO NUMBER(20), BUSINESS_DATE DATE, TRAN_SEQ_NBR NUMBER(12), ORG_NUMBER NUMBER, STORE_NUMBER NUMBER, TRAN_DATE DATE, TERMINAL_NUMBER NUMBER, TRAN_NUMBER NUMBER, TRAN_TIME DATE, BATCH_NUMBER VARCHAR2(8 BYTE), BATCH_TYPE VARCHAR2(4 BYTE), TRAN_TYPE VARCHAR2(4 BYTE), SUB_TRAN_TYPE VARCHAR2(4 BYTE), CLERK_CODE VARCHAR2(15 BYTE), TRAN_TAXABLE_AMOUNT NUMBER(12,2), TRAN_TAX_TOTAL NUMBER(12,2), TRAN_GROSS_TOTAL NUMBER(12,2), COUP_TOTAL NUMBER(9,2), MKD_TOTAL NUMBER(9,2), EMPLOYEE_NUMBER VARCHAR2(15 BYTE), EMPLOYEE_NAME VARCHAR2(40 BYTE), TRAN_ALTTAXABLE_AMOUNT NUMBER(12,2), TRAN_ALTTAX_TOTAL NUMBER(12,2), SALE_AMOUNT NUMBER(9,2), RETURN_AMOUNT NUMBER(9,2), RETURNED_AMOUNT NUMBER(9,2), NETCASH NUMBER(12,2), TENDER_CODE VARCHAR2(4 BYTE), MULT_RCPT VARCHAR2(1 BYTE), SPLIT_TENDER VARCHAR2(1 BYTE), RTN_WITH_PURCHASE VARCHAR2(1 BYTE), RTN_WITH_RCPT VARCHAR2(1 BYTE), REASON_CODE VARCHAR2(4 BYTE), PASSWORD VARCHAR2(10 BYTE), RINGTIME DATE, CUST_NUMBER VARCHAR2(12 BYTE), CUST_ID VARCHAR2(50 BYTE), ZIP_CODE NUMBER, POSTAL_CODE VARCHAR2(9 BYTE), PV_TIME_LAPSE NUMBER, ORIG_STORE_NBR NUMBER, ORIG_TRAN_DATE DATE, ORIG_TRAN_TYPE VARCHAR2(4 BYTE), ORIG_TERM_NBR NUMBER, ORIG_TRAN_NBR NUMBER, ORIG_SALE_AMT NUMBER(12,2), ORIG_TENDER_CODE VARCHAR2(4 BYTE), ORIG_CLERK_CODE VARCHAR2(15 BYTE), PREV_TRAN_TYPE VARCHAR2(4 BYTE), PREV_SUB_TRAN_TYPE VARCHAR2(4 BYTE), GIFT_REGISTRY_ID VARCHAR2(25 BYTE), NO_OF_ITEMS NUMBER, TAX_EXEMPT_ID VARCHAR2(18 BYTE), TRAN_RINGTIME NUMBER, AUDITED VARCHAR2(1 BYTE), BATCH_VERSION NUMBER(9,2), BATCH_SOURCE VARCHAR2(5 BYTE), CREATE_DATE DATE, CREATE_ID VARCHAR2(32 BYTE), CREATE_PROC VARCHAR2(32 BYTE), MOD_DATE DATE, MOD_ID VARCHAR2(32 BYTE), MOD_PROC VARCHAR2(32 BYTE), TERMINAL_GROUP NUMBER, USER_DEF_1 NUMBER, USER_DEF_2 NUMBER, USER_DEF_3 NUMBER, USER_DEF_4 NUMBER(12,2), USER_DEF_5 NUMBER(12,2), USER_DEF_6 NUMBER(12,2), USER_DEF_7 VARCHAR2(50 BYTE), USER_DEF_8 VARCHAR2(50 BYTE), USER_DEF_9 VARCHAR2(50 BYTE), MANAGER_NUMBER VARCHAR2(15 BYTE), MANAGER_REASON_CODE VARCHAR2(10 BYTE), MANAGER_SWIPED VARCHAR2(1 BYTE), PHONE_NO NUMBER(11), KCPOS_KTH_USER_101 NUMBER, KCPOS_KTH_USER_102 NUMBER, KCPOS_KTH_USER_103 NUMBER, KCPOS_KTH_USER_104 NUMBER, KCPOS_KTH_USER_105 NUMBER, KCPOS_KTH_USER_106 NUMBER, KCPOS_KTH_USER_107 NUMBER, KCPOS_KTH_USER_108 NUMBER, KCPOS_KTH_USER_109 NUMBER, KCPOS_KTH_USER_110 NUMBER, KCPOS_KTH_USER_201 NUMBER(12,2), KCPOS_KTH_USER_202 NUMBER(12,2), KCPOS_KTH_USER_203 NUMBER(12,2), KCPOS_KTH_USER_204 NUMBER(12,2), KCPOS_KTH_USER_205 NUMBER(12,2), KCPOS_KTH_USER_206 NUMBER(12,2), KCPOS_KTH_USER_207 NUMBER(12,2), KCPOS_KTH_USER_208 NUMBER(12,2), KCPOS_KTH_USER_209 NUMBER(12,2), KCPOS_KTH_USER_210 NUMBER(12,2), KCPOS_KTH_USER_301 VARCHAR2(50 BYTE), KCPOS_KTH_USER_302 VARCHAR2(50 BYTE), KCPOS_KTH_USER_303 VARCHAR2(50 BYTE), KCPOS_KTH_USER_304 VARCHAR2(50 BYTE), KCPOS_KTH_USER_305 VARCHAR2(50 BYTE), KCPOS_KTH_USER_306 VARCHAR2(50 BYTE), KCPOS_KTH_USER_307 VARCHAR2(50 BYTE), KCPOS_KTH_USER_308 VARCHAR2(50 BYTE), KCPOS_KTH_USER_309 VARCHAR2(50 BYTE), KCPOS_KTH_USER_310 VARCHAR2(50 BYTE), KCPOS_KTH_USER_401 DATE, KCPOS_KTH_USER_402 DATE, KCPOS_KTH_USER_403 DATE, DISC_TOTAL NUMBER(9,2) ) CREATE INDEX REX_HEAD_EXTRACT_NDX ON REX_HEAD_EXTRACT (REX_SEQ_NBR, REVISION_NUMBER, STORE_NUMBER, TRAN_DATE, TERMINAL_NUMBER, TRAN_NUMBER)
-SamplesCREATE TABLE NAVISTOR.KCPOS_TRAN_HEADER_BASE ( TRAN_SEQ_NBR NUMBER(12), ORG_NUMBER NUMBER, STORE_NUMBER NUMBER, TRAN_DATE DATE, TERMINAL_NUMBER NUMBER, TRAN_NUMBER NUMBER, TRAN_TIME DATE, BATCH_NUMBER VARCHAR2(8 BYTE), BATCH_TYPE VARCHAR2(4 BYTE), TRAN_TYPE VARCHAR2(4 BYTE), SUB_TRAN_TYPE VARCHAR2(4 BYTE), CLERK_CODE VARCHAR2(15 BYTE) NOT NULL, TRAN_TAXABLE_AMOUNT NUMBER(12,2), TRAN_TAX_TOTAL NUMBER(12,2), TRAN_GROSS_TOTAL NUMBER(12,2), COUP_TOTAL NUMBER(9,2), MKD_TOTAL NUMBER(9,2), EMPLOYEE_NUMBER VARCHAR2(15 BYTE), EMPLOYEE_NAME VARCHAR2(40 BYTE), TRAN_ALTTAXABLE_AMOUNT NUMBER(12,2), TRAN_ALTTAX_TOTAL NUMBER(12,2), SALE_AMOUNT NUMBER(9,2), RETURN_AMOUNT NUMBER(9,2), RETURNED_AMOUNT NUMBER(9,2), NETCASH NUMBER(12,2), TENDER_CODE VARCHAR2(4 BYTE), MULT_RCPT VARCHAR2(1 BYTE), SPLIT_TENDER VARCHAR2(1 BYTE), RTN_WITH_PURCHASE VARCHAR2(1 BYTE), RTN_WITH_RCPT VARCHAR2(1 BYTE), REASON_CODE VARCHAR2(4 BYTE), PASSWORD VARCHAR2(10 BYTE), RINGTIME DATE, CUST_NUMBER VARCHAR2(12 BYTE), CUST_ID VARCHAR2(50 BYTE) ENCRYPT USING 'AES256' NO SALT, ZIP_CODE NUMBER, POSTAL_CODE VARCHAR2(9 BYTE), PV_TIME_LAPSE NUMBER, ORIG_STORE_NBR NUMBER, ORIG_TRAN_DATE DATE, ORIG_TRAN_TYPE VARCHAR2(4 BYTE), ORIG_TERM_NBR NUMBER, ORIG_TRAN_NBR NUMBER, ORIG_SALE_AMT NUMBER(12,2), ORIG_TENDER_CODE VARCHAR2(4 BYTE), ORIG_CLERK_CODE VARCHAR2(15 BYTE), PREV_TRAN_TYPE VARCHAR2(4 BYTE), PREV_SUB_TRAN_TYPE VARCHAR2(4 BYTE), GIFT_REGISTRY_ID VARCHAR2(25 BYTE), NO_OF_ITEMS NUMBER, TAX_EXEMPT_ID VARCHAR2(18 BYTE), TRAN_RINGTIME NUMBER, AUDITED VARCHAR2(1 BYTE), BATCH_VERSION NUMBER(9,2), BATCH_SOURCE VARCHAR2(5 BYTE), CREATE_DATE DATE, CREATE_ID VARCHAR2(32 BYTE), CREATE_PROC VARCHAR2(32 BYTE), MOD_DATE DATE, MOD_ID VARCHAR2(32 BYTE), MOD_PROC VARCHAR2(32 BYTE), TERMINAL_GROUP NUMBER, USER_DEF_1 NUMBER, USER_DEF_2 NUMBER, USER_DEF_3 NUMBER, USER_DEF_4 NUMBER(12,2), USER_DEF_5 NUMBER(12,2), USER_DEF_6 NUMBER(12,2), USER_DEF_7 VARCHAR2(50 BYTE), USER_DEF_8 VARCHAR2(50 BYTE), USER_DEF_9 VARCHAR2(50 BYTE), MANAGER_NUMBER VARCHAR2(15 BYTE), MANAGER_REASON_CODE VARCHAR2(10 BYTE), MANAGER_SWIPED VARCHAR2(1 BYTE), PHONE_NO NUMBER(11), KCPOS_KTH_USER_101 NUMBER, KCPOS_KTH_USER_102 NUMBER, KCPOS_KTH_USER_103 NUMBER, KCPOS_KTH_USER_104 NUMBER, KCPOS_KTH_USER_105 NUMBER, KCPOS_KTH_USER_106 NUMBER, KCPOS_KTH_USER_107 NUMBER, KCPOS_KTH_USER_108 NUMBER, KCPOS_KTH_USER_109 NUMBER, KCPOS_KTH_USER_110 NUMBER, KCPOS_KTH_USER_201 NUMBER(12,2), KCPOS_KTH_USER_202 NUMBER(12,2), KCPOS_KTH_USER_203 NUMBER(12,2), KCPOS_KTH_USER_204 NUMBER(12,2), KCPOS_KTH_USER_205 NUMBER(12,2), KCPOS_KTH_USER_206 NUMBER(12,2), KCPOS_KTH_USER_207 NUMBER(12,2), KCPOS_KTH_USER_208 NUMBER(12,2), KCPOS_KTH_USER_209 NUMBER(12,2), KCPOS_KTH_USER_210 NUMBER(12,2), KCPOS_KTH_USER_301 VARCHAR2(50 BYTE), KCPOS_KTH_USER_302 VARCHAR2(50 BYTE), KCPOS_KTH_USER_303 VARCHAR2(50 BYTE), KCPOS_KTH_USER_304 VARCHAR2(50 BYTE), KCPOS_KTH_USER_305 VARCHAR2(50 BYTE), KCPOS_KTH_USER_306 VARCHAR2(50 BYTE), KCPOS_KTH_USER_307 VARCHAR2(50 BYTE), KCPOS_KTH_USER_308 VARCHAR2(50 BYTE), KCPOS_KTH_USER_309 VARCHAR2(50 BYTE), KCPOS_KTH_USER_310 VARCHAR2(50 BYTE), KCPOS_KTH_USER_401 DATE, KCPOS_KTH_USER_402 DATE, KCPOS_KTH_USER_403 DATE, DISC_TOTAL NUMBER(9,2), RTA_RTN_AUTCOD VARCHAR2(4 BYTE), RTA_RTN_COMMID NUMBER, RTA_RTN_EVNTID NUMBER, RTA_RTN_QTY NUMBER, RTA_RTN_RCPT_SCAN VARCHAR2(1 BYTE), RTA_RTN_REFUND_AMT NUMBER(9,2), RTA_RTN_TYPE_CODE VARCHAR2(4 BYTE), RTA_RTN_WITH_RCPT VARCHAR2(1 BYTE), RTA_RTN_COUNT INTEGER, SDEDVAL1 VARCHAR2(50 BYTE) )
REX_SEQ_NBR,REVISION_NUMBER,DAY,RESA_TRAN_SEQ_NO,BUSINESS_DATE,TRAN_SEQ_NBR,ORG_NUMBER,STORE_NUMBER,TRAN_DATE,TERMINAL_NUMBER, TRAN_NUMBER,TRAN_TIME 478,1,11,12024005,6/11/2012,,1,692,6/11/2012,155,5,6/11/2012 12:57:17 PM, 479,1,11,12024006,6/11/2012,,1,692,6/11/2012,155,6,6/11/2012 2:01:51 PM, 480,1,11,12024007,6/11/2012,,1,692,6/11/2012,155,7,6/11/2012 2:47:10 PM
Then you describe two stored procedures separated. One that has an OUTPUT parameter which is a SYS_REFCURSOR (that you posted initially). And will need you a second procedure that takes as a parameter IN the decrypted CUST_ID and whatever: key (s) is required for the UPDATE is generated.
Justin
-
Update CPU which proved later to be bad. Replaced by original CPU. Re-installed Windows XP Home using a slipstreamed CD that I burned the original non - OEM drive that has Service Pack 2. Integrated Service Pack 3 which I got from the MS. site Everything works well except for Windows Update. The setting seem to be correct in Administrative Tools/Services. The status of the Service is "stopped". When I try to start the automatic updates from Administrative Tools/Services I receive "error 127: the specified procedure could not be found." Also "error 0 x 80240036: could not start the service automatic updates on local computer» Used the range of anti-virus and malware and found nothing. Currently using Avast 7.0.1426. I also used various tools of Fix - It MS nothing helps. Any help would be greatly appreciated. Thank you.
Hello
1. what application or antivirus security suite is installed and your current subscription?
2 Norton (another) or a McAfee application ever installed on this machine?
3. What are the fix applications that you used so far to try to fix this problem?
Try the next method and check if that helps you with the question of the 127 error you receive.
Method 1: Rdding the DLL file by doing the following:
1. Click Start and click Run, in the search box type CMD and press to enter.
2. right click on CMD in the list and click "Run as Administrator".
3. type the following command and press ENTER. Regsvr32 msvcp71.dll
4. close the command prompt window.Method 2: run the file system (CFS) Checker:
(Note: you need an XP installation disk to start the System File Checker search.)
The SFC command is used to detect and resolve problems with the files on Windows XP and Windows Vista computers. This command allows you to launch the Windows File Protection Service and allows you to analyze all integrity-protected Windows files and replace all problematic files identified.
1. click on start, and in the box to start, search type CMD
2. right click on CMD in the list and click "Run as Administrator"
3. type the following command and press ENTER. Sfc/scannow
4. close the command prompt window.For more information on scan SFC (System File Checker), please look in the link mentioned below.
http://support.Microsoft.com/kb/310747
I hope this helps.
Maybe you are looking for
-
How can I turn off Auto-fill?
Recently installed El Capitan. AutoFill took - General the changes such as my email address without my permission. What should do?
-
C:\Windows\SYSTEM32\AUTOEXEC. NT? What is c?
Greetings! I am trying to install a program/game on my VISTA, but this window appears, stating that "C:\Windows\SYSTEM32\AUTOEXEC. NT file system is missing... " How can I replace the file or else install this program/game? Currently, I believe that
-
Need driver for windows 8 64-bit PCI device
I need a driver for the PCI for windows 8 64-bit. Also I need other drivers like controller sm bus and many others. can someone give me a link to these drivers your help will be appreciated
-
ISE 1.4 - edition comments / sponsor email formatting
Hello Is anyway to change the formatting (especially police) of the email that is sent to the e-mail address of the user used when creating accounts on the portal of Sponsor? I find that with Outlook, 'I' and '1' clients alike causing some grief user
-
How to create a gradient of irregular
I know how to create square, circular and radial gradients, but sometimes I need the gradient to a more asymmetric or irregular shape of, say, a cloud, a star, a dog or a bottle. What are some good ways to do this?Thank you.