I need to create a XREF table to fix tons of records in the database, I loaded the correct records in a custom table (SZTSBGI) here is the description.
I need to use the following tables SOBSBGI ( SOBSBGI_SBGI_CODE VARCHAR2(6 BYTE) NOT NULL, SOBSBGI_STREET_LINE1 VARCHAR2(30 BYTE), SOBSBGI_STREET_LINE2 VARCHAR2(30 BYTE), SOBSBGI_STREET_LINE3 VARCHAR2(30 BYTE), SOBSBGI_CITY VARCHAR2(20 BYTE) NOT NULL, SOBSBGI_STAT_CODE VARCHAR2(3 BYTE), SOBSBGI_CNTY_CODE VARCHAR2(5 BYTE), SOBSBGI_ZIP VARCHAR2(10 BYTE), SOBSBGI_NATN_CODE VARCHAR2(5 BYTE), SOBSBGI_ACTIVITY_DATE DATE NOT NULL
And STVSBGI ( STVSBGI_CODE VARCHAR2(6 BYTE) NOT NULL, STVSBGI_TYPE_IND VARCHAR2(1 BYTE) NOT NULL, STVSBGI_SRCE_IND VARCHAR2(1 BYTE), STVSBGI_DESC VARCHAR2(30 BYTE), STVSBGI_ACTIVITY_DATE DATE NOT NULL, STVSBGI_ADMR_CODE VARCHAR2(4 BYTE), STVSBGI_EDI_CAPABLE VARCHAR2(1 BYTE), STVSBGI_FICE VARCHAR2(6 BYTE), STVSBGI_VR_MSG_NO NUMBER(6), STVSBGI_DISP_WEB_IND RAW(1) ) I am planning to load the data( via sqlldr) in the table
Before I load the data I need to write the query or the view to generate a file. Here is my question( sorry if is a stupid one), do I need to join the tables SZTSBGI, SOBSBGI and STVSBGI, I can join nitcap(SOBSBGI_CITY) = initcap(SZTSBGI_CITY) and initcap(SOBSBGI_STREET_LINE1) = initcap(SZTSBGI_ADDR_LINE_1) AND SOBSBGI_SBGI_CODE = STVSBGI_CODE and SOBSBGI_ZIP = SZTSBGI_PSTL_CODE
NOT all the records matched, some of the SOBSBGI_STREET_LINE1 are not equal to SZTSBGI_ADDR_LINE_1 the same with AND SOBSBGI_SBGI_CODE = STVSBGI_CODE and SOBSBGI_ZIP = SZTSBGI_PSTL_CODE
OR option 2 Do I need to load all the COLUMNS WITH THE SOBSBGI IN THE name with the all the data from the SOBSBGI table, not joins the same with the STVSBGI and COLL_BOARD (is in SZTSBGI) not joins just load the columns Straight from the table, I guess I dont have experience loading XREF tables&
If the option 2 is the right one can you give me some ideas of how to Write the code, union? Online view? Pl\sql&.