SELECT wnd.NAME,
wdd.item_description,
requested_quantity,
wdd.shipped_quantity,
ooha.order_number "SO",
oola.line_number "SO Line",
oola.actual_shipment_date,
wnd.ultimate_dropoff_date,
wnd.initial_pickup_date
FROM oe_order_headers_all ooha,
oe_order_lines_all oola,
wsh_delivery_details wdd,
wsh_delivery_assignments wda,
wsh_new_deliveries wnd
WHERE wdd.source_code = 'OE'
AND ooha.order_number = '訂單號碼'
AND ooha.header_id = oola.header_id
AND wdd.source_line_id = oola.line_id
AND wdd.source_header_id = ooha.header_id
AND wdd.delivery_detail_id = wda.delivery_detail_id
AND wda.delivery_id = wnd.delivery_id

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

select wie.wip_entity_name,
prh.segment1 PR_NO,
ph.segment1 PH_NO
from wip_entities wie,
po_requisition_headers_all prh,
po_requisition_lines_all prl,
po_req_distributions_all prd,
po_distributions_all pda,
po_headers_all ph
where prh.requisition_header_id = prl.requisition_header_id
and prl.requisition_line_id = prd.requisition_line_id
and prd.distribution_id = pda.req_distribution_id(+)
and pda.po_header_id = ph.po_header_id(+)
and prl.wip_entity_id = wie.wip_entity_id
and wie.wip_entity_name = 'XXXX'

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

CREATE SEQUENCE MYTESTSEQ
START WITH 9 --起始值
MAXVALUE 9999999999 --最大值
MINVALUE 1 --最小值
NOCYCLE
CACHE 20
NOORDER;
當需要使用時如下
SELECT MYTESTSEQ.nextval from dual

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

select ooh.order_number, hca.account_number, hp.party_name
from oe_order_headers_all ooh,
hz_cust_site_uses_all hcsua, -- uses of customer addresses
HZ_CUST_ACCT_SITES_ALL hcasa, -- customer addresses
hz_cust_accounts hca, -- customer accounts
hz_parties hp -- parties
where ooh.ship_to_org_id = hcsua.site_use_id -- or a.invoice_to_org_id
and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
and hcasa.cust_account_id = hca.cust_account_id
and hca.party_id = hp.party_id
and ooh.order_number = P_order_number

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

select ala.alert_name, ala.table_name, acv.subject
from ALR_ALERTS ala, ALR_ACTIONS_V acv
where ala.alert_id = acv.alert_id
and SUBJECT like '%%'

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

SELECT trigger_name,
trigger_type, triggering_event,
table_name,
referencing_names,
status,
trigger_body
FROM user_triggers
WHERE trigger_name = '';

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

1) Create the 'product' table and 'product_price_history' table
CREATE TABLE product_price_history
(product_id number(5),
product_name varchar2(32),
supplier_name varchar2(32),
unit_price number(7,2) );
CREATE TABLE product
(product_id number(5),
product_name varchar2(32),
supplier_name varchar2(32),
unit_price number(7,2) );
2) Create the price_history_trigger and execute it.
CREATE or REPLACE TRIGGER price_history_trigger
BEFORE UPDATE OF unit_price
ON product
FOR EACH ROW
BEGIN
INSERT INTO product_price_history
VALUES
(:old.product_id,
:old.product_name,
:old.supplier_name,
:old.unit_price);
END;
/
3) Lets update the price of a product.
UPDATE PRODUCT SET unit_price = 800 WHERE product_id = 100

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

update mtl_system_items_b
set PURCHASING_ENABLED_FLAG = 'N',
CUSTOMER_ORDER_ENABLED_FLAG = 'N',
INTERNAL_ORDER_ENABLED_FLAG = 'N',
MTL_TRANSACTIONS_ENABLED_FLAG = 'N',
STOCK_ENABLED_FLAG = 'N',
BOM_ENABLED_FLAG = 'N',
BUILD_IN_WIP_FLAG = 'N',
INVENTORY_ITEM_STATUS_CODE = 'Inactive',
INVOICE_ENABLED_FLAG = 'N'
where inventory_item_id = 341386
and organization_id = 222
料號生效
update mtl_system_items_b
set PURCHASING_ENABLED_FLAG = 'Y',
CUSTOMER_ORDER_ENABLED_FLAG = 'Y',
INTERNAL_ORDER_ENABLED_FLAG = 'Y',
MTL_TRANSACTIONS_ENABLED_FLAG = 'Y',
STOCK_ENABLED_FLAG = 'Y',
BOM_ENABLED_FLAG = 'Y',
BUILD_IN_WIP_FLAG = 'Y',
INVENTORY_ITEM_STATUS_CODE = 'Active',
INVOICE_ENABLED_FLAG = 'Y'
where inventory_item_id = 341386
and organization_id = 222

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

declare
po_number varchar2(20):='PO單號'; --key
v_cancel_reason varchar2(100) := 'PO created for price tracking purpose only';
begin
if po_number is null or v_cancel_reason is null then
dbms_output.put_line ('null');
else
--po header
FOR R1 IN (select *
from po_headers_all
where segment1 =po_number)
loop
--po_header
insert into po_headers_all_bk
select *
from po_headers_all
where po_header_id =r1.po_header_id;
update po_headers_all
set closed_date = sysdate,
cancel_flag = 'Y',
closed_code = 'CLOSED'
where po_header_id =r1.po_header_id
and org_id = r1.org_id;--r1.po_header_id
--po lines
insert into po_lines_all_bk
select *
from po_lines_all
where po_header_id =r1.po_header_id;
update po_lines_all
set quantity = 0,
cancel_flag= 'Y',
cancelled_by = -1,
cancel_date =sysdate,
cancel_reason = v_cancel_reason,
closed_code ='CLOSED',
closed_date = sysdate,
closed_reason ='Update Closure Status Rolled Up',
closed_by =-1
where po_header_id =r1.po_header_id
and org_id = r1.org_id;
--po line location
for r2 in (select *
from po_lines_all
where po_header_id =r1.po_header_id
and org_id = r1.org_id)
loop
insert into po_line_locations_all_bk
select *
from po_line_locations_all
where po_line_id =r2.po_line_id;
UPDATE po_line_locations_all
SET quantity_cancelled = quantity,
cancel_flag = 'Y',
cancelled_by = -1,
cancel_date =sysdate,
cancel_reason = v_cancel_reason,
closed_code = 'CLOSED',
closed_reason ='Update Closure Status Rolled Up',
closed_date =sysdate,
closed_by =-1
where po_line_id =r2.po_line_id;
insert into po_distributions_all_bk
select *
from po_distributions_all
where po_line_id =r2.po_line_id ;
update po_distributions_all
set quantity_cancelled =quantity_ordered
where po_line_id =r2.po_line_id;
end loop;
end loop;
commit;
end if;
end;

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

declare
po_number varchar2(20):='PO單號' ;
begin
--po header
FOR R1 IN (select *
from po_headers_all
where segment1 =po_number)
loop
update po_headers_all
set authorization_status='APPROVED',
approved_flag='Y',
approved_date=sysdate
where po_header_id =r1.po_header_id;--r1.po_header_id
--po lines
for r2 in (select *
from po_lines_all
where po_header_id =r1.po_header_id)
loop
UPDATE po_line_locations_all
SET approved_flag='Y',
approved_date=sysdate
where po_line_id =r2.po_line_id;
end loop;
/* select *
from po_distributions_all
where po_line_id in (29568,29910)*/
end loop;
commit;
end;


                                

                                

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

Encoding myEncoding = Encoding.GetEncoding("UTF-8");
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://localhost:57694/Default.aspx");
req.Method = "GET";
using (WebResponse wr = req.GetResponse())
{
using (StreamReader myStreamReader = new StreamReader(wr.GetResponseStream(), myEncoding))
{
string data = myStreamReader.ReadToEnd();
Console.WriteLine("data:" + data.Split('\n')[0]);
}
}

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

//查詢資料夾目錄下所有檔案名稱
public void DirSearch(string sDir)
{
try
{
//先找出所有目錄
foreach (string d in Directory.GetDirectories(sDir))
{
//先針對目前目路的檔案做處理
foreach (string f in Directory.GetFiles(d))
{
Console.WriteLine(f);
}
//此目錄處理完再針對每個子目錄做處理
DirSearch(d);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}
}
/* Form 查詢資料夾內容清單
String[] FileCollection;
String FilePath = "F:\\Uploads";
FileInfo theFileInfo;
FileCollection = Directory.GetFiles(FilePath, "*.txt");
for(int i = 0 ; i < FileCollection.Length ; i++)
{
theFileInfo = new FileInfo(FileCollection[i]);
Response.Write(theFileInfo.Name.ToString());
}
*/

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。