Query for the partitions of the interval, system and reference
Hi, I want to ask some of range partitions, system and reference information.
In the partition of the interval, the script looks like this
CREATE TABLE interval_sales
(prod_id NUMBER (6))
cust_id NUMBER
time_id DATE
)
PARTITION OF RANGE (time_id)
INTERVAL (NUMTOYMINTERVAL (1, 'MONTH'))
(PARTITION p0 VALUES LESS THAN (TO_DATE (' 01/01/2005 ',' DD-MM-YYYY "")));
I would like to write a query to find the expression of the interval "MONTHS" but could not find what he makes.
In the reference partition, the script looks like this
CREATE TABLE child_tab)
ID NUMBER NOT NULL,
parent_tab_id NUMBER NOT NULL,
code VARCHAR2 (10),
Description VARCHAR2 (50).
CREATED_DATE DATE,
CONSTRAINT child_tab_pk PRIMARY KEY (id),
CONSTRAINT child_parent_tab_fk FOREIGN KEY (parent_tab_id)
REFERENCES parent_tab (id)
)
PARTITION BY REFERENCE (child_parent_tab_fk);
I want to write a query to find the foreign key name 'child_parent_tab_fk' after the PARTITION BY REFERENCE to the last line, but have no luck so far.
In the end, I want to achieve this goal:
If (interval_partitioning_type)
Assign the interval expression to a string variable
Another yew (reference_partitioning_type)
Set the foreign key to a variable of type of foreign key
Is there a way to get the type of partitioning? (interval and reference here)
Please advise,
Jack
You can query ALL_PART_TABLES
REF_PTN_CONSTRAINT_NAME
|
VARCHAR2(30)
|
Name of the referential partitioning constraint for partitioned tables reference |
|
INTERVAL
|
VARCHAR2(1000)
|
The value of the interval chain |
Tags: Database
Similar Questions
-
A query for the IP address and assign value to variable
I'm working on information from our host and put in a spreadsheet.
I can get the value of this way:
$network = $esxi | Get-VMHostNetworkAdapter-name vmk0
$WorkSheet
. cells.item(16777216) (11,$i( )
= $network.ip
But is there a way to get the IP assigned in one order without having to be defined first in a variable and then referencing .ip?
You can combine your code with a single command, as follows:
$WorkSheet.cells.item(11,$i) = ($esxi | Get-VMHostNetworkAdapter -name vmk0).ip
-
An error occurred when querying for the pending operations
Original title: sysprep problem
I have an acer aspire 5738Z, I use windows 7 (64 bit) I try to open sysprep.exe and it does not open, a text box appears saying "an error occurred when querying for the pending operations. What can I do to fix this?Hello
Thanks for posting the request in the Microsoft community forums.
I understand that you receive the error "an error has occurred when querying for outstanding operations" when trying to open sysprep.exe on the computer.You can try the solutions provide and check if it helps solve the issue.
Method 1:
You can scan System File Checker to fix corrupted files.
How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
http://support.Microsoft.com/kb/929833Method 2:
If the steps above fail then you can try the steps and check.a. run regedit by typing regedit in start search by pressing ENTER.
b navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Key: RegistrySizeLimit
Type: REG_DWORD
Value: 0xffffff (4294967295)
c. reset.If you need help with Windows, keep us informed. We will be happy to help you.
-
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'.
-
Hi-
I just installed Windows 7 Professional on my HP Elitebook 2570p, and Device Manager, I'm missing the drivers for the device Base and BMC20702A0 system.
I went to download HP driver and downloaded page 3 recommended for chipset drivers, but that has not helped.
Here is the list of the categories of driver for my HP model from the HP Web site. Where should I go next door to download the drivers?
Thank you!
Hello:
You need these drivers for these two devices:
The media JMicron card reader driver allows the card slot multimedia integrated in the laptop models running a supported operating system.
File name: sp63637.exe
This package contains the Broadcom Bluetooth driver and software for models supported that are running a supported operating system. Broadcom Bluetooth 4.0 driver is required to enable the Broadcom Bluetooth 4.0 devices and is compatible with Broadcom Bluetooth 3.0 and earlier versions.
File name: sp66402.exe
-
I plan to upgrade my OS to El Capitan. What are the processor speed and memory required for the operating system works well?
I use a processor 2.3 GHz Intel Core i5 with DDR3 4 GB 1333 MHz memory.
My last similar attempt on another machine resulted in a very slow computer.
Thanks, Ron
Apple says the following:
General requirements
- OS X 10.6.8 or later version
- 2 GB memory
- 8.8 GB of available storage
For best performance, I would say not less 4 GB and preferably 8 GB or more.
Your i5 is well able to support properly.
http://www.Apple.com/OSX/how-to-upgrade/#Hardware Configuration
-
Sign for the base system device
Hello
I simply re - install windows 8 for my lenovo Y580. and now, I got three sign for the base system device in Device Manager
PCI\VEN_197B & DEV_2394 & SUBSYS_397617AA & REV_30
PCI\VEN_197B & DEV_2392 & SUBSYS_397617AA
PCI\VEN_197B & DEV_2392 & CC_088000
PCI\VEN_197B & DEV_2392 & CC_0880
I do not know how to solve these
I really appreciate any help
Hi E2738729,
Welcome to Lenovo Community!
Check the installation of the driver chipset and Intel management driver from the link below.
Driver Chipset Intel for Microsoft Windows (32-bit, 64-bit) 8
Intel Management Engine Interface for Microsoft Windows (32-bit, 64-bit) 8
I hope this helps.
Best regards
Agnes Kumar
-
When you try to transfer a file of 8 GB on external hard drive 'file too large for the destination system message' to get there is that much space on disk
Hello
Discs formatted with the FAT be limited to files with a maximum of 4 GB. You can format outside
drive drive with NTFS, contact the manufacturer if necessary pilot or split the file into parts under
at 4 GB.Overview of FAT, HPFS, and NTFS file systems
http://support.Microsoft.com/kb/100108How to go beyond the limit of 4 GB on FAT32
http://lazybit.com/index.php/2007/03/01/how_to_get_over_the_4gb_limit_fat32-------------------------------------------------------------------------------------------------------------------------
The ZIP file and then divided the ZIP which helps maintain the integrity of sharing files and restoring.
Zip and Split - free
http://zipandsplit.toolazy.me.UK/Split and Zip - free
http://www.jtoolgame.com/tools/splitzip.htmlAkhir Split Zip - free
http://www.mydigitallife.info/2009/04/24/Akhir-split-zip-splits-files-into-smaller-zip-files/I hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
original text: P17.sys
I have no sound on my pc am under XP service pack 3 have tried to use the Windows XP disk to install the driver for the Audio system built-in Audio of P17.sys without success. I bought Rocketfish to a sound and turns off sound internal on the bios and still get the same error and the show. Help, please...
Hello
- What is the exact error message you get?
- Are you not sound on the computer or Rocketfish?
If you do not get the sound on the computer, then all first activate the sound Board in the BIOS and check. Also, follow the steps in this link and check if that helps:
http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-WindowsOtherwise, I suggest you to give us more information about the issue, so that we can help you better.
It will be useful.
-
T610 with Windows Embedded 7 - the system does not license for the operating system image
Hello community,
I bought a refurbished computer ThinClient T610 that is running a Windows 7 Embedded English. The label on the package says, that the computer ThinClient is allowed with W7E. When I now run Easy Tools installed on the computer ThinClient hp to create a USB Image with the German language, everything works fine: the image is downloaded from the web and put on the stick.
But after you start the stick, the installation program tells me: "the system does not license for the operating system image. What I am doing wrong? The BIOS is already the latest.
Or y at - it another way to transform the operating system in German? There should be an option to download additional languages, but this particual window has no other options. And I have not found any manual way to download other languages.
Concerning
Michael
Sometimes it can be so easy... ;-)
So here's my solution:
1. go on the Web for hp Support site
2. go in the software and driver download
3. set the language of driver on the language of your choice (in fact: it was the main problem)
4. download an operating system image
5. run the configuration tool and copy the image of an operating system on a flash drive
6. restart the workstation and install the os
7. take advantage of your computer ThinClient in the language of your choice
I don't know, why the hp Easy Tools downloaded the image of evil, but with this solution, that I find myself at the same point, as if they did.
-
I just installed Windows 7 on a Dell Vostro 1500 laptop.
In the pane control, devices of l, I have two errors "device Base system has not a pilot.
There is no driver installed for the Base system device. Not fixed
Apply the solution to the complete driver problem
Install a driver for this device does not workTroubleshooting gives me two messages:
The first is: there is no driver installed for the Base system device.
The device information
Name: Base system device
ID: PCI VEN_1180 & DEV_0592 & SUBSYS_02281028 & REV_12\4 & 1F967EE5 & 0 & 0BF0
Error code: 28
The second is: there is no driver installed for the Base system device.
The device information
Name: Base system device
ID: PCI VEN_1180 & DEV_0843 & SUBSYS_02281028 & REV_12\4 & 1F967EE5 & 0 & 0AF0
Error code: 28
I cannot locate a driver through web search - how do I know what are the devices? and where can I find a driver?Try to update the drivers using Windows Update. If this does not work, try the versions of Vista of Intel and Ricoh under Chipset drivers on the website of downloads & drivers for Vostro Notebook 1500 . Make a restore point first.
-
Is there anyway that I can use the MP3 files for the computer system sounds in windows 7
Is there anyway that I can use the MP3 files for the computer system sounds in windows 7. Any help would be appreciated, thanks - Joe
I don't think so. If you convert the .wav files, you could. Google for an MP3 to WAV converter. -
A design of query for the conversion of time difference in days, hours, Minutes
Hi all
A design of query for the conversion of time difference of time in number of days remaining remaining hours minutes and rest in seconds. Made this one till now. Please suggest for all modifications, until now, it seems to work very well, kindly highlight for any anomaly.
WITH DATA (startDAte, EndDate, Datediff) AS (SELECT to_date ('2015-10-01 10:00:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-20-01 03:00:49 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-10-01 10:00','yyyy-dd-mm hh24:mi:ss')-to_date('2015-20-01 03:00','yyyy-dd-mm hh24:mi:ss') FROM dual)
UNION ALL SELECT to_date ('2015-10-01 10:00:39 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-20-01 03:00:40 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-10-01 10:00','yyyy-dd-mm hh24:mi:ss')-to_date('2015-20-01 03:00','yyyy-dd-mm hh24:mi:ss') FROM dual
UNION ALL SELECT to_date ('2015-11-01 10:30:45 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 11:00:50 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 10:30','yyyy-dd-mm hh24:mi:ss')-to_date ('2015-11-01 11:00 ',' yyyy-mm-dd hh24:mi:ss') FROM dual
UNION ALL SELECT to_date ('2015-11-01 09:00:50 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 10:00:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 09:00','yyyy-dd-mm hh24:mi:ss')-to_date ('2015-11-01 10:00 ',' yyyy-mm-dd hh24:mi:ss') FROM dual
UNION ALL SELECT to_date ('2015-11-01 08:30:49 ',' yyyy-mm-dd hh24:mi:ss'), to_date ('2015-11-01 09:30:59 ',' yyyy-mm-dd hh24:mi:ss'), to_date('2015-11-01 08:30','yyyy-dd-mm hh24:mi:ss')-to_date('2015-11-01 09:30','yyyy-dd-mm hh24:mi:ss') FROM dual
)
Select
trunc ((EndDate-StartDate)) days.
trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24) hours)
trunc (to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60) Minutes,))
(to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60 - trunc (to_number (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24-trunc (((enddate-startdate)-to_number (trunc ((enddate-startdate))) * 24)) * 60)) * 60 seconds))))
data;
Thanks for the answers in advance.
AHA!
TO_TIMESTAMP expects a string as input, so it first makes an implicit conversion from DATE to a string, in the format of NSL_DATE_FORMAT.
To convert the TIMESTAMP DATE independently NLS_DATE_FORMAT, use
CAST (
AS TIMESTAMP) -
I just bought the 14 items and I don't see the download button. only for the operating system of the ILO. Help, please.
Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache. If he continues to not try to use a different browser.
Download and Installation Help-
https://helpx.Adobe.com/download-install.html
PES 10, 11, 12, 13, 14 - https://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-downloads.html
PE 10, 11, 12, 13, 14 - https://helpx.adobe.com/premiere-elements/kb/premiere-elements-downloads.html
You can also download the demo version of the software through the page linked below and then use your current serial number to activate it.
Don't forget to follow the steps described in the Note: very important Instructions in the section on the pages of this site download and have cookies turned on in your browser, otherwise the download will not work correctly.
Photoshop/Premiere Elements 14: http://prodesigntools.com/photoshop-elements-14-direct-download-links-premiere.html
-
I reinstall the operating system and I have to delete all programs, including photoshop and lightroom. I put it again and offered to buy them, even if I already pay for them
In addition to the steps mentioned above, you can also try:
First of all, disconnect, then back into creative cloud, using adobe id to pay for your subscription.
https://helpx.Adobe.com/creative-cloud/help/sign-in-out-activate-apps.html
Then, if you launch any product of CC 2015 and the pop up still shows a trial message window, please check this link for the resolution:
https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html
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
-
Tecra 8000: questions about memory, mouse and screen
Hi, im using a tecra 8200, mouse keeps drifting upward left after 30 minutes? keyboard problem?Sometimes the screen displays changr, from very dark then normal?Finally I was told that I can put in a module of 512 mem alongside 256 existing will this
-
HP x 2 210: pen Active for HP x 2 210
Hello I would like to know if the HP x 2 210 is compatible with an active stylus. If it is, that is?
-
HP laptop: unable to identify the lan cable connection
Microsoft Windows [Version 6.3.9600](c) Microsoft Corporation, 2013. All rights reserved. Rodriguez C:\Users\anshu > ipconfig/all Windows IP configuration Name of the host...: fadigaPrimary Dns suffix...:Node... type: mixedActive... IP routing: No.Ac
-
Impossible to install the audio driver and the sound.
Original title: there is a problem with the sound I don't have it at all, he said that there is a problem with the driver for NVIDIA high definition audio and put it back in place could help, but my computer will not reinstall. There is a problem wit
-
Problems with windows mail, deleting messages
Hello It just happened when I read a message in windows mail and exit the program, when I come back, the message is deleted it is not in the file of deleted messages it disappears the same phenomenon occurs in the folder junk enail if I click not jun