How to have an Oracle procedure send and receive value from a java program.
The below procedure is place inside a package. This procedure "get_extract_ready_headers " is selecting columns store_number, terminal_number, tran_number, tran_date, cust_id from the source REX_HEAD_EXTRACT table. This information is selected into a ref cursor. The data has cust_id field which is encrypted. How do I modify the procedure get_extract_ready_headers and accomplish 2 things?
1. Make this procedure to read the "cust_id" value from the source table and send the value to a Java program "getheaderinfo" (this java program decrypts the cust_id field).
2. When we get the unencrypted value back from the Java program, make the procedure accept this decrypted value and use it to update CUST_ID value in the target table TRAN_HEAD table. I am using Oracle 11.2.0.2, and TOAD 10.5.1.3.
-- Procedural code
PROCEDURE 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;--Table Structure for source table REX_HEAD_EXTRACT
CREATE 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)-- Create table DDL for target table TRAN_HEAD
CREATE 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)
)--sample data
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
Assuming that SomeJavePgm is a Java stored function (not a Java program running outside the database) and that it takes as a parameter whatever data type CUST_ID is in TABLE_A (hopefully RAW but potentially VARCHAR2) and returns a string, you would call it just as you would a PL/SQL stored function
INSERT INTO table_b( cust_id, <<other columns>> )
SELECT SomeJavaPgm( a.cust_id ), <<other columns>>
FROM table_a aIf SomeJavePgm is not a Java stored procedure, calling it from PL/SQL becomes much more complicated. You would need whatever machine hosts this program to expose an appropriate API (for example, a web service interface) that you could invoke via UTL_HTTP). You'd need to tell us what that API was, however.
Justin
Similar Messages
-
Sending and receiving faxes from HP3150
I have an HP3150 connected to my home WiFi network. How can I use it to send and receive faxes?
Thank you,
PeteHello @abinrml4,
Welcome to the HP Forums!
I understand you would like to know how to send and receive faxes. I will do my best to assist you! What type of printer do you have? Click here to find out: Model Number.
What type of added features do you have on your fax phone line? Please list this information on this post. I will be looking forward to hearing from you. Have a great day!
I worked on behalf of HP. -
Is it free to send and receive texts from another EE customer who is abroad?
is it free to send and receive texts from another EE customer who is abroad?
Hi
Welcome to the EE Community! Provided you're texting an 07 number, it won't cost you anything extra to text someone abraod (provided that's included in your package). It will cost the person abroad to reply (but not receive texts), unless again they have some sort of add on in the country they're present in. Cheers,
Titanium
Was my post helpful? Please take 2 seconds to hit the 'Kudos' button below -
Can ipod touch 4th generation send and receive messages from a phone number?
I have an iphone number connected to imessage but my iphone broke. On my mac messages app it allows me to be reached at (my phone number). Is it possible on the ipod touch 4th generation to send and receive messages from my phone number as opposed to an email address?
Only if you have an iPhone using with iOS 6 or greater using the same APple ID for Settings>Messages>Send and Recevice.
iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage -
CCan we send and receive messages from iMessages if yes why I am unable to do it plz.send me solutions THANKS.
Try reading through these troubleshooting guides for some help:
If you get an error when trying to activate iMessage or ...
If you can't send or receive messages on your iPhone, iPad ... -
Since the new year I have been unable to send or receive texts from someone I text daily...he does not have an iPhone
Mail: Troubleshooting sending & receiving email messages
-
How to build an E-mail sending and receiving application in Windows Azure?
I am a beginner Windows Azure Developer and I am trying to build applications like Gmail, Hotmail, YahooMail, etc. However, I am unable to build such an application. I have come to know how to send e-mail using SendGrid. Even, I don't know how to configure
to receive e-mails. Please help me on how to develop such an application in windows azure.
Regardshi Yash,
Thanks for posting!
About how to send mail using sendgrid, I suggest you could try this tutorials firstly via smarx's blog(http://blog.smarx.com/posts/emailtheinternet-com-sending-and-receiving-email-in-windows-azure).
It supplied the method and code sample you could download . You may need create a listener to listen on the right port on workrole always.
Please try it.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Send and receive email from midlet app
I know it has been asked many time in this forum, just want to make it clearer for me. Is it possible to do these from midlet without using servlet? And why many people tend to use servlet than just make it directly from the midlet?
And if I'm trying to encrypt the text being sent, should i encrypt it in the midlet or in the servlet? Thanks.Is it possible to do these from midlet without using servlet?Yes. You will have to either implement the mail protocol yourself or use some third party implementation for sending and receiving mails.
And why many people tend to use servlet than just make it directly from the midlet?I guess this is because JavaMail apis are readily available which makes the task simpler. -
My iPhone only sends and receives messages from email
I am switching my iPhone 3GS formerly on AT&T to Straight Talk. I set up my phone, but the iMessage is acting up. I sign in to my Apple ID, and it has my number (grayed out) and my email as options to send and receive messages. When I go into settings > messages > send and receive, it only shows the email. This is very frustrating and I just want to figure it out. Any ideas?
It's because the phone number hasn't activated yet. This could be because the APN settings for Straight talk are not correct. It also can take up to 24 hours for the number to activate through the iMessage servers.
-
Cannot send and received imessages through phone numer. Will not allow me to tick number
Turn off iMessage and turn it back on.
-
Send and receive mail from different accounts.
I'm new to everything and I just posted this in the iPod forum, but I'm now thinking it belongs here.
How do I receive mail from my Gmail account and send from another account?
I have the incoming server as an IMAP and it works fine. The outgoing mail server is the problem. It's set up as a different username and everything, and it STILL sends it through my GMail account. I deleted the outgoing smtp gmail server with no success. What should I do?
Thanks!Ernie,
You beat me to the punch... I was just about to reply with a follow-up asking if there was a way to do just that. Looks like I may need to use the separate accounts option in order to allow my to have Full Name information that is more helpful. For now, it won't be a problem because I only need 2 different addresses. If that changes in the future, however, I can see how it would be a problem.
It would be simple if I could add a comma-separated list of Full Names in the Full Name field (in the same order as the list of addresses) and have them match up.
Hmmm... might have to try that, just to see if it would work!
Thanks again. -
Can I use iCloud for sending and receiving emails from my own domain name?
Hello,
Hope that someone can help me please.
I have my own unique registered domain name.
Currently I am using the gmail server to transmit and receive email - I am using Mail on a MacBook, and an iPhone. Works just fine.
However, I was wondering if the iCloud can be set up to also provide this same function?
If so how do we achieve this?
Appreciate your comments and advice.Please ignore this question. Or tell me how to delete it.
-
Sending and receiving parameters from a http
Hi,
I need to send a string to a website and get the contents from it back as a string how do i do that from a java code
Thanks buddiesURL and UrlConnection. I just answered the same question half an hour ago. <_<
-
Sending and receiving values using web services vi
hi trying to receive values values using the webservices vi 's, but im facing same conversion errors. im sending my project and an image of the problem can anyone help me on this?
Attachments:
TZID.zip 21 KB
labviewscrn.JPG 126 KBHi,
Here is a global tutorial about Web Services :
http://zone.ni.com/devzone/cda/tut/p/id/7350
There are exemples at the end of the document : webservicesdemo.zip
Please check the instruction for using web services given in the Readme.doc, it could be the source of your problem.
Also, mind that you need the same language for you labVIEW version than the one used to create the Web service VIs.
Regards,
Rémi M.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> Les présentations NIDays 2010 déjà disponibles au téléchargement ! -
Open a web page and pass values from a java file
Hi,
I need to open a web page and pass values in the text boxes.
Finally submit needs to be triggered. All this needs to be done from a java file. i.e instead of entering my values in a web page and submit, i need to do it from my java file..
Any inputs so that I proceed in the right direction..or is there any alternate way to achive this ??
Thanks in advance..
SidI hava found a lines of jaa that can open a URL , lets say www.net.java
You can open it writable or not.
It is half of the job you need.
If you are interested.
I am wrinting a program to print a URL , and have developed this small
code.
Angel Portal
Maybe you are looking for
-
I know some people have tried deleting the cthelper.exe from the task manager but that did not fix problems with my x-fi in distributing sound to all 5. channels. I was only receiving sound from the front left and front right ones... In order to fix
-
I've been having two issues with my Late 2008 MacBook Pro 15-inch - Running OS X 10.8.5 (Mountain Lion). Unable to Reset the PRAM and Run Apple Hardware Test (AHT). On a random basis - File/Folder icons are Sticking to the Mouse Pointer - Not Releas
-
which one do you prefer? and why?
-
How to put values from selection screen to ztable
hi all, i have created a ztable. now i want to put data through se38. i have given 5 parameters in selection screen same as there in ztable. now if i put values in selection screen then it should put that values to my ztable . how can i put values in
-
When I close the report using close() method in ReportClientDocumet class I still see the document is opened in RAS server. I view this information on Report Application server metrics . How do I close the report so it removes the job reference from