Windows :: Create BAT File With Query To Run A Package

Dec 14, 2010

I need to create a bat file which include a query to run a package. I use plsql developer to develop the package. its username,password and database is user,pswd,db1 respectively. the query to run the package is "SELECT

COLUMN1 AS "LAST NAME",
COLUMN2 AS "FIRST NAME",
COLUMN3 AS "LOCATION"

FROM TABLE(PKG.GET_SUM('09-NOV-2010','12-NOV-2010')) "

what code should I write to create a bat file.

View 13 Replies


ADVERTISEMENT

To Use UTL_FILE Package To Create OS File

Apr 26, 2013

I want to use UTL_FILE package to create OS file. How to resolve this error. Oracle11g under XP.

SQL> create directory my_dir as 'c: emp';

Directory created.

1 create or replace procedure test_1(md in varchar2)
2 is
3 file utl_file.file_type;
4 begin
5 file := utl_file.fopen(md,'abc.log','w');
6 utl_file.put_line(file,'EMPLOYE REPORT');
7 utl_file.fclose(file);
8* end;
SQL> /

Procedure created.

SQL> execute test_1('MY_DIR');
BEGIN test_1('MY_DIR'); END;

RROR at line 1:
RA-06510: PL/SQL: unhandled user-defined exception
RA-06512: at "SYS.UTL_FILE", line 98
RA-06512: at "SYS.UTL_FILE", line 157
RA-06512: at "SCOTT.TEST_1", line 5
RA-06512: at line 1

View 2 Replies View Related

Reports & Discoverer :: REP-0118 / Unable To Create A Temporary File In Windows 7

Mar 14, 2012

While Running a Report through form i am getting this below error.

REP-0118 Unable to create a temporary file

But while running the same report in a windows 98 or windowsXp PC i dont get this error.

View 1 Replies View Related

SQL & PL/SQL :: Oracle 11g / Windows 8 - Common Code In Package

Sep 13, 2013

In oracle 11g windows8 - OS

Suppose, there is a package p1 with proc A, Proc B and Func C.Now when any of the package proc or func gets invoked from a stored proc G then a common code which reads the cols of table xyz should be executed. How to do that?

View 8 Replies View Related

SQL & PL/SQL :: Unable To Create DB Package?

Mar 1, 2012

I´m having a trouble creating a db package. I´ve changed my job and now i´m working full on DB instead of Forms Developer.

So my trouble is that i want to create some like a global cursor on DB package, i know you can create global variables and use it on all the procedures/function inside the package. But how about cursors?

My problem: I dont´know how to declare into the spec. I don´t know how to use it on body.

My actual

I have the structure below:

PackageSpec:
CREATE OR REPLACE PACKAGE [i]MyPackageName[/i]
IS
CURSOR [i]myGlobalCursor[/i](par1 IN VARCHAR2, par2 IN DATE)(
);
PROCEDURE [i]MyProcedure1[/i](par1 IN VARCHAR2, par2 VARCHAR2);

[code]....

View 13 Replies View Related

PL/SQL :: How To Create A Package With Procedures

Aug 15, 2013

By referring through net I have written the following PCK file. I have installed my Oracle 11g database in VirtualBox(Win XP). I can able to select the tables using query from the host(Windows 7) 

CREATE OR REPLACE PACKAGE APEX_SYS_PCK  AS    TYPE refcursortype IS REF cursor  PROCEDURE GET_USER_DETAILS(  D1 OUT refcursortype,  P_USER IN VARCHAR2,  P_PASS IN VARCHAR2);END APEX_SYS_PCK; / CREATE OR REPLACE PACKAGE BODY APEX_SYS_PCKAS PROCEDURE GET_USER_DETAILS(  D1 OUT refcursortype,  P_USER IN VARCHAR2,  P_PASS IN VARCHAR2) IS BEGIN   OPEN D1 FOR SELECT * FROM APEX.PERSONS; END GET_USER_DETAILS;  END APEX_SYS_PCK;/

 When I try to run the script I am getting the following error. How to solve this problem?

Project: sqldev.temp:/IdeConnections%23vAPEX.jprF:PACKAGESAPEX_SYS_PCK.sqlError: PL/SQL: Compilation unit analysis terminatedError(1,14): PLS-00905: object APEX.APEX_SYS_PCK is invalidError(1,14): PLS-00304: cannot compile body of 'APEX_SYS_PCK' without its specification

View 9 Replies View Related

SQL & PL/SQL :: Create Pipeline Function In Package

Feb 13, 2013

Can we create a Pipelined function in A Package ? I know we can create it standalone function.

View 11 Replies View Related

SQL & PL/SQL :: Renaming A File From Package?

Sep 20, 2011

I have another question to ask on packages..

I have a dictionary under the schema

OWNERSYS
DIRECTORY_NAMEUTL
DIRECTORY_PATHc:oracleoradataspmap1utl

I have cretaed an external table to read data to a table from a csv file placed in "c:oracleoradataspmap1utl". The csv file name is say "pildata.csv"

I have cretaed a package to read data from the exteranl table and to insert it into a table.

INSERT INTO M_PILEINT SELECT
A.AREA AS "AREA",
A.SUB_FAC_DESC AS "SUB_FAC_DESC",
A.SCOPE_DETAIL AS "SCOPE_DETAIL",
A.MTO_ISSUE_DATE AS "MTO_ISSUE_DATE",
A.MTO_TAKE_BY AS "MTO_TAKE_BY",
A.COMMODITY_CODE AS "SECTION"
A.PILE_NAME AS "PILE_NAME"
FROM M_EXE_PILE A

(where M_EXE_PILE A is the external table which is reading from pildata.csv)

The package runs good and data is populated to M_PILEINT .Is there a way , I can rename the csv file (say to pildata_logxxxx.csv.. something like that) from within the package.Whenever the package is run , it will copy the data from exteranl table and renames the csv file to something else..?

View 7 Replies View Related

SQL & PL/SQL :: Create Or Replace - Package Body Created With Compilation Errors

Mar 8, 2012

CREATE OR REPLACE PACKAGE pkg_mkt_hub_load_collection
AS
PROCEDURE sp_final_load_mkt_hub;
END pkg_mkt_hub_load_collection;
/
CREATE OR REPLACE PACKAGE BODY pkg_mkt_hub_load_collection
AS
c_default_limit CONSTANT PLS_INTEGER:=5000;

[code]....

show error

error code

SQL> @pkg_mkt_hub_load_collection.sql
Package created.
Warning: Package Body created with compilation errors.
Errors for PACKAGE BODY PKG_MKT_HUB_LOAD_COLLECTION:
LINE/COL ERROR
-------- -----------------------------------------------------------------
57/4 PL/SQL: Statement ignored
PLS-00306: wrong number or types of arguments in call to 'MULTISET_INTERSECT_ALL'
SQL>

View 11 Replies View Related

SQL & PL/SQL :: Difference Between Include Program Header Before CREATE OR REPLACE PACKAGE Statement

Mar 2, 2010

Is there any difference between include program header before CREATE OR REPLACE PACKAGE statement and program header after CREATE OR REPLACE PACKAGE statement

View 4 Replies View Related

SQL & PL/SQL :: Attach External File Using UTL_SMTP Package?

Feb 7, 2012

I want to attache an external file to a email using UTL_SMTP package.

A file which attach will be present in directory.

View 3 Replies View Related

SQL & PL/SQL :: Read Excel File Using UTL_FILE Package

Jul 23, 2010

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

Is there a way to read Excel file using UTL_FILE package ?

Like our usual method:
l_utlfile := utl_file.fopen(p_dir, p_filename, 'R',2000);
p_filename is event.xls

Or do we need to convert that file to .csv or .txt ?

View 5 Replies View Related

SQL & PL/SQL :: Load Xml File Into Table Using Dbms_xslprocessor.read2clob Package?

Jul 24, 2013

I'm trying to load xml file into table using dbms_xslprocessor.read2clob package, it loads for small file, but it throws READ ERROR for big file. I have given READ, WRITE permission on directory and also DBA role to user. Also I have attached file (change file extension to xml)

check below given code.

CREATE TABLE loadxmlfile (xmldata CLOB);
CREATE TABLE loadxml (id NUMBER, xmldata XMLTYPE);
create or replace PROCEDURE load_xmlfile

[Code]...

Note: Reason I'm doing is to remove NON BREAKING SPACE (NBS) character from xml file

View 6 Replies View Related

SQL & PL/SQL :: Export Table Data Into Text File Through Procedure / Package

Oct 8, 2012

I want to get all the column values in a table and save them into a text file.Beside UTL_FILE, is there any other method which will result better performance in writing to text file?

noted that the data does exist 32k.

View 39 Replies View Related

Forms :: DDE Package - How To Close Excel File Without Saving Changes / Messages

Nov 19, 2009

I need to rescue some valors from Excel, and then close the excel file without saving changes and without messages.

I am using THe DDE package and when using

DDE.EXECUTE(convid, '[Save()]', 10000);

there is no problem, but the changes are saved. I have tried '[Exit()]' and '[Close()]' but always have error message ORA-106555. Is there any way of doing this without errors?

View 11 Replies View Related

SQL & PL/SQL :: How To Reference Constants Declared In Package From Adhoc Query

Oct 25, 2010

We have a package that contains mostly constants like:

c_flag_true CONSTANT CHAR(1) := 'Y'

When I try to reference it in these constants in an adhoc query it doesn't work:

SQL> select * from FINANCIAL_BATCH_STATUS_HISTORY where active_flag = constants_pkg.c_flag_true;
select * from FINANCIAL_BATCH_STATUS_HISTORY where active_flag = constants_pkg.c_flag_true
ORA-06553: PLS-221: 'C_FLAG_TRUE' is not a procedure or is undefined

Is there a simple solution to make the reference work?

View 4 Replies View Related

SQL & PL/SQL :: Create View From Dynamic Query (or Function Returning Query)

Dec 5, 2012

I have a dynamic query stored in a function that returns a customized SQL statement depending on the environment it is running in. I would like to create a Materialized View that uses this dynamic query.

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

Windows :: How To Create Cmd Script For Ora Statistics

Aug 9, 2011

I need to do a cmd script for launching oracle statistics every week and scheduling it from task scheduler of my server with win 2008 R2 O.S.

the script is:

"statistiche-oracle.bat"

set ORACLE_SID=GW1
sqlplus "/ as sysdba" @statistiche.sql

and "statistiche.sql" is:

exec dbms_stats.gather_schema_stats(ownname => 'PDMUSER', cascade=>true)
exit

When I launch it from command line it stops with error message: "insufficient privileges" and ask me the user, so I put 'PDMUSER' that is my user, it asks also pwd, I put it and the works.

View 3 Replies View Related

Windows :: How To Create Database And Table

Dec 9, 2011

How to create db in oracle 11g and make some table in that from the web page 'database control' ?

View 11 Replies View Related

Unable To Create Database On Windows 7

Apr 3, 2013

I installed Oracle 10g XE on windows7 to create a database i opened "start database command interface" and created an SID and followed some steps afterwards i am facing "TNS ADAPTER NOT FOUND"

View 7 Replies View Related

Windows :: Installation Process Trying To Create Database On System

Dec 7, 2010

I'm trying to install Oracle10g in win7 Home premium. It is installing but problem is when installation process trying to create database on the system, a message is appearing which telling that ORA-12546:TNS:permission denied.

View 1 Replies View Related

Windows :: Create ASM Disk Did Not Recognize Unallocated Partition

Jan 21, 2012

This is the first time I've got a job in Windows platform, I've worked as DBA with Unix/Linux still now.

I received one command: Install Oracle 11gR2 on Windows 7 Enterprise, so that, I plan to create one Partition (really, not mounted, this is Unallocated partition by Partition Magic 3rd software) which will contain datafile in it.

And, when I install 11gR2 Grid, the step ASM creation did not recognize the Unallocated Partition I created.

View 3 Replies View Related

Unable To Create Database (Oracle 12c R1 12.1.0.1.0 / Windows 2012 )

Aug 30, 2013

I have been trying out the new 12c on Windows 2012 Essentials with the same type of errors.  The OraDim step fails and cannot create the services.  It fails a bit differently if I choose "Create New Windows User", choose a "Use Existing Windows User", or choose the Windows Built-in user. 

View 3 Replies View Related

Forms :: Unable To Create Object For Excel 2007 / Windows 7?

Aug 11, 2010

The below Oracle Forms code works fine for Excel 2003/Windows XP/IE6 but doesn't work for Excel 2007/Windows 7/IE8.

*********************
application := Client_OLE2.CREATE_OBJ('Excel.Application');

Client_OLE2.SET_PROPERTY(application,'Visible','TRUE');

workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');

args1 := Client_OLE2.create_arglist;
************************

There is no error while executing the form, by debugging we found that the control skips all the above code.

I'm using Oracle forms 10.1.2.3 and jre 1.6.0_16.

View 3 Replies View Related

How To Create Central Inventory For Oracle 11g Running On Windows Server

Dec 26, 2012

--- Current Oracle Inventory pointing to the location of C:program FilesOracleInventory.

We are plannig to creat a central inventory for all Oralcle installations into to C:oraagentorainventory.

View 3 Replies View Related

Windows :: PL/SQL With Batch File

Aug 17, 2012

I am executing multiple PL/SQL files(.sql) with single batch file. The batch file sql.bat has got 3 sub sql sub-tasks to complete once its run. The sql.bat is show below

@Echo off

CD C:Report
echo Loadin tables from text file Report.txt
sqlplus security/password <c:Reportloader_security.sql
echo Creating Security table
sqlplus security/password <c:Reportcreating_security_final.sql
echo Inserting text file Security table
sqlplus security/password <c:Reportinsert_security_final.sql

PAUSE

The sql.bat runs perfectly if I double click on the sql.bat file separately. But if I call the sql.bat from a different batch file 'Final.bat' it throws the below error.

Error
-----------
Executing SQL commands and loading file into SQL tables
Loadin tables from text file Report.txt
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[code].....

The Final.bat file calls other bat files too. It is as show below.

CD C:ReportSecurity
echo Merging all Files
CALL merge.bat

CD C:ReportSecurity
echo Deleting old files
CALL del.bat

CD C:ReportSecurity
echo Executing SQL commands and loading file into SQL tables
CALL sql.bat

View 11 Replies View Related

PL/SQL :: Find Out In Database Package Where Package Is Installed

May 28, 2013

I need to find out in DB Package where this Package is installed (in which schema). The problem is this DB Package can be installed in various schemas. This means that I can't use select user from dual or system environment SYS_CONTEXT('USERENV', 'OS_USER').

What I would need is something like $$PLSQL_UNIT

View 8 Replies View Related

Mobile Server :: Oracle Lite - Can Be Used To Create Offline Windows (net) Applications?

Jul 31, 2012

I am exploring the options for file based databases for offline applications where there are no overheads of database installations. We have a system which has Oracle database with more than 500 tables. We need to write a lightweight application (offline) in .net which will run from USB drive and write data to USB drive only.

Existing system has a data layer which writes data to Oracle 10g Enterprise Edition database. The offline application will have more or less similar data entry forms and storage structure. In order to reuse data layer of existing system (stored procedures) can the Oracle Lite be used as a database which can run from USB drive?

I understand Oracle Lite has a suport for synchronization with the server (our main database in this case) by which data can be synchronized with minimum overheads. How the Oracle Lite is licenced if I have 300 odd users of this offline applications. I need to use only database part of Oracle Lite and not mobile server.

View 6 Replies View Related

Windows :: Export With Dynamic File Name?

Aug 19, 2010

I want to know how export oracle tables with dynamic file name which contains (system date and database name) on windows XP platform.

View 5 Replies View Related







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