Thursday, July 18, 2013

Oracle Synonym


Following query is to automatically update table data in one database based on changes in another database.

sql>create public synonym AMM_PRODUCTS_PHARMA for ALAB.AMM_PRODUCTS_PHARMA;

sql>create or replace
TRIGGER AMM_PRODUCTS_TRIGGER
after insert on APHARMA.AMM_PRODUCTS for each row
begin
insert into AMM_PRODUCTS_PHARMA
(PRD_ID,
PRD_GENERIC_NAME,
PRD_SHORT_DESC,
PRD_DESC
) values
(:new.PRD_ID,
:new.PRD_GENERIC_NAME,
:new.PRD_SHORT_DESC,
:new.PRD_DESC
);
end;

sql>create public synonym AMT_PROD_STOCK_DETAILS_PHARMA for ALAB.AMT_PROD_STOCK_DETAILS_PHARMA;

sql>create or replace trigger amm_prod_stock_details_trigger
after insert  on APHARMA.AMT_PROD_STOCK_DETAILS for each row
begin
 insert into AMT_PROD_STOCK_DETAILS_PHARMA
 (PRS_SEQ_NO,
PRS_DOC_DATE,
PRS_PER_ID,
PRS_CPY_ID
) values
(:new.PRS_SEQ_NO,
:new.PRS_DOC_DATE,
:new.PRS_PER_ID,
:new.PRS_CPY_ID
);
end;

-- By Mr. Nitesh Ghosalkar

Thursday, July 11, 2013

Entering sequence no in column of table already having data in SQL


  alter table AMM_PROD_DRUG_LICENCE add pdl_seq_no NUMBER(19,0);

update AMM_PROD_DRUG_LICENCE set pdl_Seq_no=1;

CREATE SEQUENCE pdl_sequence_no_seq
  START WITH 1
  INCREMENT BY 1
  CACHE 50;

UPDATE AMM_PROD_DRUG_LICENCE
   SET pdl_seq_no = pdl_sequence_no_seq.nextval;

Wednesday, July 3, 2013

Spring Roo Files



There are many different types of files used in Spring Roo project having various code to perform task:-

1.] .java files - These can be the domain class files, controller files, service files, Exception class files.

2.] .aj files - These are aspect java files and are automatically created by Spring Roo project for a particular domain class after running 'web mvc all <pkg_name>' command in Roo Shell.

3.] .jspx files - These are the view components of MVC framework for the project. These files can be used to create report search screens as well.

4.] .properties files -
(a.) database.properties - It contains the username, password, database name, IP address etc.,
(b.) ReportDS.properties - We can write information about the IP address, database, tables to connect to retrieve data to display on reports.
(c.) application.properties - We can put error codes with messages in this file. It also consists of label name for various labels in .jspx pages.

5.] .tagx -

6.] .tld - birt.tld file is used to integrate BIRT reporting tool in STS. It's full form is Tag library descriptor.

7.] .xml -

8.] .rptdesign files - These are the report design files. It has information of columns datatypes and validations with queries for BIRT reports.