0% found this document useful (0 votes)
12 views

GT

The document contains SQL statements for inserting, updating, deleting and selecting data from various database tables related to purchase orders. It includes statements for inserting order details for specific order numbers, items and locations, as well as updating quantities, deleting old records, and selecting existing records for validation.

Uploaded by

digpal12
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

GT

The document contains SQL statements for inserting, updating, deleting and selecting data from various database tables related to purchase orders. It includes statements for inserting order details for specific order numbers, items and locations, as well as updating quantities, deleting old records, and selecting existing records for validation.

Uploaded by

digpal12
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

insert into ord_br_dtls ( ord_no,orddt,itemcode,mst_code,dpcd,vendor)

values(5,'08-feb-10',3310,3,613,select distinct vendor from ord_mst where ord_no


=5 and orddt='08-sep-10')
select del_Status,ins_Status,invoice,dtls.qty qty,to_char(nvl(mast.unit_price,0)
,99999999999990.99) unit_price,taxes,amount,saf_Status,pay,sl,cap,section,remark
s from ORD_BR_DTLS dtls, ord_dtls mast where dtls.itemcode=3313 and dtls.mst_cod
e=2004 and mast.ord_no=dtls.ord_no and mast.orddt=dtls.orddt and mast.itemcode=d
tls.itemcode and mast.MST_CODE=dtls.mst_code and dtls.ord_no= 5 and to_char(dtls
.orddt,'DD/MM/YYYY')='09/08/2001' and dtls.dpcd = 618

insert into ord_br_dtls(ord_no,orddt,item,itemcode,mst_code,model_spec,del_statu


s,ins_status,invoice,
qty,unit_price,amount,saf_status,pay,sl,Cap,dpcd,location,section,taxes,remarks)
values(5,to_date('09/08/2001','DD/MM/YYYY'),'3313-High Speed Printers',3313,2004
,'###EPSON DFX8500 1120/136/9 HIGH SPEED PRN',
'D','I','Y',1,132500,132500,'Y','Y',nvl('',null),'C',618,'UDUPI COURT ROAD (MAIN
) (618)','BCS',0,'some digpal')
select * from ord_br_unit_dtls where dpcd=618 and itemcode=3313
select * from ord_br_dtls where dpcd=618 and itemcode=3313 and mst_code=2009
select nvl('I',null) from dual

delete from ord_br_unit_dtls where ord_no=5 and to_char(orddt,'DD/MM/YYYY')='09/


08/2001' and dpcd =618 and itemcode= 3313 and mst_code =2004

delete from ord_br_dtls where ord_no=5 and to_char(orddt,'DD/MM/YYYY')='09/08/20


01' and dpcd =618 and itemcode= 3313 and mst_code =2004

insert into ord_br_dtls(ord_no,orddt,item,itemcode,mst_code,model_spec,del_statu


s,ins_status,invoice,qty,unit_price,amount,saf_status,pay,SL,Cap,dpcd,location,s
ection,taxes,remarks) values(5,to_date('09/08/2001','DD/MM/YYYY'),'3313-High Spe
ed Printers',3313,2004,'###EPSON DFX8500 1120/136/9 HIGH SPEED PRN',nvl('D',null
),nvl('I',null),'Y',5,132500,663250,nvl('Y',null),nvl('Y',null),'','C',618,'UDUP
I COURT ROAD (MAIN) (618)','BCS',150,'from 1 to 5')

insert into ord_br_full_dtls_log(ord_no,orddt,itemcode,mst_code, dpcd,ear_qty,mo


d_qty,by_whom,updt_date)
values(5,to_date('09/08/2001','DD/MM/YYYY'),3313,2004,618,1,5,,sysdate)

select hsp_code from hsp_mst where itemcode=3313 and upper(ltrim(rtrim(leg_desc


))) = 'EPSON DFX8500 1120/136/9 HIGH SPEED PRN'
select to_char(nvl(unit_price,0),99999999999990.99) unit_price
from ORD_dtls where ord_no= 5 and to_char(orddt,'DD/MM/YYYY')='09/08/2001' and i
temcode=3313
and mst_code=2004

You might also like