473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to append a varaible value depending upon how it comes in sql columns

Hi Guys,

I am looking for some like this. I should append the column values in which my query gene comes and this is random.
thanks for help in advance:

So here is my code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. #sql statements and fetch method here
  3. hit = list()
  4. for i,v in enumerate(row)
  5.    if query_gene first comes in? v[1]:
  6.             hit.append(v[1])
  7.         else:
  8.             hit.append(v[2])
  9. #So I need to write something where "first comes in" Please help me
  10.  
  11.  
Aug 13 '10 #1
1 1250
dwblas
626 Expert 512MB
Try printing v and seeing if you can split it (if it is a string) or use in or startswith(). Other than that, you will have to ask a more specific question (with example data) to get a more specific answer.
Aug 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: M. Clift | last post by:
Hi All, I have tried to come up with a way to do this myself and all I end up with is very long code. What I have is a say item1, item4, item2, item1 etc... What I want to do is append to...
3
by: param | last post by:
Hi, I need to write a MACRO which helps to call different functions depending upon it's value say On or OFF. If its' value is ON the function1 should get called and if value is OFF function2...
1
by: ramalingam | last post by:
Hi I am very new to PHP. Please help. I have a HTML code in a php file which takes in USERID and password. I have <input name="Submit" type="button" value="Submit" onClick="funCheck()"/>,...
6
by: suresh Chowdary | last post by:
Hi All, depending upon text box entry i want to show drop down box with respective values. means if user enters 'ls' in the text box i want to show the values like 'she','he' in dropdown box it...
9
by: rajasekhar | last post by:
Hallo, I am developing a site, and here whats the problem is: how to partition the code, i.e. if I developed 1000 lines of code, in that I want to show first 200 lines only if the user opens my...
3
by: ajaypaidi | last post by:
HI gurus, i need to select a value based upon 2 columns.for instance,i have table A and Table B where Table A has 2,3,4,5 values and Table B has D,E,F,G,H,I,J,K L,M which is related to Table A in...
2
by: bashhead | last post by:
Hi all, I have a basic shell script question. Say I have a variable called test. I already have a value in test = 'monkey' How do I append another value taken from a file, to this variable?...
10
by: pt36 | last post by:
Hi I have a page with a form and a textbox. before to submit the form I want to chek if the inserted value in the textbox is already present in a database. So I need to pass the textbox value...
6
by: mfaisalwarraich | last post by:
Hi Everyone, I am new to javascript. I want to load 3 forms which depends upon the selection of a value from Combo Box. For example i have a combo box on a page and it has three values Form1,...
7
by: Abhilash Etikala | last post by:
I am having table which contains 2 columns (qid,round) and both columns can have repeated values but one constraint is for each 'round' the 'qid' values should not be repeated. example:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.