Author |
Topic |
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-13 : 07:34:02
|
Hii have a question about inserting data..i have a column like thisdna-----151C>T768 G>T2588G>CdelEX+1-15+now, i must insert into every existing field "c."so the new column must be:dna-----c.151C>Tc.768 G>Tc.2588G>Cc.delEX+1-15+is there an easy way to do that?thanksgreetz, TerryNL |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-03-13 : 07:38:49
|
[code]update tset dna = 'c.' + dnafrom yourtable t[/code]or you can just prefix it during select[code]select 'c.' + dnafrom yourtable[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-13 : 08:22:10
|
Also make sure the column has enough size to hold dataMadhivananFailing to plan is Planning to fail |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-13 : 08:24:58
|
great, thanksbut in Microsoft Access 2007 the system gives an error on the same databasesyntaxerror (operator is missing) in query-expressionupdate dset dna = 'c.' + dnafrom dna1 dany idea how i must solve this?this would really help! |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-13 : 08:35:00
|
Tryupdate dna1set dna = 'c.' + dnaMadhivananFailing to plan is Planning to fail |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-13 : 08:52:40
|
great many thanks it works exactly how is should work |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-13 : 09:01:07
|
quote: Originally posted by TerryNL great many thanks it works exactly how is should work
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-13 : 09:16:41
|
now i have a following question:in the database i have this:dna--------806_810delCCCTG800 kb del800 kb del8 kb del8 kb del8 kb del8 kb del8 kb del799C>Tthe only things i want to update are 806_810delCCCTGand 799C>Tbut i want to update more from 806 up.. so 808C>T also needs to be updatedis there some code that can update records if there 801* and up??with the star i mean that everthing can stand behind the first 3 numbers, so 801_hshe of 801_2818 should make no difference |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-03-13 : 09:25:01
|
quote: Originally posted by TerryNL great, thanksbut in Microsoft Access 2007 the system gives an error on the same databasesyntaxerror (operator is missing) in query-expressionupdate dset dna = 'c.' + dnafrom dna1 dany idea how i must solve this?this would really help!
You have posted in SQL Server 2000 forum. The syntax i used does not work for Access. You should post in the Access forum for MS Access related question KH[spoiler]Time is always against us[/spoiler] |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-13 : 09:29:30
|
quote: Originally posted by khtan
quote: Originally posted by TerryNL great, thanksbut in Microsoft Access 2007 the system gives an error on the same databasesyntaxerror (operator is missing) in query-expressionupdate dset dna = 'c.' + dnafrom dna1 dany idea how i must solve this?this would really help!
You have posted in SQL Server 2000 forum. The syntax i used does not work for Access. You should post in the Access forum for MS Access related question KH[spoiler]Time is always against us[/spoiler]
I know that, but because you guys helped me so fast i thought i post it herei've been helped much withyour answer and from the other answersnormally sql in sql server is pretty much the same as in accessso maybe someone has the answer to my newest post |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-14 : 03:07:15
|
quote: Originally posted by TerryNL now i have a following question:in the database i have this:dna--------806_810delCCCTG800 kb del800 kb del8 kb del8 kb del8 kb del8 kb del8 kb del799C>Tthe only things i want to update are 806_810delCCCTGand 799C>Tbut i want to update more from 806 up.. so 808C>T also needs to be updatedis there some code that can update records if there 801* and up??with the star i mean that everthing can stand behind the first 3 numbers, so 801_hshe of 801_2818 should make no difference
Nobody has an answer to my question? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-14 : 06:02:42
|
trywhere left(col,3) between 801 and 806MadhivananFailing to plan is Planning to fail |
 |
|
TerryNL
Starting Member
21 Posts |
Posted - 2008-03-14 : 07:13:57
|
it works properly now!thank you very muchsaves me a lot of time, instead of changing 6000 records by hand i now can use a query :) |
 |
|
|