How to execute OLEload script from cmd - teradata

I had builded .amj script from Teradata OLELoad GUI which connects to access and load data
to Teradata ?
I was able to successfully run the script using OLELoad GUI Utility.
Is there a way to run .amj file from command prompt ?
Thanks.

When you launch the script with OLELoad you have to use a TTU as Fastload, Bteq or whatever. You can do the same from the command line. You just have to call the TTU you choose (for example Fastload) with your script in the parameter section.
Example:
Bteq.exe < Your_script.txt
You mention that you are using an amj file. That file must be referred into your script.

You should be able to reference the .AMJ file as part of an INMOD on some of the Teradata Utilities. Refer to the Teradata Tools and Utilities Manual for the Teradata OLE DB Access Module here for examples.

Related

When run the Connect to Oracle Database using jybot getting the error cx_Oracle is not found

I tried to run the Query from Oracle Database using jybot option as i have some java custom code, that need in my test script along with query from oracle database.
I got the error cx_Oracle is not found.
When run the same using pybot (removed the java custom code) then i didn't get any errors.
If i run the java custom code alone using jybot then also no errors.
Steps i followed to install Database Library are as follows:
Install Visual C++ Compiler
Download and Install VCForPython27.msi (If not have the executable file, please check Important URLs section for link to download)
Set Environment Variables ORACLE_HOME, TNS_ADMIN if not setup already.
Install Database Library
Open the command prompt and run the following command
pip install robotframework-databaselibrary
Install cx_Oracle
Open the command prompt and run the following command
pip install cx_Oracle
Connect to Oracle Database Code:
Connect To Database Using Custom Params cx_Oracle '${Username}/${Password}#${Host}:${Port}/${DatabaseName}'
#{Numbers} Query SELECT NUMBER_V from MASTER_DB WHERE STATUS_V='F' and ROWNUM <= 10
Log ${Numbers[0]}
Any one, please help me how to run the query from oracle database using jybot.
Thanks
Sarada
cx_Oracle can't be sucessfully used under the jybot
Here is my solution:
Install DatabaseLibrary module by
pip install robotframework-databaselibrary
Install JayDeBeApi module by
pip install JayDeBeApi
now you can put these libraries anywhere you like - just copy them from Python\Lib\site-packages
And here is going the trick!
The DatabaseLibrary usage have following sample for jaydebeapi connection:
Connect To Database Using Custom Params | JayDeBeApi | 'oracle.jdbc.driver.OracleDriver', 'my_db_test', 'system', 's3cr3t'
However this is wrong! You have to use the brackets over the username-pass pair! Like this:
Connect To Database Using Custom Params | JayDeBeApi | 'oracle.jdbc.driver.OracleDriver', 'my_db_test', ['system', 's3cr3t']
And please do not forget to use URL connection instead of my_db_test! It should be like this:
jdbc:oracle:thin:#//127.0.0.1:1521/my_db_test
Regards

SQLite installation problems

I downloaded the binaries for windos for sqlite and extracted them. There were three files
a shell
dll
analyzer
when I try to run to create a database and a table from the sqlite shell i get....
SQLite version 3.7.8 2011-09-19 14:49:19
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> sqlite3 test.db
...> create table tbl1(one varchar(10), two smallint);
Error: near "sqlite3": syntax error
sqlite>
when I try to run to create a database and a table from the command line(Vista) shell I get....
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\codenamejupiterx>sqlite3 test.db
'sqlite3' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\codenamejupiterx>
does anyone have any ideas?????
There is no "installation".
The error is that "sqlite3.exe" was not found in the search path as defined by the (Windows) PATH environment variable. Either add it to %PATH% (see How do I set or change the PATH system variable?) or use a complete file qualification that does not rely on %PATH%. A fully qualified invocation may look like:
C:\path\to\sqlite\sqlite3.exe test.db
Running sqlite3 by "double clicking" the executable in Windows Explorer is the same as above [as it uses an absolute path to run the sqlite3 executable] -- albeit without the ability to specify the database name or other options. (These can be specified in a "shortcut" to sqlite3, if desired.)
Happy coding.
You run the command sqlite3 test.db to start the sqlite shell. (your first example) From in there, you do not need that part of the command again, just issue the "create table " command.
I think you need this:
SQLite-1.0.66.0-setup.exe And sqliteadmin to open sqlite database
Regards

Creating an sqlite database using command line shell in windows

I have my sqlite3.exe file in C:\ and i want to create an sqlite database in C:\db\sqlite.I have tried sqlite3 ex1 as suggested on the docs http://www.sqlite.org/sqlite.html but i get the error Error Near "sqlite3".
What is the correct way of creating a new database from the shell?.
Here is one way to use SQLite3 from the command prompt in Windows.
First you need to know the path to the folder where you installed the SQLite ODBC Driver. If you used the default settings this would be C:\Program Files\SQLite ODBC Driver on Windows XP
Go to Start -> Run -> type cmd -> click OK
This opens the command prompt.
In the Shell, type in the following command. You can use Alt + Space if you prefer to use cut and paste. Remember to modify the path for your setup if you installed SQLite in another folder.
cd C:\Program Files\SQLite ODBC Driver
This brings you to the SQLite install folder. Now you are ready to call SQLite. Type the following command at the SQLite prompt.
sqlite3
This opens the File menu where you can choose a database to connect to, or create a new database file.
Navigate to C:\db\sqlite and create myDatabase.db, and click Open to close the file menu.
Now you are ready to work on your new database, run your queries, e.g. create a table.
As new file is created in current directory, for creating file at different location you should follow this format:
eg. for storing file FILENAME.db at c:/users/xyz/abc
you should type
sqlite>.open c:/users/xyz/abc/FILENAME.db
and then press enter a new file will be created at the mentioned path.
and now when you will type .databases you will see your file listed in the list of databases.
You can use following command to create the sqlite database
.open databasename.db
or
.open c:/somefolder/databasename.db

Eclipse Plugin- How to execute UNIX command from eclipse plugin?

I am writing an eclipse plugin that will take input of a file name, pass that to a UNIX command and get the output back (The command is to get file path of entered file name from CVS repository). My basic plugin code is under development, but I am not finding any info on how can I execute UNIX commands from eclipse. Any pointers would be helpful.
Runtime.exec(...) from the Java standard library should do what you need to execute UNIX shell commands that are in your path of the user that is executing eclipse. If you want to call UNIX C libraries API you can use the JNA library.

Can you read pragma statements on command line startup in SQLite

I use the command line sqlite3 executable to check queries I make from my code.
Is there a way to read in pragma statements or other session setup (".mode csv" for example) when the executable starts up?
I know I can do a ".read " once I'm in, but that's tedious.
Put a .sqliterc file in your home directory with
the commands you want executed each time you start
the sqlite3 command line tool.
Unix and Linux use ~/.sqliterc; Windows tries to find the
location of .sqliterc using the environment variables
USERPROFILE HOME HOMEDRIVE and HOMEPATH.

Resources