If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > query result to xml file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-05, 06:56
aalokb aalokb is offline
Registered User
 
Join Date: Oct 2004
Posts: 9
query result to xml file

I want to store the result of this query
"select name, age from det for xml raw"
to a text file test.xml in c:\
any guesssss!!!
Reply With Quote
  #2 (permalink)  
Old 02-10-05, 08:37
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Execute the command exactly as you've shown it in your program, then have your program stream the results from the statement into the file.

-PatP
Reply With Quote
  #3 (permalink)  
Old 02-12-05, 00:30
aalokb aalokb is offline
Registered User
 
Join Date: Oct 2004
Posts: 9
I have a to make a job which will do the work for me. The result is to be stored in XML file so when my site user makes a search it can be done in middleware itself..no need to goto backend.
I have been trying with Job scheduling I had managed to make a file ...but the problem was with LOG which gets appended all the time .
I have also tried with BCP ...but it has some Character encoding problem.
Now I'm trying out with OSQL. I donnt knw how to use it but lets see..
any sugg...
Reply With Quote
  #4 (permalink)  
Old 02-12-05, 11:18
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Is there some reason that you're willing to take the performance hit involved in using middleware to do a job that the database is designed to do for you? It certainly can be done, but most designers prefer the faster response time offered by using the database to solve this kind of problem.

The short answer is to use your middleware if possible to create the XML file. Have the middleware execute the SQL, then stream the result to a file. IF you can't do that, you can use OSQL.EXE to create the file too, but you'll almost certainly have problems using it.

-PatP
Reply With Quote
  #5 (permalink)  
Old 02-16-05, 02:16
aalokb aalokb is offline
Registered User
 
Join Date: Oct 2004
Posts: 9
hey !!
well performance is a issue...since its a search module on a dating site..i need to make it work this way....also its a gud topic for me to experiment something new ...
OSQL.exe...well i'm trying dat...let me see..
ty for ya help..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On