Forum Stats

  • 3,836,753 Users
  • 2,262,182 Discussions
  • 7,900,094 Comments

Discussions

To get inputs from a text file to a sql statement

Dear All,

             I want to get the inputs from a text file to a sql statement as follows, I have a text

file called "myfile.txt" in the following format

2222

3333

4444

6666

8888

5555

.................

....................

                     I want to write a query like

select * from mytable where indexnum in "c:\myfile.txt"

if I write this in a traditional way, it would be like

select * from mytable where indexnum in ('2222','3333','4444','6666','8888','5555')

so, how to write the same query to read from the text file

Thanks

Chandana