Arcana Development logo
Site Search:
  • Home
  • Products
    • Products Overview
    • adTempus
    • Report Commander
    • Arcana Scheduler
  • Support
    • Support Home
    • Knowledge Base
    • License Management
    • Contact Support
  • Community
  • Purchase
    • Pricing and Ordering
    • Additional Purchasing Information
  • Contact
  • About Us
  • Forum HelpHelp
  • Log In
  • Register

Community

Arcana Development Forums > adTempus > Scripts > Using a Script to specify command-line parameters
{1}
##LOC[OK]##
{1}
##LOC[OK]## ##LOC[Cancel]##
{1}
##LOC[OK]## ##LOC[Cancel]##

Answered Question Using a Script to specify command-line parameters RSS Feed Icon

You must be logged in to reply to this topic.

1
(Showing 1 to 2 of 2)
Avatar
AlbreK01
Joined: June 29, 2010
Posts: 3
Posted June 30, 2010 10:16:19 AM
 

I am trying to write a script to call SQL using osql.

This is the call I'm building . . .

Environment.Item("NmsDwSqlScript") = -S %COMPUTERNAME%  -Q "exec NmsDw.dbo.spProcFileLogIns @FileName='" & Environment.Item('INVOICEFILE") & "', @FileSize='" & Environment.Item("NmsDw_FileSize") & "', @FileDate='" & Environment.Item("NmsDw_FileTms") & "', @TableName='NmsInvoiceDw'" & "'"

The resulting contents of "NmsDwSqlScript" look like . . .

NmsDwSqlScript-S LINSQL02  -Q 'exec NmsDw.dbo.spProcFileLogIns @FileName='INV.TXT', @FileSize='44335694', @FileDate='6/30/2010 7:47:11 AM', @TableName='NmsInvoiceDw''

The error I keep getting is this . . .

Msg 170, Level 15, State 1, Server X, Line 1Line 1: Incorrect syntax near 'NmsDwSqlScript'.

I am just guessing that it's because I am trying to use environment variables for the parameter values in the SQL string.

Any help on this problem would be appreciated.

THANK YOU!!!

 
Avatar
AlbreK01
Joined: June 29, 2010
Posts: 3
Posted June 30, 2010 12:53:46 PM
 

Never mind . . . Figured it out.

Had to write the script like this . . .

-S %serverName% -d NmsDw -Q "exec spProcFileLogIns '%INVOICEFILE%', '%NmsDw_FileSize%', '%NmsDw_FileTms%', NmsInvoiceDw" -e -E

 
  Copyright 2012 Arcana Development, LLC. Use of this site signifies your agreement to the terms of use and privacy policy.