tags:

views:

50

answers:

1

Hi, How to load a multiple line query in one row using mysql.The data is stored in a text file.
For example: "GGAGTTGTGGGAGTGGAGGAGGAAGAGGCGGTGGGGAGTACGGGGGCTGGTCCCAGAAGATGGCGGAGGC GGGGGATTTCTGGTAGGTCCTACTTTAGGACAAGATGTGGTGGTACTGTTGAAGCGTCAGTCTTTGATTC"

Thanks in advance.

+1  A: 
INSERT INTO dna_strands SET base_sequence = "GGAGTTG
TGGGAGTGGAGGAGGAAGAGGCGGTGGGG
AGTACGGGGGCTGGTCCCAGAAGATGGCGGAGGC
GGGGGATTTCTGGTAGGTCCTACTTTAGGACAAGATGTGG
TGGTACTGTTGAAGCGTCAGTCTTTGATTC";

As long as you're escaping the input correctly, MySQL doesn't care that the sequence of characters contains linebreaks.

Piskvor
But surely the linebreaks are stored as part of the data - and DNA doesn't have a line breaks! So presumably bharath should be removing the linebreaks before constructing the insert?
symcbean
Maybe; but in the absence of further information, we could speculate about the data and about bharath's business logic till we're blue in the face ;)
Piskvor