Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-03-2020, 10:07 AM
CustomX CustomX is offline
Registered User
 
Join Date: Nov 2020
Posts: 1
Passing arguments to plain text file

Hello everybody, I'm new in this forum, but and old SecureCRT user.

I would like to ask if any can help me to resolve this needed:

As database administrator, I use SecureCRT daily and from long time ago I had been customizing by vbs scripting some tasks for my daily work.

So, right now I'm little stuck with something maybe very easy to resolve.

Actually I use plain text files with several SQL queries, that files I call by vbs script in SecureCRT. I mean, I have a vbs file with something like this example:

Code:
Const ForReading = 1
Const ForWriting = 2

Sub Main
  crt.Screen.Synchronous = True
  Dim fso, file, sql_id
  
	sql_id = InputBox ("Por favor, introduzca el SQL_ID.")
  Set fso = CreateObject("Scripting.FileSystemObject")

  strFile = "F:\_Work_Center\SecureCRT\sqlScripts\SQL_ID_Stats.sql"
  Set file = fso.OpenTextFile(strFile, ForReading, False)
 
  Do While file.AtEndOfStream <> True
    str = file.Readline
    crt.Screen.Send str & Chr(13)
    
  Loop

  crt.Screen.Synchronous = False
End Sub
And, in te .sql file, there is written a query.

I would like to incorporate now to the call of the .sql file, arguments in order to the SQL sentence catchs the parameters than I send by the vbs file.

For example in a normal execution of my .sql file passing arguments, I need to write something like this in the command interface (running in ORACLE SQL*Plus):
@/PATH/OF/SQL_FILE/sqlfile.sql ARGUMENT

where <ARGUMENT> is the value where the content of the sqlfile.sql will catchs or process..

I would be very grateful for any help or suggestions you could give me in this regard.

Thanks in advance!

PD.:
Sorry for my bad english grammar...
Reply With Quote
  #2  
Old 11-03-2020, 10:41 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,522
Hi CustomX,

What version of SecureCRT are you using?

We are not really familiar with all things SQL, so I am not sure how much help we can provide.

How would you accomplish this task manually?

Please be as explicit as possible when listing the steps.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:50 PM.