| Author |
Topic |
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 05:21:18
|
| [code]hi iam having two tables where data migration should be done tables are :Table1:EMRFPDcolumn datatypeIS_MENARCH VARCHARTable2: EMRFRExamData:column datatypeFR_EXAM_DATA_ID numericPATIENT_ID numericENCOUNTER_ID numericTable3:EMRFRExamAns:column datatypeFR_EXAM_ANS_ID numericFR_EXAM_DATA_ID numericQUES_ID numericQUES_ANS_ID numericCTRL_VALUE varcharDISP_LABEL varcharONLY MIGRATION HAS TO BE DONE IF IS_MENARCH FROM EMRFPD VALUES ARE '1' ONLYEMRFRExamData table holding records.EMRFRExamAns needs to be migrated nowa)FR_EXAM_ANS_ID has to be generated with a sequence starting with some number 1500 foe example.b)FR_EXAM_DATA_ID values has to be taken from table 2c)QUES_ID,QUES_ANS_ID both from Table EMRFRQUESLKUP columns QUES_ID,QUES_ANS_IDd)CTRL_VALUE,DISP_LABEL are to be taken by EMRFRANSLKUP TABLE WHICH HAVING THREE COLUMNS ANS_ID ANS_LABEL CTRL_TYPE INT VARCHAR VARCHAR 1. IF ANS_LABEL IS YES THEN CTRL_VALUE=YES AND DISP_LABEL=NULL 2. IF ANS_LABEL IS DATE THEN CTRL_VALUE=DATE AND DISP_LABEL=NULL 3. IF ANS_LABEL IS OTHER THAN YES AND DATE THEN CTRL_VALUE=1 AND DISP_LABEL=THAT PATICULAR COLUMN VALUE[/code] |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:21:14
|
| hi can anyone please help me in doing this so |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:23:33
|
| how do you relate table 1 with others? it just has a IS_MENARCH field alone?? |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:25:55
|
| no it is already done now i want for the last table.how can i do so. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:28:04
|
| sorry i dont get what you're asking for. dont you need to consider table1's field for migrating data to table3? |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:30:31
|
| no actually first and second table refers that and has been done .now its turn for third table considering with the second one |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:40:57
|
| Hi any stored procedure in this help will be appreciated |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:44:09
|
| how is EMRFRQUESLKUP related to exam data? |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:47:16
|
| Actually i have to migrate it from 3-4 tables.All are seperate tables here.These are newly created tables where existing data should go into those |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:49:07
|
| then how do you decide which row of one table should be linked to other? |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:50:38
|
| First column will be generated in a sequence,second column should get from second table,third and fourth columns from another |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:53:07
|
| there's no concept of sequence in sql table. |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:54:17
|
| sorry it has to be generated foe example starting with 1500 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-12-11 : 13:57:10
|
| please understand what i'm talking about. your first column sequence can be generated by making it an identity column. what i'm telling is you need a way (column(s)) by virtue of which you can link data from table 2 & other and take related col2,col3,col4 values for table 1 |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2009-12-11 : 13:59:50
|
| Can you give me at least some tried script as of there is no link between 1 and 3 tables |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-12-11 : 14:40:06
|
| You need to follow the "How to ask" link in my signature.http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-14 : 08:58:48
|
quote: Originally posted by DonAtWork You need to follow the "How to ask" link in my signature.http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
No matter how many times you tell him, he wont listenHe will stop as soon as he gets what he wants or if more questions are asked. See his recent threadsMadhivananFailing to plan is Planning to fail |
 |
|
|
|