Result passage of PL/SQL code for the page element
Hello
I have created a process in after the header to fill data to the page of the form elements. The pl/sql code is like bellows. Then I got the error message:
ORA-06502: PL/SQL: digital or value error: character number conversion
My question is that I do not see the difference in format between the page element and block pl/sql variables (e.g. : P31_STUDY_ID vs v_P31_STUDY_ID), they are either numeric or text field (in fact I have hidden field, but don't see conversion back to the digital field solved the problem). And don't see needs to set the format mask. Is there another way to detect the column that causes the problem, or if there is a syntax error with my assignment (from the variable element on the page)? Thank you very much!
============================
Declare
number of v_P31_STUDY_ID;
number of v_P31_STUDY_SITE_ID;
v_P31_STUDY_SITE_NAME VARCHAR2 (255);
v_P31_STUDY_SITE_NUM varchar2 (10);
number of v_P31_STUDY_SITE_NAME_NUM_ID;
number of v_P31_STUDY_SITE_OPEN_STATUS;
v_p31_comments VARCHAR2 (255);
Start
Select
tbl_study_site.study_id,
tbl_study_site.study_site_id,
study_site_name,
study_site_num,
STUDY_SITE_NAME_NUM_ID,
STUDY_SITE_OPEN_STATUS,
Comments
in
v_P31_STUDY_ID,
v_P31_STUDY_SITE_ID,
v_P31_STUDY_SITE_NAME,
v_P31_STUDY_SITE_NUM,
v_P31_STUDY_SITE_NAME_NUM_ID,
v_P31_STUDY_SITE_OPEN_STATUS,
v_p31_comments
of tbl_study_site, tbl_study_site_attrib
where tbl_study_site.study_id =: p30_study_name
and tbl_study_site.study_site_id = tbl_study_site_attrib. STUDY_SITE_ID
and tbl_study_site_attrib. STUDY_SITE_ATTRIB_ID =: P31_STUDY_SITE_ATTRIB_ID;
: P31_STUDY_ID: = v_P31_STUDY_ID;
: P31_STUDY_SITE_ID: = v_P31_STUDY_SITE_ID;
: P31_STUDY_SITE_NAME: = v_P31_STUDY_SITE_NAME;
: P31_STUDY_SITE_NUM: = v_P31_STUDY_SITE_NUM;
: P31_STUDY_SITE_NAME_NUM_ID: = v_P31_STUDY_SITE_NAME_NUM_ID;
: P31_STUDY_SITE_OPEN_STATUS: = v_P31_STUDY_SITE_OPEN_STATUS;
: P31_COMMENTS: = v_p31_comments;
end;
=============================
Identify the root cause. He's always on the format of the column, there is an error. Thanks for your help.
Tags: Database
Similar Questions
-
pl/sql code for the problem
Hi all
Can someone please tell me how to write pl/sql code to the below question:
I have two tables has temp and temp b both have the code and the reading of time columns. I want if temp one more time temp b for a particularcode of reading then reading time of tempb must obtain updates of reading time (reading time to temp b should get updated ony if the temp one reading is largest temp b and code exist in the tables). If the code as code1 which exist in temp one but doesnot exist in temp b so that records should get inserted into table b temp.
For Ex. Temp a code1, 10:00; Code1, 11:00; B temp is code1, and code 2.10 AM:code 2.9 AM 09:00; then once the program run the tempb should have code1, 11:00; Code2, 10:00
Thanks in advance.Hello
You needn't PL/SQL for this; a MERGE statement will do.
If you want to do it in PL/SQL, always to use MERGE:BEGIN MERGE INTO tempb dst USING ( SELECT code , MAX (reading_time) AS reading_time FROM tempa GROUP BY code ) src ON (src.code = dst.code) WHEN MATCHED THEN UPDATE SET dst.reading_time = src.reading_time WHERE dst.reading_time < src.reading_time WHEN NOT MATCHED THEN INSERT (dst.code, dst.reading_time) VALUES (src.code, src.reading_time) ; END; /
-
Appeal procedure for a page element
Hi friends,
I have a page element and I need to return a value for the page element by using the procedure. For this I created a procedure
And called this procedure as the below in the section by default, by specifying the type as 'the plsql function body '.create or replace procedure xx_test_proc7(a number,b out varchar2) as begin select sum(sal) into b from scott.emp where deptno=a; end;
But this element does not receive the value of the procedure.declare x varchar2(20); begin xx_test_proc7(20,x);------>20------>hardcoded dbms_output.put_line(x); end;
What is the problem with her friends.
Brgds,
MiniHello
Your code should be based, so try
declare x varchar2(20); begin xx_test_proc7(20,x);------>20------>hardcoded RETURN x; end;
Kind regards
Jari -
Single SQL query for the analysis of the date of customs declaration under the table of Stock codes
Dear all,
Please tell us a single SQL query for the below,
We have a Table of Stock as shown below,
STOCK_TABLE
ITEM_CODE
(item code)
BAT_NO
(lot no.)
TXN_CODE
(transaction code)
DOC_NO
(number)
BOE_DT
(date of the customs declaration)
I1
B1
I1
I2
I3
B70
I4
B80
I5
B90
T102
1234
JULY 2, 2015
I6
B100
We have to find the date of customs declaration (i.e. the date when the items have come under this particular table) for items that are not attached to any document (that is, who have TXN_CODE, DOC_NO and BOE_DT fields with a NULL value).
For each item in the table of actions, which is not attached to any document, the customs declaration date is calculated as follows.
- If (code section, lot number) combination is present under HISTORY_TABLE, the date of customs declaration will receive the UPDT_DT, the transaction code (TXN_CODE) is an IN or transactions (which can be analyzed from the TRANSACTIONS table).
- If (code section, lot number) combination is NOT currently at the HISTORY_TABLE (or) the transaction code respective to item - batch number combination code is an operation then customs declaration date will be the date of the document (DOC_DT) that we receive from one of the 3 tables IN_TABLE_HEAD that contains the element of that particular lot.
- If the case 1 and case 2 fails, our customs declaration date will be the last date of document (DOC_DT) that we receive from one of the 3 tables IN_TABLE_HEAD containing that particular item and the BAT_NO in expected results will be that corresponding to this document, as appropriate, to another NULL.
- If the case 1 or case 2 is successful, the value of the last field (in the output expected, shown further below) BATCH_YN will be 'Y', because it fits the lot. Otherwise it will be 'n'.
-
What is my access code for the software updates
What is my access code for the software updates? It seems to be a six-digit numeric code, but I have no recollection of anyone establishing.
Take a look at this thread, what is the password for software update
-
I lost the code for the option menu 'limitations' of the iPhone 4, how can you do then? so I can come and factory reset, it is a 4 digit code, so I can be able toexample factory reset the phone, don't know if this is the right forum for my question but
Sorry, but the restriction password cannot be reset, it is part of the backup and restore a backup that was taken after the restrictions were activated, restore this code again.
You will have to start without the help of the data backup, configure the phone to factory settings and start over. Follow the steps mentioned in this article:
Use iTunes to restore your device to factory settings - Support Apple iOS
If you lose or forget your password restriction, you must erase your device and then put it up as a new device to remove the restriction password. Restore the device by using a backup does not delete the access code.
copied from: Sur les Restrictions (parental control) on iPhone, iPad and iPod touch - Apple Support
-
How can I get the color codes for the notebook
How can I get the color codes for the notebook?
Hello
What is the color codes for the notebook?
Perhaps you need a 3rd party utility like GetDiz - Free and others to be
found using BING or Google.GetDiz Notepad - free - replacement
http://www.Outertech.com/en/Notepad-replacementI hope this helps.
-
Can we get the source code for the camera?
Can we get the source code for the camera? Including libraries? CM is great, except that the camera is not well polished, and the quality of the stock ROM Sony are much better.
probably more likely questions and restrictions of copyright
inspect the developers space
-
How can I find the code for the corrupted by the sfc scan files?
I'm new to computers and I'm not aware about many of these things, I have a laptop Dell Inspiron 1545 with a Vista Home Premium operating system on a 64-bit platform, I did a sfc scan and it found 8 files corrupted. I have also a code will correct corrupted files, but I don't know where to find the codes for the corrupted files to put in the code for fixing corrupted files. I found the log file for the corrupted files and it's the same as the instructions I had to use the code to fix the corrupted files but there is nothing in the log file that corresponds with the file name needed to repair the corrupted files. Where can I find these files? Thanks for any help.
Hello
Not sure what you mean by you have a code to solve those? Create a sfcdetails.txt and that you post a copy
each section of a message here - they will repeat in order to do not post duplicate sections, as appropriate.------------------------------------------------------------
Many files that SFC cannot resolve are not important.
Start - type in the search box-> find CMD in top - click right on - RUN AS ADMIN
put the command from below (copy and paste) in this box and her and then press ENTER.
findstr/c: "[SR]" %windir%\logs\cbs\cbs.log > sfcdetails.txt
who creates the sfcdetails.txt file in the folder that you are in when you run it.
So if you're in C:\Windows\System32 > then you will need to look in that folder for the file.
How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
in Windows Vista
http://support.Microsoft.com/kb/928228This creates sfcdetails.txt in C:\Windows\System32 find and you can post the errors in a message
here. NOTE: there are probably duplicates so please only post once each section error.You can read the newspaper/txt files easier if you right click on Notepad or Wordpad then RUN AS ADMIN - then
You can navigate to sfcdetails.txt (in C:\Windows\System32) or cbs.log (in C:\Windows\Logs) as needed.
(You may need to search sfcdetails.txt if it is not created in the default folders.)I hope this helps.
-
I can't find the code for the printer or the menu of the printer 6500 E-mail address
I can't follow the instructions to retrieve the code for the printer, I see the symbols but don't see how to print, or to get the Email address of the printer menu
Maybe the info here will help you
http://h30434.www3.HP.com/T5/eprint-print-apps-mobile/print-your-Web-services-info-sheet/TD-p/57261
-
Examples of Code for the (Simplified) Client software
After digging through the application of the whole sample RIM provides I thought I want to provide a code for the simplified example. Short opinion: post connection suffix is not allowed on the forums. You can see the sample application of the RIM if you do not already elsewhere. Please see the article here, it's under review if you want to contribute (although the code is mainly in the attached files): http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample...
the article has been published: http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample...
-
Original title:
Windows code
I have 2 questions... 1 is - anyone know of any legit windows code, find online programs for windows on a computer code. My wifes sister and she want to fix his computer by putting in a new hard drive and installing windows, but I wanted to see if I could legitimate his computer code and the sticker is missing, damaged already.
2. is possible to get the code for the window using the id and product received in a store you microsoft some how I have two computer, I bought my children 3 years ago and to replace hard drives with larger ones, and one of them still has readable sticker. Thanks again
As I said, reported for an installation by the manufacturer OEM of Windows key code reflects the image of their system and not the license key on the sticker that is what is needed for a re-installation of consumer, is not surprising that the Samsung 2 is the same. The key to the thumbnail is not stored anywhere other than on the tile.
If you cannot or do not want to clone the disks, you can buy a recovery media set at the manufacturer or new media of Windows 7 (becomes very expensive and problematic for the commercial version that MS no longer sells it).
-
I bought my program and I have the code for the product. Where I have to write this code?
Exactly, what program... and the version?
You have a number or a redemption code?
You enter a serial number when asked during the installation process
Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
-
need of support code for the challenge code
need of support code for the challenge code
Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">===>
Don't forget to stay signed with your Adobe ID before accessing the link below
Creative cloud support (all creative cloud customer service problems)
-
Just changed my account information for payment, but payment results in a week, enough time for the new payment will be held for the new account?
HI Lucas,.
I see that you have tried to change the billing details, but they were not properly updated.
Please get in touch with the customer: -.
HISTORY_TABLE
ITEM_CODE | BAT_NO |
TXN_CODE
DOC_NO
UPDT_DT
I1
B1
T1
1234
JANUARY 3, 2015
I1
B20
T20
4567
MARCH 3, 2015
I1
B30
T30
7890
FEBRUARY 5, 2015
I2
B40
T20
1234
JANUARY 1, 2015
TRANSACTION
TXN_CODE | TXN_TYPE |
T1 | IN |
T20 |
OFF
T30
ALL THE
T50
IN
T80
IN
T90
IN
T60
ALL THE
T70
ALL THE
T40
ALL THE
IN_TABLE_HEAD_1
H1_SYS_ID (primary key) | TXN_CODE | DOC_NO |
DOC_DATE
H1ID1
T1
1234
JANUARY 1, 2015
H1ID2
T70
1234
FEBRUARY 1, 2015
IN_TABLE_ITEM_1
I1_SYS_ID |
H1_SYS_ID
(foreign key referencing H1_SYS_ID in IN_TABLE_HEAD_1)
ITEM_CODE
I1ID1
H1ID1
I1
I1ID2
H1ID1
I100
I1ID3
H1ID2
I3
IN_TABLE_BATCH_1
B1_SYS_ID | TXN_CODE DOC_NO (now in IN_TABLE_HEAD_1) | BAT_NO |
B1ID1
T1
1234
B1 / can be empty
B1ID2
T70
1234
B70
IN_TABLE_HEAD_2
H2_SYS_ID (primary key) | TXN_CODE |
DOC_NO
DOC_DATE
H2ID1
T30
4567
FEBRUARY 3, 2015
H2ID2
T60
1234
JANUARY 3, 2015
IN_TABLE_ITEM_2
I2_SYS_ID | H2_SYS_ID (foreign key referencing H2_SYS_ID in IN_TABLE_HEAD_2) | ITEM_CODE |
I2ID1 | H2ID1 |
I1
I2ID2
H2ID1
I200
I2ID3
H2ID2
I2
IN_TABLE_BATCH_2
B2_SYS_ID |
I2_SYS_ID
(foreign key referencing I2_SYS_ID in IN_TABLE_ITEM_2)
BAT_NO
B2ID1
I2ID1
B30 / null
B2ID2
I2ID2
B90
B2ID2
I2ID3
B60
IN_TABLE_HEAD_3
H3_SYS_ID (primary key) | TXN_CODE | DOC_NO | DOC_DATE |
H3ID1 |
T50
1234
JANUARY 2, 2015
H3ID2
T80
1234
JANUARY 3, 2015
H3ID3
T90
1234
JANUARY 4, 2015
H3ID4
T40
1234
AUGUST 5, 2015
IN_TABLE_ITEM_3
I3_SYS_ID |
H3_SYS_ID
(foreign key referencing H3_SYS_ID in IN_TABLE_HEAD_3)
ITEM_CODE
BAT_NO
I3ID1
H31D1
I2
B50
I3ID2
H3ID2
I4
B40
I3ID3
H3ID3
I4
I3ID4
H3ID4
I6
There is no IN_TABLE_BATCH_3
Please find below the expected results.
OUTPUT
ITEM_CODE | BAT_NO | TXN_CODE | DOC_NO |
BOE_DT
BATCH_YN
I1
B1
T1
1234
JANUARY 3, 2015
THERE
I1
B30
T30
7890
FEBRUARY 5, 2015
N
I2
B60
T60
1234
JANUARY 3, 2015
N
I3
B70
T70
1234
FEBRUARY 1, 2015
THERE
I4
T90
1234
JANUARY 4, 2015
N
I6
T40
1234
AUGUST 5, 2015
N
Controls database to create the tables above and insert the records.
CREATE TABLE stock_table()item_code VARCHAR2()80),bat_no VARCHAR2()80),txn_code VARCHAR2()80),
doc_no VARCHAR2 (80), boe_dt DATE );
INSERT EN stock_table
VALUES ('I1', 'B1', '', '', '');
INSERT EN stock_table
VALUES ('I1', '', '', '', '');
INSERT IN stock_table
VALUES ('I2', '', '', '', '');
INSERT EN stock_table
VALUES ('I3', 'B70', '', '', '');
INSERT EN stock_table
VALUES ('I4', 'B80', '', '', '');
INSERT EN stock_table
VALUES ('I5', 'B90', 'T102', '1234', '02-JUL-2015');
INSERT EN stock_table
VALUES ('I6', 'B100', '', '', '');
SELECT *
FROM stock_table
CREATE TABLE history_table()item_code VARCHAR2()80),bat_no VARCHAR2()80),txn_code VARCHAR2()80),
doc_no VARCHAR2 (80), updt_dt DATE );
INSERT IN history_table
VALUES ('I1', 'B1', 'T1', '1234', '03-JAN-2015');
INSERT IN history_table
VALUES ('I1', 'B20', 'T20', '4567', '03-MAR-2015');
INSERT IN history_table
VALUES ('I1', 'B30', 'T30', '7890', '05-FEB-2015');
INSERT IN history_table
VALUES ('I2', 'B40', 'T20', '1234', '01-JAN-2015');
SELECT *
FROM history_table
CREATE TABLE transaction1()txn_code VARCHAR()80),txn_type VARCHAR()80));
INSERT INTO transaction1
VALUES ('T1', 'IN');
INSERT INTO transaction1
VALUES ('T20', 'OUT');
INSERT INTO transaction1
VALUES ('T30', 'ALL');
INSERT INTO transaction1
VALUES ('T40', 'ALL');
INSERT INTO transaction1
VALUES ('T50', 'IN');
INSERT INTO transaction1
VALUES ('T60', 'ALL');
INSERT INTO transaction1
VALUES ('T70', 'ALL');
INSERT INTO transaction1
VALUES ('T80', 'IN');
INSERT INTO transaction1
VALUES ('T90', 'IN');
SELECT *
FROM transaction1
CREATE TABLE in_table_head_1()h1_sys_id VARCHAR2()80) PRIMARY KEY,txn_code VARCHAR2()80),
doc_no VARCHAR2 (80), doc_dt DATE );
CREATE TABLE in_table_head_2()h2_sys_id VARCHAR2()80) PRIMARY KEY,txn_code VARCHAR2()80),
doc_no VARCHAR2 (80), doc_dt DATE );
CREATE TABLE in_table_head_3()h3_sys_id VARCHAR2()80) PRIMARY KEY,txn_code VARCHAR2()80),
doc_no VARCHAR2 (80), doc_dt DATE );
INSERT IN in_table_head_1
VALUES ('H1ID1', 'T1', '1234', '01-JAN-2015');
INSERT IN in_table_head_1
VALUES ('H1ID2', 'T70', '1234', '01-FEB-2015');
INSERT IN in_table_head_2
VALUES ('H2ID1', 'T30', '4567', '03-FEB-2015');
INSERT IN in_table_head_2
VALUES ('H2ID2', 'T60', '1234', '03-JAN-2015');
INSERT IN in_table_head_3
VALUES ('H3ID1', 'T50', '1234', '02-JAN-2015');
INSERT IN in_table_head_3
VALUES ('H3ID2', 'T80', '1234', '03-JAN-2015');
INSERT IN in_table_head_3
VALUES ('H3ID3', 'T90', '1234', '05-JAN-2015');
INSERT IN in_table_head_3
VALUES ('H3ID4', 'T40', '1234', '05-AUG-2015');
CREATE TABLE in_table_item_1()i1_sys_id VARCHAR2()80) PRIMARY KEY,
h1_sys_id VARCHAR2 (80) REFERENCES in_table_head_1()h1_sys_id),item_code VARCHAR2()80));
CREATE TABLE in_table_item_2()i2_sys_id VARCHAR2()80) PRIMARY KEY,
h2_sys_id VARCHAR2 (80) REFERENCES in_table_head_2()h2_sys_id),item_code VARCHAR2()80));
CREATE TABLE in_table_item_3(i3_sys_id VARCHAR2(80) PRIMARY KEY,
h3_sys_id VARCHAR2 (80) REFERENCES in_table_head_3()h3_sys_id),item_code VARCHAR2()80),
bat_no VARCHAR2 (80));
INSERT IN in_table_item_1
VALUES ('I1ID1', 'H1ID1', 'I1');
INSERT IN in_table_item_1
VALUES ('I1ID2', 'H1ID1', 'I100');
INSERT IN in_table_item_1
VALUES ('I1ID3', 'H1ID2', 'I3');
INSERT IN in_table_item_2
VALUES ('I2ID1', 'H2ID1', 'I1');
INSERT IN in_table_item_2
VALUES ('I2ID2', 'H2ID1', 'I200');
INSERT IN in_table_item_2
VALUES ('I2ID3', 'H2ID2', 'I2');
INSERT IN in_table_item_3
VALUES ('I3ID1', 'H3ID1', 'I2','B50');
INSERT IN in_table_item_3
VALUES ('I3ID2', 'H3ID2', 'I4','B40');
INSERT IN in_table_item_3
VALUES ('I3ID3', 'H3ID3', 'I4','');
INSERT IN in_table_item_3
VALUES ('I3ID4', 'H3ID4', 'I6','');
SELECT *
FROM in_table_item_1
SELECT *
FROM in_table_item_2
SELECT *
FROM in_table_item_3
CREATE TABLE in_table_batch_1()b1_sys_id VARCHAR2()80) PRIMARY KEY,
txn_code VARCHAR2 (80), doc_no VARCHAR2 (80), bat_no VARCHAR2 (80));
CREATE TABLE in_table_batch_2()b2_sys_id VARCHAR2()80) PRIMARY KEY,
i2_sys_id VARCHAR2 (80) REFERENCES in_table_item_2()i2_sys_id),bat_no VARCHAR2()80));
INSERT IN in_table_batch_1
VALUES ('B1ID1', 'T1', '1234', 'B1');
INSERT IN in_table_batch_1
VALUES ('B1ID2', 'T70', '1234', 'B70');
INSERT IN in_table_batch_2
VALUES ('B2ID1', 'I2ID1', 'B30');
INSERT IN in_table_batch_2
VALUES ('B2ID2', 'I2ID2', 'B90');
INSERT IN in_table_batch_2
VALUES ('B2ID3', 'I2ID3', 'B60');
Please advise a solution for the same.
Thank you and best regards,
Séverine Suresh
very forced (question subfactoring used to allow easy testing/verification - could work with these test data only)
with
case_1 as
(select s.item_code,
s.bat_no,
h.txn_code,
h.doc_no,
h.updt_dt boe_dt,
cases where s.bat_no = h.bat_no then 'Y' else ' n end batch_yn.
cases where h.txn_code is not null
and h.doc_no is not null
and h.updt_dt is not null
then 'case 1' '.
end refers_to
from (select item_code, bat_no, txn_code, doc_no, boe_dt
of w_stock_table
where bat_no is null
or txn_code is null
or doc_no is null
or boe_dt is null
) s
left outer join
w_history_table h
On s.item_code = h.item_code
and s.bat_no = h.bat_no
and exists (select null
of w_transaction1
where txn_code = nvl (s.txn_code, h.txn_code)
and txn_type in ('IN', 'ALL')
)
),
case_2 as
(select s.item_code,
NVL (s.bat_no, h.bat_no) bat_no.
NVL (s.txn_code, h.txn_code) txn_code.
NVL (s.doc_no, h.doc_no) doc_no.
NVL (s.boe_dt, h.updt_dt) updt_dt.
cases where s.bat_no = h.bat_no then 'Y' else ' n end batch_yn.
cases where h.txn_code is not null
and h.doc_no is not null
and h.updt_dt is not null
then 'case 2'.
end refers_to
from (select item_code, bat_no, txn_code, doc_no, boe_dt
of case_1
where refers_to is null
) s
left outer join
w_history_table h
On s.item_code = h.item_code
and exists (select null
of w_transaction1
where txn_code = nvl (s.txn_code, h.txn_code)
and txn_type in ('IN', 'ALL')
)
and not exists (select null
of case_1
where item_code = h.item_code
and bat_no = h.bat_no
and txn_code = h.txn_code
and doc_no = h.doc_no
and updt_dt = h.updt_dt
)
),
case_31 as
(select s1.item_code,
NVL (S1.bat_no, W1.bat_no) bat_no.
NVL (S1.txn_code, W1.txn_code) txn_code.
NVL (S1.doc_no, W1.doc_no) doc_no.
NVL (S1.updt_dt, W1.doc_dt) updt_dt.
cases where s1.bat_no = w1.bat_no then 'Y' else ' n end batch_yn.
cases where w1.txn_code is not null
and w1.doc_no is not null
and w1.doc_dt is not null
then "case 31'.
end refers_to
from (select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn, refers_to
of case_2
where refers_to is null
) s1
left outer join
(select i1.item_code, h1.txn_code, h1.doc_no, h1.doc_dt, b1.bat_no
of w_in_table_item_1 i1
inner join
w_in_table_head_1 h1
On i1.h1_sys_id = h1.h1_sys_id
inner join
w_in_table_batch_1 b1
On h1.txn_code = b1.txn_code
and h1.doc_no = b1.doc_no
) w1
On s1.item_code = w1.item_code
),
case_32 as
(select s2.item_code,
NVL (S2.bat_no, W2.bat_no) bat_no.
NVL (S2.txn_code, W2.txn_code) txn_code.
NVL (S2.doc_no, W2.doc_no) doc_no.
NVL (S2.updt_dt, W2.doc_dt) updt_dt.
cases where s2.bat_no = w2.bat_no then 'Y' else ' n end batch_yn.
cases where w2.txn_code is not null
and w2.doc_no is not null
and w2.doc_dt is not null
then "case 32'.
end refers_to
from (select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn, refers_to
of case_2
where refers_to is null
) s2
left outer join
(select i2.item_code, h2.txn_code, h2.doc_no, h2.doc_dt, b2.bat_no
of w_in_table_item_2 i2
inner join
w_in_table_head_2 h2
On i2.h2_sys_id = h2.h2_sys_id
inner join
w_in_table_batch_2 b2
On i2.i2_sys_id = b2.i2_sys_id
) w2
On s2.item_code = w2.item_code
),
case_33 as
(select s3.item_code,
w3.bat_no,
NVL (S3.txn_code, w3.txn_code) txn_code.
NVL (S3.doc_no, w3.doc_no) doc_no.
NVL (S3.updt_dt, w3.doc_dt) updt_dt.
cases where s3.bat_no = w3.bat_no then 'Y' else ' n end batch_yn.
cases where w3.txn_code is not null
and w3.doc_no is not null
and w3.doc_dt is not null
then "case 33'.
end refers_to
from (select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn, refers_to
of case_2
where refers_to is null
) s3
left outer join
(select i3.item_code, h3.txn_code, h3.doc_no, h3.doc_dt, i3.bat_no
of w_in_table_item_3 i3
inner join
w_in_table_head_3 h3
On i3.h3_sys_id = h3.h3_sys_id
) w3
On s3.item_code = w3.item_code
)
Select item_code, bat_no, txn_code, doc_no, boe_dt, batch_yn
of case_1
where refers_to is not null
Union of all the
Select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn
of case_2
where refers_to is not null
Union of all the
Select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn
from (select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn,
ROW_NUMBER() over (partition by item_code of updt_dt desc order) rn
from (select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn
of case_31
where refers_to is not null
Union of all the
Select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn
of case_32
where refers_to is not null
Union of all the
Select item_code, bat_no, txn_code, doc_no, updt_dt, batch_yn
of case_33
where refers_to is not null
)
)
where rn = 1
ITEM_CODE | BAT_NO | TXN_CODE | DOC_NO | BOE_DT | BATCH_YN |
---|---|---|---|---|---|
I1 | B1 | T1 | 1234 | JANUARY 3, 2015 | THERE |
I1 | B30 | T30 | 7890 | FEBRUARY 5, 2015 | N |
I2 | B60 | T60 | 1234 | JANUARY 3, 2015 | N |
I3 | B70 | T70 | 1234 | FEBRUARY 1, 2015 | THERE |
I4 | - | T90 | 1234 | JANUARY 5, 2015 | N |
I6 | - | T40 | 1234 | AUGUST 5, 2015 | N |
Concerning
Etbin
Maybe you are looking for
-
How to set up and use two video cards at the same time.
I have HP Pavilion a6150d desktop under Windows XP SP3 PC. My goal is to be able to use the integrated video card and GeForce 220 video card I just buy at the same time. The integrated video card and GeForce video card (connected to the PCI-E) are in
-
I can not connect to or finding wireless networks
I really appreciate any help you can give me for this problem. While I tried to include all the relevant details, please let me know if you need more. I have these specifications or running programs Sony Vaio VGN-FE865E MS Windows Vista Home Premium
-
Please HELP me with a short answer!
I ordered z2 and after seeing the large number of people are facing problems and no serious response from Sony, can I cancel my order? I love sony and its whole, but for that price, I could change to another brand... Please, I beg you! If you have a
-
Windows 8 OEM may be activated after re - install
I bought an OEM licensed for laptop HP ENVY TouchSmart J003tx with WIndows 8 a year back. Recently the OS has had some problems and I had to reinstall using the option refresh to Windows 8 providd. However, when the operating system had been updated,
-
Why is my CS6 confused with CC my subscription?
I'm so sick of oddities of recording Adobe, bugs and errors (experienced over the years) that I could vomit.Adobe has confused the CS6 Design Premium I have PURCHASED a few years back with the subscription of the CC that I RENT, $50 per month, when i