Macro to run selected SQL code and display results

Macro to run selected SQL code and display results

4
NewbieNewbie
4

    Jul 08, 2005#1

    Copy the selected sql code into a file, perhaps use isql (or oracle equivalent) to run the sql, piping the output into a file that is then loaded by UE

    Anyone got anything that does something like that?

      Jul 08, 2005#2

      OK, no one came up with a solution, so here's mine (just invented)

      Its a bit dirty, and involes a macro and setting up a tool
      Macro:
      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      IfSel
      Copy
      NewFile
      Paste
      SaveAs "C:\temp\sql.tmp"
      CloseFile NoSave
      RunTool "XXRun SQL"
      EndIf

      Tool setup:
      Name: "XXRun SQL"
      cmd line: "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\isql.exe" -U sa -P yourpwd -d Northwind -i "c:\temp\sql.tmp" -w 1000 -e -n -r

      tool settings: Create New file, Capture Output

      I havent figured out a good way to specify the database name - shame its not possible to ask for params somehow?