Home > database >  Which eldest brother, please help solve the problem of data read
Which eldest brother, please help solve the problem of data read

Time:10-05

I have a case, please help to see eldest brother, I'm new


1. Build tables:
Table fields: serial number (l_srv_incode Integer NOT NULL),
Acceptance number (s_srv_no varchar (20) not null),
The person that buy a house (s_xm varchar (50) null),
The person that buy a house id (s_sfzhm varchar (30) null),
Date of birth of the person that buy a house (dt_birthday datetime null)
The gender of the person that buy a house (I_sex smallint null)
Housing area (dc_jzmj decimal (10, 2) null),
House is located (s_zuoluo varchar (150) null),
Acceptance date (dt_service datetime null),
2. Read, data provided by the test. TXT, read to 1 in the table, pay attention to is the "|" split between data items,
Total field data:
S_xm buyers name
S_sfzhm buyers id number
Dc_jianzhu_mj housing area
S_zuoluo houses located
Dt_service acceptance date
Among them,
The person that buy a house of date of birth and gender automatically obtained from the id card number, if not empty,
Serial number sequence number, starting from 1,
Accepts the number=(date) (month) (year) + serial number (converted into five strings)
=20060309 + 00001
Table I have built, and the test. TXT edit good l_srv_incode | s_xm | s_sfzhm | dc_jzmj | s_zuoluo | dt_service
1 | zhang SAN | 342423198001022235 | 120 | 200 cooperative road greentown lily 912 | 20060102
2 | 342412197008053456 | 95 | |, dick, and harry the cooperative road 200 greentown lily 1102 | 20050305
342423198607042673 | 150 | 3 | Qiao Feng | huangshan road 460 electricity courtyard 212 | 20060421
4 | | 342113198409092379 | | 50 li Yang huangshan road 460 electricity courtyard 312 | 20060422
5 | li hai 460 | | 125 | 3412342198510219878 huangshan road electricity courtyard 212 | 20050104

CodePudding user response:

Using PB according to this table to do the DW
To open a TXT text, line to read cycle!
Each took out a line of string, with "|" split out the columns in the dW, and calculate the serial number and other columns
Finally the dw save

CodePudding user response:

Use application ultraedit first as under all
| replaced with TAB (09)

CodePudding user response:

Pick up points first!
  • Related