sqlplus

Logging output of external program with (wx)python

Hi I'm writing a GUI for using the oracle exp/imp commands and starting sql-scripts through sqlplus. The subprocess class makes it easy to launch the commands, but I need some additional functionality. I want to get rid of the command prompt when using my wxPython GUI, but I still need a way to show the output of the exp/imp commands. ...

How to Prevent SQL Injection in Oracle SQLPlus?

Obviously if I am using JDBC/ODBC, I can use bind variables and prepared statements to prevent SQL injection. However, when data is passed to batch processes that end up invoking Oracle SQLPlus, is there a way to prevent SQL injection? For example: query.sql: select '&1' from dual; exit; If I call this script from SQLPlus thusly: $ ...

How can I issue a single command from the command line through sql plus?

Using SQL Plus, you can run a script with the "@" operator from the command line, as in: c:\>sqlplus username/password@databasename @"c:\my_script.sql" But is it possible to just run a single command with a similar syntax, without a whole separate script file? As in: c:\>sqlplus username/password@databasename @execute some_procedure...

How do I spool to a CSV formatted file using SQLPLUS?

I want to extract some queries to a CSV output format. Unfortunately, I can't use any fancy SQL client or any language to do it. I must use SQLPLUS. How do I do it? ...

Oracle Backup Database with sqlplus it's possible?

I need to do some structural changes to a database (alter tables, add new columns, change some rows etc) but I need to make sure that if something goes wrong i can rollback to initial state: All needed changes are inside a SQL script file. I don't have administrative access to database. I really need to ensure the backup is done on ser...

Is there a .Net interface to Oracle SQLPLUS?

Hi, I'm developing some automation to control the execution of SQL scripts. The scripts are run through SQLPLUS and contain PL/SQL calls in them (hence I can't run them through ODP.NET). I was wondering if there was a .NET interface to SQLPLUS? If so has anyone used it? Cheers Rich ...

Does SELECT DISTINCT imply a sort of the results

Does including DISTINCT in a SELECT query imply that the resulting set should be sorted? I don't think it does, but I'm looking for a an authoritative answer (web link). I've got a query like this: Select Distinct foo From Bar In oracle, the results are distinct but are not in sorted order. In Jet/MS-Access there seems to be some ...

How come sqlplus not connecting?

My goal is to connect to an Oracle 9i instance from my OS X machine. I've followed the setup instructions here and got through them with no errors (eventually). However, I'm finding that sqlplus is unable to connect: [ ethan@gir ~ ]$ sqlplus xxx/yyy@zzz SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 17 10:13:08 2009 Copyright (c...

Why doesn't ORACLE allow consecutive newline characters in commands?

I write: :CREATE TABLE Person ( :name CHAR(10), : :ssn INTEGER); and save it to a file "a.sql" (colon represents beginning of line, is not in actual code.) If I then run it by typing "@a" in the mysql command prompt, it will tell me that the line starting with "ssn" is not recognized as a command, and is ignored. From what I gathe...

Oracle, calling PL/SQL issues from within SQL-Plus file x.sql says my_function "may not be a function"

so simple, if I create my fuction as CREATE OR REPLACE FUNCTION MD5_ENCODE it will run smoothly, but if it satys anonymously within the SQL-Plus block as PL/SQL --> "may not be a function" error. what is this Oracle "feature" again??? many thx. in advance... DECLARE FUNCTION MD5_ENCODE(CLEARTEXT IN VARCHAR2) RETURN VARCHAR2 IS CHK ...

how to create batch file for sqlplus?

hi, i need to crate a batch file.(batch.bat) When we execte this bathch.bat file, 1)it will open sqlplus 2)it will call file1.sql file. file1.sql contains the creation and insertion scripts for a particular user. i am having file.sql file... so, what i need to know is.. how to Creat a batch file to perform this functions..?? Thanks i...

Oracle EX and SQL Plus: How to recover dump file?

I have .dmp and .log files. I need to recover the database schema and data using SQLPlus or some feature of EX. How do I do that? I've tried the RECOVER command and impdp. No luck, or I'm doing something wrong. ...

oracle sqlplus command line question

Is there a way to detect missing command line parameters from the oracle script for example my oracle script test.sql expects 3 parameters to run. my script is executed from the install program like this sqlplus /NOLOG @test.sql userid pw tablespace When one of the parameters is missing, the sqlplus prompting for the userinput. This can...

Importing 3954275 Insert statements into Oracle 10g

How do i import a script with 3954275 Lines of Insert Statements into a Oracle 10g. I can do it with sqlplus user/pass @ script.sql but this is dam slow (even worse the commit is at the end of this 900MB file. I dont know if my Oracle configuration can handle this). Is there a better (faster) way to import the Data? Btw. the DB is empty...

Cannot Connect with TOAD but Can with Other Tools/Apps

I am able to connect to an Oracle database using several tools, but am unable to connect using Toad for Oracle 8.5.3 (though before a login/logout to Windows I was able to). I am not using TNSNAMES.ORA to connect. I have two Oracle homes: C:\Oracle\product\10.2.0\client_1 (OraClient10g_home1) and C:\Oracle\product\10.2.0\client_...

How to get Oracle create table statement in SQL*Plus

I have a table that exists in an Oracle database, but doesn't show on my list of tables in the tool SQL Developer. However, if I go to SQL*Plus, and do a select table_name from user_tables; I get the table listed. If I type desc snp_clearinghouse; it shows me the fields. I'd like to get the create statement, because I need to a...

Output ordering in Oracle 10g

Helo, I am using oracle 10g and the output coming when SELECT command is in a zig zag format. How I can arrange coulumns in correct order? Is there any command? ...

Is it possible to BREAK ON a column in addition to the one specified in SQL*Plus?

This one's tough to explain, so I'll try to show what I'm after using examples. Please note that I'm not asking if it's possible to use multiple columns in a BREAK statement--I know that it is. Suppose I have a query like the following: SELECT invoice_no, invoice_date, vendor, account, amount FROM invoice ORDER BY vendor, invoice...

Help with SQLPLUS please? How to make SQLPLUS startup with DEFINE `OFF` initially?

I have a batch script that invokes PLSQL with connection details, which works fine but I still have to explicitly SET DEFINE OFF when I connect. I would like to enhance my simple batch script to pass the SET DEFINE OFF command to SQLPLUS so that once I am connected, I will no longer have to issue that command manually. echo set define o...

at which section set commands in oracle procedures can be used (declaration or executable)

at which section we can write the set cmds(i.e like set pagesize 250) in oracle procedures ...