PL/SQL :: How To Print SQL File Name In Same File Using Sqlplus

Jun 26, 2012

Oracle 10g on Linux platform.

I am trying to print the name of .sql script file in that file but could not. Following is the file:

test.sql
select '&0' from dual;But instead of printing, it is asking for input:
SQL> @test.sql
Enter value for 0:

how can i print the file name.

View 6 Replies


ADVERTISEMENT

Application Express :: How To Print File In Apex

May 26, 2013

I want to print a report using the apex, but it looks like you need to configure BI, Is there an easy way to print it online and not print the page, which is page report.

View 3 Replies View Related

Sqlplus Query Output Into File?

Feb 4, 2004

How can I put an Oracle sqlplus query output into file?

SQL> select myfield from userDB where IMSI like '22803%' and rownum < 11;

I would like to put the output in a file, say '/tmp/mydata.dat'

View 6 Replies View Related

SQLPlus Script To Run In Batch File

Nov 1, 2010

I am trying to create a batch file which will be executed with windows scheduled task. This batch file will have sqlplus script running Oracle query. I can run this query from the command prompt, no problem,

This is the sqlplus scipt to run query:
C:\Documents and Settings\testuser>sqlplus
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Nov 1 19:54:25 2010
Copyright © 1982, 2007, Oracle. All Rights Reserved.
Enter user-name: TEST1
Enter password:
Connected to:
Oracle Database 10g Release 10.2.0.4.0 - Production
TEST1@DB> spool testuserfile
here goes my query
TEST1@DB> spool off
TEST1@DB> exit
Disconnected from Oracle Database 10g Release 10.2.0.4.0 - Production
C:\Documents and Settings\testuser>

How do I put this in a batch file. I was able to figure how to logon, but I get stuck at the spool command. My batch file starts like this:

cd C:\Documents and Settings\testuser
sqlplus TEST1/Password

View 1 Replies View Related

Client Tools :: Conditionals In A SQLPlus Batch File?

Oct 23, 2012

From within a DOS batch file I make the following call:

sqlplus [User]/[password]@[server] @batch_script.sql [Server] [User]

Within the file batch_script.sql I have the following lines:

spool output_batch.lst
connect &&2/[password]@&&1;
@SomeOtherFile.sql

I want to change the last line to something like this:

if &&1 = 'Something' then
@SomeOtherFile1.sql
else
@SomeOtherFile2.sql
end if;

I get the following result

SQL> if &&1 = "something" then
SP2-0734: unknown command beginning "if &&1 = "..." - rest of line ignored.

I took a shot at using the "If" statement and missed.

View 12 Replies View Related

Pass Variables For UserID And Password To Sqlplus In Windows From Text File?

Jul 23, 2013

I would like to store user-id, password and the TNS-Entry in a small text file and pass them to a script to log in and execute another script on the database from Windows.

Example of the text file samp.txt that stores user info:

username=Jdoe
password=candybar
db_sid:orcl

main script main.bat is as follows:

--read the samp.txt do not know how to do it

sqlplus -s &username/&password@&db_sid @db_info.sql

db_info.sql contents:

column tm new_value file_time noprint
select to_char(sysdate, 'YYYYMMDD') tm from dual ;
spool C:\server\DB_Report_&file_time..log
select * from v$instance;
spool off;
exit

View 1 Replies View Related

Client Tools :: Display Clob Column In Text File In Sqlplus

Mar 30, 2012

I have extracted data from table and write into one text via sqlplus utility in shell scripts. i got correct output. i am having two issues on the output file

1) Outfile file size is huge high compare then table segment data.

2) last column having extra space.

The output column is clob datatype. so i have added set long 50000 and set longchunksize 50000 parameter. after adding these only i got above issues. without two options, i am not getting this isssue but lines are wrapped.

#Set the scripts Path
SCRIPTS_PATH="/usr/local/ccms/gpa/svr/scripts"
echo $SCRIPTS_PATH

[Code]....

View 2 Replies View Related

Forms :: Export Text File With Same File As Imported Text File?

May 30, 2011

Is it possible to get the same name of file name from imported text file?

What i've is, I import the text file then I exported it.

can I get the same name of the imported text file?

View 2 Replies View Related

Server Administration :: ORA-01111 / Name For Data File 636 Is Unknown - Rename To Correct File

Nov 3, 2012

i have two tablespaces dictionary managed (SYSTEM,APPLSYSX) i tried to change to locally cause it will cause problem in future when trying to run OATM migration.i did it successfully on APPLSYSX,when i did it on system upon oracle procedure.i have to change all tablespaces to read only when i did that with tablespace APPLSYSD(alter tablespace APPLSYSD read only) i received errors

SQL> alter tablespace APPLSYSD READ ONLY;
alter tablespace APPLSYSD READ ONLY
*
ERROR at line 1:
ORA-01230: cannot make read only - file 636 is offline
ORA-01111: name for data file 636 is unknown - rename to correct file
ORA-01110: data file 636: '/vol5u/oracle/prddb/9.2.0/dbs/MISSING00636'
i have not this file on the OS

View 1 Replies View Related

Precompilers, OCI & OCCI :: Compile PC File With Created Make File - No Explicit Type Given

Jan 22, 2008

I am trying to compile a .pc file with the make file which I created. But when I try to give make command I am getting following error

>make testfile
cc -o testfile testfile.c
"testfile.c", line 117: warning: no explicit type given
"testfile.c", line 119: warning: no explicit type given
"testfile.c", line 121: warning: no explicit type given
"testfile.c", line 122: warning: no explicit type given
"testfile.c", line 123: warning: no explicit type given
Undefined first referenced
symbol in file
sqlcxt testfile.o
ld: fatal: Symbol referencing errors. No output written to testfile

*** Error code 1
make: Fatal error: Command failed for target `testfile'

View 16 Replies View Related

Forms :: Getting Error When Cancel File Selection In File Open Dialogue

Mar 18, 2010

I have created the below stored procedure and calling the procedure in when-button-pressed trigger. Problem here is that when I cancel the file selection in file open dialogue box its raising exception.

PROCEDURE TEST
IS
buffer_lines client_text_io.file_type;
v_outputstr VARCHAR2 (32767);
p_delimiter VARCHAR2 (10) := '","';
v_transaction_no VARCHAR2 (10);
BEGIN
[code].......

View 3 Replies View Related

Backup & Recovery :: How To Link ASM File Alias And Database File Names

Nov 12, 2012

During a duplicate process to a new database name, rman crashed after the restore but before the switch datafile all.So now, we have under ASM the data files under the correct (new) diskgroup but v$datafile contains the previous names (and so diskgroup) and v$datafile_header is empty. RMAN is completly lost, our solution is to manually rename each file under SQL*Plus using ALTER DATABASE RENAME FILE. Unfortunately, we are using or migrating to OMF, so file names are meaningless and we are unable to associate ASM files with database files.

Any way (query or anything else) to associate the ASM files to the database files. Here's an abstract of what we have for one (small) tablespace:

ASMCMD [+ORAXQG1_L136_DG1/ORAXPG1/DATAFILE] > ls -l N47CAW*
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE NOV. 12 10:00:00 Y N47CAW1.276.799152039
DATAFILE UNPROT COARSE NOV. 12 10:00:00 Y N47CAW1.318.799151641
SQL> select file#, name from v$datafile where ts#=17
2 /
[code]...

View 11 Replies View Related

SQL & PL/SQL :: Combining Rows In Data File Based On Values In Control File?

Aug 29, 2013

I have to load data file into a table. And the requirement is as below:

Input Data:

1234|20130815|20130822|This is a test, this is the the part
3456|20130823|20130809|This is a test
3456|20130823|20130809|This is a test
3456|20130823|20130809|This is a test
3456|20130823|20130809|Siva 1234

The data should be inserted only in two rows as below:

When Value in first 3 fields is same, 4th field should be appended to the existing value in table.

1234|20130815|20130822|This is a test, this is the the part
3456|20130823|20130809|This is a testThis is a testThis is a testSiva 1234

View 3 Replies View Related

Reports & Discoverer :: REP-50127 / Cannot Write To File When Trying To Save A Report To A File

Sep 17, 2010

I am receive the REP-50127 error, cannot write to file when trying to save a report to a file on the network via report parameters.

I am guessing the rwserver does not have permissions to the network drive.

Will the SERVER_IN_PROCESS=NO run the rwserver process as the user executing the report?

View 1 Replies View Related

Application Express :: Link Local File With Browse File Dialog

Aug 15, 2012

I'm looking for a solution to hyperlink to a local file (i.e. C:/test.txt). I want that the user clicks on a "browse file" button like the file browse item. after the user selected a file or just a folder the path should be shown in a display only item. this item should be clickable...

Is it possible to create a "Browse file" dialog? I know that to link to a file is possible with some HTML tags in the "pre element text" and "post element text" fields. something like "<a href="... but I don't know how this works.

View 2 Replies View Related

Backup & Recovery :: ORACLE Dump File To Text File

Apr 9, 2011

Oracle10g to Sybase12.5 Migration:- How a Oracle dump file can be converted to any text file/xls file which will be loaded in sybase database later through BCP.

means
1.Exporting objects as dump file from Oracle.
2.Is there any tool/process available that can convert this into csv/txt/xls file.
3.This files can be loaded in sybase.

View 2 Replies View Related

Server Utilities :: Unable To Open File And 503 File Not Found

Mar 30, 2008

I am trying to have sqlldr running against a file:

C:oratest20080318

Is it possible I get SQL*Loader-500: Unable to open file and 503 file not found just because the file name does not have an extension?

I can see that any file name I try it looks after whateverFileName.dat! Is there a way to have sqlldr working with files that do not have extensions?

View 22 Replies View Related

Precompilers, OCI & OCCI :: Compiling C File (output Of PC File Precompialtion)?

May 4, 2010

after precompiling the cmpre.pc file, i got cmpre.c file. when i try compiling this .c file, am facing the following error...

servername:/.../home/usr/compile-> cc -g cmpre.c
ld: 0711-317 ERROR: Undefined symbol: .sqlorat
ld: 0711-317 ERROR: Undefined symbol: .sqlcxt
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

View 1 Replies View Related

Can Get Name Of File Loading Table In Control File

Feb 21, 2011

is there any way you can get the name of the file loading the table in a control file? i have a table with a column called source_file, and need to populate it during the load.

View 1 Replies View Related

JDeveloper, Java & XML :: Create XML File From XSD File?

Dec 14, 2010

get me an example where i create a XML file from a xsd file?

View 1 Replies View Related

Data Guard :: Db-file Name Convert And Log-file?

May 25, 2012

How to understand the two parameters db_file_name_convert and log_file_name_convert,if there are missing in the parameter file of standdy database,how does oracle will do?

View 3 Replies View Related

SQL & PL/SQL :: Take Input From File And Give Output To Other Txt File?

Oct 15, 2013

i need a script which can take input from a file and give output to other txt file, something like below :

input.txt

001
002
003
004

Query:

select name from employee where employeecode=<ENTRY FROM INPUT.TXT FILE>

Result should go to OUTPUT.TXT File.

View 7 Replies View Related

SQL & PL/SQL :: Print No Results If More Than 10 Records Else Print The Output

Mar 24, 2011

I have this SQL statement:

WITH data
AS (SELECT user_id,
jc_name,

[Code]....

I wish to do something like

if results > 10 print an error message (and no results)
if results < 10 print the results/output

View 1 Replies View Related

Execute Sql File From Pl / Sql?

Aug 18, 2010

Need to execute @/sql file after checking an output of below sql.

SELECT COUNT(*) FROM all_directories WHERE DIRECTORY_NAME='RMANDUMP';

If directory exist then oonly we require to run sql file.

If there a way we can execute sql files depending on sql output.

View 4 Replies View Related

What Exactly Redo Log File Contains

Oct 1, 2011

what exactly redo log file contains.? whether they contained the ddl or dml statements or more than that.........?

View 1 Replies View Related

SQL & PL/SQL :: Get Name File XML In Directories

Jun 16, 2011

I has a problem follow:

- I would get file name for Files in directories with format .xml, how do i do?
example:

- I has Files such as : abc.xml, test.xml, demo.xml, bb.txt, alias.txt in directories for path "/home/oracle/xml"; now is would get out file name with format *.xml. How do I do?

View 2 Replies View Related

SQL & PL/SQL :: Alternative To UTL FILE?

Jan 12, 2011

I have been told that I cannot use Oracle directory objects, external tables and the UTL_FILE package in my production environment for security reasons.

In this scenario what are the alternate options available in Oracle to write a file and save it in a specific location in the server. One of my requirement is to process a file and write the results of processing in a output file in the application server which in turn will be accessed by the online application.

View 7 Replies View Related

SQL & PL/SQL :: How To Get The File Name From Directory

Dec 12, 2012

How to get the file name from directory without Java. Is there any way to do it in Pl/Sql.

View 13 Replies View Related

SQL & PL/SQL :: MDB File Trigger

Jul 22, 2009

I have created a link of *.mdb (Microsoft Access File) with oracle 9i database with ODBC connectivity.

Problem is i can not track any changes made in *.mdb file table. Is their any option to track any changes like insertion, updation or deletion made in *.mdb file table.

View 3 Replies View Related

SQL & PL/SQL :: Create TSV File?

Dec 4, 2012

As per project requirement, we need to create tab seeprated file for a table. This table contain around 1000000 records.I have written below sql

set pagesize 10000
set feedback OFF
set serveroutput on
set heading OFF
spool D:OfficeworkDatabase_maintainceMATRIX.txt

[code]...

This query is taking more than 6 hours.if there any other way how can we create tab separated file. Or we can export the entire table in tab separated file format.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved