Teradata FastExport Script - cannot get it to run - The system cannot find the file specified - database

I am brand new to teradata. I wrote a fastexport script to take some data from a db and export it to some excel files.
The script is all good. I just can't run it!
I am running the cmd fexp < C:\Documents\ScriptName (that is not the actual path)
Where ScriptName is a .txt file containing the script.
I get the error:
"The system cannot find the file specified"
I have tried changing the location of the file and such but always get the same error.
What am I missing here?

I found the answer. The correct command is:
fexp < "C:\Path to file\ScriptName.txt"

Related

Can't create Excel file from Octave script when running from batch file

Using Windows 10, Octave 4.4.1, and Excel 2016, I have an Octave script (call it "MyOctaveProgram.m") that takes data from a text file ("MyTextFile.txt"), which can be loaded with the uigetfile function, but for quicker access, I've created a batch file:
#echo off
C:\Octave\Octave-4.4.1\octave.vbs --force-gui --eval MyOctaveProgram("'%~d0%~p0'","'%~n0'")
cmd /c
The .bat file has the same name as the .txt file, other than the extension.
So far, this all works fine, and I can execute part of MyOctaveProgram.m via the GUI command line, or through the batch file. The difference comes in when I try to use a part of my code that creates a data table in Excel (with the COM interface), using
xls=xlsopen(ExcelFile)
xls=oct2xls(data...)
xls=oct2xls(more data...)
xls=oct2xls(etc...)
xlsclose(xls)
This works fine when I run MyOctaveProgram.m from the GUI command line (choosing MyTextFile.txt with the uigetfile function), but when I try to create the Excel file when running Octave through the batch script above, I get the following message:
(File pointer preserved. Try saving again later...)
This seems to produce no errors, and the session stays open (unlike the GUI, the batch-initiated Octave session will terminate if there's an error), but the Excel file is not created. There are no other Excel windows or tasks open, and I'm not trying to overwrite an existing file. Any advice would be appreciated!

Apache kafka error on windows 10: kafka-topics.bat file gives syntax error

I am starting to learn Kafka. I managed to run zookeeper and kafka successfully. I am using Windows10 and my kafka version is 2_12-2.5.0.
My question is that when I try to create a topic from cmd using the below command:
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic firstTopic`
I get the error:
The syntax of the command is incorrect.
I know that the command I wrote is correct and the issue is the command inside the .bat file as I changed the command inside the kafka-topics.bat, the error changes. However I could not manage to run it. This is the content of kafka-topics.bat:
"%~dp0kafka-run-class.bat" kafka.admin.TopicCommand %*
I also tried to run kafka-topics.sh file instead of batch, but that gives a different error opening git bash, that is:
Error:Could not find or load main class kafka.admin.topicCommand
I also got rid of the space in "Program Files" while writing the path, so I don't think that is the reason of this error.
I got stuck and its hard to understand these errors as I am new.
Can you please help?
in my case it worked only when I moved Kafka folder to C: partition without any space in path
for example C:\Kafka_sources
and I used the below command to create a topic
kafka-topics.bat --create --topic test --zookeeper localhost:2181 --partitions 1 --replication-factor 1
in my case:
i removed the quotation marks in .properties for directories
use forward slashes in .properties for directories
i removed the dot-version numbers in directory path (don't know if that was deciding)
but start with point and backlashes .\bin\windows\kafka-server-start.bat .\config\server.properties)
d:\ is possible !

Batch to create an empty file daily

I have read through several answers regarding this, but none of these appear to work for my situation.
I need to create an empty *.trg file in a specific folder on a server. (Eventually this job will be placed on the server to run, but currently I am just running it from my laptop).
I have the server mapped to my laptop and have tried this:
O:
cd: \MFT\OUT\TEMPMFT copy nul "RCVFILE6.trg"
When I get this I get an error The Filename, directory name, or volume label syntax is in correct.
I have also tried this:
O:
cd: \MFT\OUT\TEMPMFT
fsutil file createnew RCVFILE6.trg 0
Here are the results:
C:\Users\daniel.bina\Desktop>O:
O:\>cd: \MFT\OUT\TEMPMFT
The filename, directory name, or volume label syntax is incorrect.
O:\>fsutil file createnew RCVFILE6.trg 0
Error: The file exists.
I am not sure what I am doing wrong with this. All I want is an empty file created on a server.

Sqlcmd Error "The filename, directory name, or volume label syntax is incorrect"

I create a bat file for the first time, and have the following issue: my command is running just fine when I type it directly into the command prompt, but it's not running through the bat file I created. The script is:
#echo off
sqlcmd -S DESKTOP-55JKCD5\SQLEXPRESS -i “C:\Users\Didi\Documents\SQL\test.sql” -o “C:\Users\Didi\Documents\SQL\output.csv” -s”,”
I get the following message from cmd:
Sqlcmd: Error: Error occurred while opening or operating on file ôC:\Users\Didi\Documents\SQL\test.sqlö (Reason: The filename, directory name, or volume label syntax is incorrect).
I can't understand what's wrong, provided that I don't have any issues when typing directly in cmd.
I'm begging for your advice, guys! Bat files are totally new for me, apologies is asking a stupid question.
Don't use "smart quotes"! Use " - in a proper editor, not a word-processor.
If you are running this exe from Azure Dev Ops you can also get this issue if there is a new line in the definition of the step in the Release or Pipeline. The step is multiline so it is difficult to spot. It's the difference between:
ServerRoleMembership;ServerRoles;RoleMembership;Permissions" /v:Environment=$(Environment) /Diagnostics:true
/p:ScriptDatabaseOptions=false
and
ServerRoleMembership;ServerRoles;RoleMembership;Permissions" /v:Environment=$(Environment) /Diagnostics:true /p:ScriptDatabaseOptions=false
Both look same in Dev Ops, it's only when you copy them out to notepad you will see the new line

SQLLDR command Error .Dat file not found

I am trying to load few values in Oracle table using SQLLDR command via Command Prompt. I am trying to set a variable to get users put file name which will be accepted in SQLLDR command. I have a Control file (.CTL), a Data file (.txt) however it is throwing error:
SQL*Loader-500: Unable to open file (sqlldrtest.dat)
even though I have mentioned a .txt file as Data file.
This is first time I am using SQLLDR with a variable. I have successfully used SQLLDR command earlier without any variable.
Please can anyone help me in rectifying this error.
My code for .BAT file is:
set /p reportname="Enter Your Report Name: "
SQLLDR USERID=login/password#database CONTROL=%reportname%.CTL, DATA=%reportname%.txt
pause
Remove the comma after the CONTROL= and make sure to change your password!
If it still doesn't work, please update your post to show the contents of your control file.
The problem is with the format of your DATA file. Your data file need to have .dat extension.
Change the extension of your DATA file from .txt to .dat
Your command should look like this -
SQLLDR USERID=login/password#database CONTROL=%reportname%.CTL, DATA=%reportname%.dat

Resources