[EMAIL PROTECTED] wrote:

...I call the exec task:

<exec program="osql">
  <arg value="-E -S ${nameOfDBServer} -n -d ${nameOfDatabase} -Q &lt;
&quot;${DBScriptPath}&quot;"/>          
</exec>
This isn't the right way to call it.  It's equivalent to typing

   osql "-E -S $... < ..."
i.e., putting everything into quotes and passing it as the first argument

<exec program="osql">
<arg value="-E" />
                        <arg value="-S ${nameOfDBServer}"/>
                        <arg value="-n" />
                        <arg value="-d ${nameOfDatabase}"/>
                        <arg value="-Q &lt; &quot;${DBScriptPath}&quot;" />     
    
</exec>

This is the right way to call it - except for the redirection in the last arg.

To understand this, you need to understand that redirection is a function provided by the command line interpreter. It's not provided (at least not directly) by the mechanism NAnt uses for actually executing other programs. You could probably make this approach work by having the exec invoke cmd (on Windows) or the shell of your choice (on Mono), passing it the entire command line formatted correctly. But that wouldn't be the cleanest way of doing it.

My copy of osql indicates that there's an -i option for specifying the input file. Can you use that? That would be the easiest, cleanest way of doing things. In the long run, it would make sense for NAnt to provide an attribute input="..." for this functionality, but it's not there yet.

Gary


Thanks for your help in advance!

Chris

---------------------------------------------
Dieses Mail wurde vom E-Mail Service
auf http://www.theWAP.at verschickt!




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users






-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to