Perform SELECT INTO In SQLPlus Script

Apr 11, 2007

I'm trying to perform a SELECT INTO in a SQL*Plus script.the script i'm working towards to, looks something like this;

set term on
set echo off
set serveroutput off
set verify off
ACCEPT ReportName PROMPT 'Please enter a report name; '
PROMPT
PROMPT retrieving current settings for &ReportName:
select STARTDATE, ENDDATE, SUFFIX
into pStart, pEnd, pSuffix
from MyTable
where NAME = '&ReportName';
[code]....

I'm basically trying to perform a select into based in user input and then put the retrieved data back to the console with a prompt. Is this possible within a sql script running on SQL*Plus?

View 3 Replies


ADVERTISEMENT

PL/SQL :: Perform DML Or DDL When Select Query Is In Progress?

Aug 27, 2012

Is it possible to perform a DML or DDL when a select query is in progress?

View 8 Replies View Related

SQLPLUS Select Statement To Get Last Failed Time From Each User

Aug 13, 2010

I'm new to the sqlplus,

User ID Failed_timestamp
----------------------------------
userA 20100801 11:22:33
userB 20100802 11:22:33
userA 20100802 12:22:44
userA 20100803 13:34:55
userC 20100803 20:21:23
userB 20100804 16:34:56

I wanna to get the last failed time from each user. what is the select statement?

my expected result will be:

userA 20100803 13:34:55
userB 20100804 16:34:56
userC 20100803 20:21:23

View 3 Replies View Related

SQL & PL/SQL :: Perform Math Calculation Upon Dates?

Feb 9, 2011

I got 4 fields:

event_date (01/01/1900 hh:mm:ss)
team_count (number)
interview_count (number)
duration (01/01/1900 hh:mm:ss) - duration of each interview

The calculation is:

(interview_count * team_count * duration(hh:mm)) + event_date
i.e.:
(3 * 2 * 02:30) + 01/01/1900 08:00:00
= 15:00:00 + 01/01/1900 08:00:00
= 01/01/1900 23:00:00.

all I care about is the hh:mm in the result.How can I preform this calculation in pl/sql?

View 7 Replies View Related

SQL & PL/SQL :: Perform SUM On Two Columns Based On Level?

Oct 21, 2011

Below is the code that i tried to perform the sum operation.

CREATE TABLE TEST11
(
FISCAL_TIME_ID NUMBER,
data_id number,
M_VALUE NUMBER,
Y_VALUE NUMBER
);

[code].....

The result I got is

SQL> SELECT FISCAL_TIME_ID, DATA_ID, M_VALUE,
2 SUM(m_value) OVER (PARTITION BY fiscal_time_id, data_id
3 ORDER BY FISCAL_TIME_ID) AS YTD_VALUE
4 from test11;

[code].....

But what I am actually want to get is.

FISCAL_TIME_ID DATA_ID M_VALUE YTD_VALUE
-------------- ---------- ---------- ----------
20110500 3 2 2
20110700 3 50 52
20110800 3 52
20111000 3 250 352
20111100 3 300 652

That is, the YTD_Value column is nothing but sum of M_VALUE column + previous fiscal_month_id's ytd_value column.

Test case:

The YTD_VALUE for fiscal_time_id 20110700 is obtained as current M_VALUE + previous fiscal_time_id's ytd_value => 50 + 2

I tried with the SQL but i could not get the result.

View 5 Replies View Related

To Perform A Reorganization Of The Partition Table

May 6, 2010

I would like to perform a reorganization of the partition table. The table contains 144 partitions and 2038 indexes partitions with that. I would like to ask you to make me understand the best possible way to perform the reorg with cascade options in one attempt.

Also, am not sure how to get the information of the index type is Globally / Local index partition. Is there any document for reference that details about the reorg of partition tables?

View 7 Replies View Related

SQL & PL/SQL :: ORA-14551 - Cannot Perform DML Operation Inside Query

Dec 9, 2010

Attempted to execute the Procs below with

Select OTMP_TCIS_RS.Get_UserInfo('EN') from dual; but i get the following error:
ORA-14551: cannot perform a DML operation inside a query.

The intention of the code is to perform an insert into my table based on passing in values via an object into Stored Procedure Apply_Users_Update

Package Definition
create or replace
PACKAGE OTMP_TCIS_RS AS
--1 PROCEDURE Get_UserInfo
PROCEDURE Get_UserInfo(
o_OutCode OUT INT,
i_language IN VARCHAR2);
FUNCTION Get_UserInfo(
i_language IN VARCHAR2)
RETURN NUMBER;
[code]....

View 5 Replies View Related

Server Administration :: How To Perform Database Refresh

Mar 3, 2012

How to perform db refresh.

View 1 Replies View Related

Forms :: WEBUTIL_C_API Perform Functions Of A DLL Coupon

Aug 16, 2011

I'm using WEBUTIL_C_API, to perform functions of a DLL coupon issuer and I try to tax problems.

problems:
1) performs the function and the application closes. The code that does this is below:
FUNCTION FUN_REDUCAO_Z (impressora varchar2) RETURN pls_integer IS
DLL_FUNCAO webutil_c_api.FunctionHandle;
lv_plist webutil_c_api.ParameterList;
param1 webutil_c_api.ParameterHandle;
ret PLS_INTEGER:=0;
BEGIN
[code]....

I am running these functions in the web client.

View 4 Replies View Related

Forms :: How To Perform Search Detail Block

Dec 26, 2011

I have detail block in my form and i need to give option to user to search item in that block.

For example I display 100 items from item master and user need to search particular item by either code or name.

View 6 Replies View Related

PL/SQL :: How To Perform A Pattern Check - Regular Expression

Oct 16, 2012

Is there a way to perform a pattern check on a value ?

For example: 654321HD9

The pattern is 6 numbers, followed by 2 letters, followed by 1 number. The data type for the attribute is a string.

Examples of right or wrong
654321HD9 - correct value
654321HD - wrong value
654321111 - wrong value
HD1111111 - wong value

The pattern has to be as i mentioned above (6 number, 2 letters, 1 number) otherwise its wrong. My pattern does not cover all cases.

select REGEXP_SUBSTR('654321HD9', '[0-9]+[A-Za-z]+[0-9]+') from dual;

View 6 Replies View Related

Perform Regular Updates On Several Oracle Tables

Sep 26, 2012

I am attempting to perform regular updates on several Oracle tables. The scripts performing the updates are scheduled to run every two minutes, get a value and update the table with that value.

The value doesn't always change but the scripts will still attempt to perform an update.

The same script is part of 7 objects, all of them are scheduled to run at the same time. They update the same table but never the same row.Even though the script is mostly the same on the 7 objects, they run completely independently of each other. The first object will usually perform the update without any problems but when it comes to the second object the script will time out.

View 9 Replies View Related

Data Guard :: Unable To Perform A Switchover

Nov 2, 2013

I have a dataguard configuration (physical standby).Database A is the primary database and database B is the standby database (I do not use the broker).Both are Oracle RDBMS 12cR1 EE. The Apply process uses the current log (standby redo logs).On database B, when querying v$managed_ standby;, I get:           

ClientProcess    process    Status  ---------- ARCH       ARCH       CONNECTED          ARCH       ARCH       CONNECTED          ARCH       ARCH       CONNECTED          ARCH       ARCH       CONNECTED          RFS        ARCH       IDLE               MRP0       N/A        APPLYING_LOG       RFS        LGWR       IDLE                

It works fine.   Before to perform a switchover,- from database A (current physical database), I get switchover_status = 'TO STANDBY'- from database B (current standby database). I get switchover_status = 'NOT ALLOWED'. What switchover_status = 'NOT ALLOWED' means exactly and how to get further with the switchover? 

View 2 Replies View Related

Perform Operation With Case Function - Getting Error?

Apr 3, 2012

I want to perform some operation with case statement. But I am confusing with ora 00932 error. My question is what data type should I use while performing case function?

SQL> select * from samp;

NAME EMPID SALARY DEPT
---
sony 10680 8200 sap
bala 10708 4300 .net
sam 10600 9000 oracle
chris 10655 5500 java
rose 10487 8700 oracle

[code]....

My big question is

different datatypes, then use consistent datatypes. For example, convert the character field to a numeric field with the TO_NUMBER function before adding it to the date field. Functions may not be used with long fields.

// just I am trying to perform basic operation. why oracle didn't support?

View 1 Replies View Related

RMAN - Perform TSPITR On Newly Created Tablespace?

Mar 7, 2011

I am attempting to perform a TSPITR on a newly created tablespace. The error indicates that the tablespace is not in the recovery catalog in which case it is. The database is Oracle 11g on Win2k8 64bit enterprise edition.

List of Datafiles in backup set 52
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 3959509 06-MAR-11 +DATA/orcl/datafile/system.257.742678049
2 Full 3959509 06-MAR-11 +DATA/orcl/datafile/sysaux.258.742678049

[code]...

View 4 Replies View Related

Server Administration :: ORA-38301 / Cannot Perform DDL / DML Over Objects In Recycle Bin

Aug 3, 2012

I am getting the following errors when I try drop a tablespace.

I already did the following.

a) The tablespace & its datafiles offline.

b) I have purged dba_recyclebin.

SQL> drop tablespace db_maintenance including contents and datafiles;
drop tablespace db_maintenance including contents and datafiles
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-38301: can not perform DDL/DML over objects in Recycle Bin

View 14 Replies View Related

SQL & PL/SQL :: Remote Database - Cannot Perform DML Operation Inside A Query

Jun 16, 2010

I have a function declared as PRAGMA AUTONOMOUS_TRANSACTION.

If i execute this function everything is fine.

If I call this function from a remote database, I have this error message:

"ORA-14551: cannot perform a DML operation inside a query".

select function('parameter') from dual;

Result: "OK"

select function@dblink1('parameter') from dual;

Result: "ORA-14551: cannot perform a DML operation inside a query"

View 14 Replies View Related

Forms :: FRM-40505 / Unable To Perform Query Error

May 13, 2010

I am getting the same error on a form I am setting up under version 10.1.2 Form Builder. But when I press Shift-F1 I get a Getting Started with Internet Explorer popup. I am running the form under OAS. I have a parent/child relationship between 2 tables that I query on the form.

A copy of the fmb file is attached to access it.

View 11 Replies View Related

SQL & PL/SQL :: Verify And Perform Validations On Data - Table Partition

Oct 11, 2010

I have a staging table with 70 million rows and nearly 90 columns. We just want to verify and perform some validations on the data and then move this data to final tables. There staging table has a primary key in it.

We are planning to create the final table in following ways.

1. Create n number of final tables.
2. Create n number of final tables with partitions based on the primary key value in staging table.
3. Create single final table with partition based on the primary key value staging table.

View 2 Replies View Related

SQL & PL/SQL :: Function Batch - Cannot Perform DML Operation Inside A Query

Oct 8, 2013

Am calling the Function Batch to insert an update statemtnt into Batch_statement table in the DOWNLOAD_FUNC .But its failing with the error

SQL Error : ORA-14551: cannot perform a DML operation inside a query

Below Is the

FUNCTION BATCH(numTABLE_ID IN NUMBER, varSTMT IN VARCHAR2) RETURN NUMBER IS
BEGIN
INSERT INTO BATCH_STATEMENT(QUEUE_ID,TABLE_ID,STATEMENT,QUEUE_SEQUENCE_ID)
VALUES (numQUEUE_ID,numTABLE_ID,varSTMT,1);
RETURN 1;

[code].....

View 27 Replies View Related

SQL & PL/SQL :: Possible To Perform Any Operation Using Oracle Like Addition And Division In CSV File

Dec 2, 2010

Is it possible to perform any operation using oracle like addition and division in csv file before loading data in oracle. and after the operation changes must save.

Is it possible or not.

View 2 Replies View Related

Server Utilities :: Perform Impdp Command For Specific Function?

Jun 26, 2013

Below is my import command for importing specific function from export file but iam getting below errors

impdp system/PASSWORD schemas=TNC6 directory=dumpdir dumpfile=FULL01-02-2011.dmp logfile=IMP.log include=FUNCTION:"IN ('TNC_IS_NUMBER')"

ORA-39001: invalid argument value
ORA-39071: Value for INCLUDE is badly formed.
ORA-00936: missing expression

View 4 Replies View Related

Backup & Recovery :: Perform TSPITR Of Tablespace To Recover It To A Time

Apr 5, 2011

Imagine this situation
Current time :05 Apr 2011

I have to perform the TSPITR of a tablespace to recover it to a time 03-apr-2011 5 pm.Now I have done that.

Now I find that I need to actually recover it ti 04-apr-2011.Can I again recover the tablespace to 04-Apr after recovering it to 03-Apr by mistake I am not usng recovery catalog;

View 13 Replies View Related

Recovery Manager (RMAN) :: Perform Active Database Duplication?

Sep 11, 2012

I like to duplicate the database DATABASEA to DATABASEB and need to be run in same server. I tried to bounce the listener & databaseb instance multiple times but no lucky.

Step 1 : The instance DATABASEB is in Nomount stage

Step 2 :

==> tnsping DATABASEB
TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 11-SEP-2012 07:36:54
Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = client )(PORT = 1521)) (CONNECT_DATA = ( SERVER = DEDICATED) (SERVICE_NAME = DATABASEB)(UR=A)))
OK (10 msec)

Step 3 :

==> rman target sys/*****@DATABASEA auxiliary sys/********@DATABASEB
Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 11 07:37:50 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DATABASEA (DBID=1723462779)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

[code]...

View 9 Replies View Related

Export/Import/SQL Loader :: Perform Full Exp / Imp Of Oracle 11g Database?

Jul 30, 2012

i want to perform full export + import of an oracle 11g database as fast as possible. i was thinking to perform the exp+imp on the same command.in exp i can perform something like this :

mknod /oracle/migration/exp_pipe p

exp '/ AS SYSDBA' file= /oracle/migration/exp_pipe full=y | imp system/***@oracle_db file= /oracle/migration/exp_pipe full=y

i know that i can do both action in impdp when using a dblink, but the problem is that some objects in the database cannot be copied via a dblink. the question is if there's a corresponding datapump command to the old exp+imp command i presented.

View 5 Replies View Related

SQL & PL/SQL :: Call Function Generates ORA-14551 /cannot Perform A DML Operation Inside Query

Aug 9, 2011

Calling function

select PACK.MAIN('blah') from dual

generates:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 756
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 245

Unfortunately the Body is not accessible to see.The spec of the function is:

FUNCTION MAIN (mvar IN varchar2) RETURN varchar2; I read somewhere that I can call it like:

var myVar VARCHAR2; call PACK.MAIN('blah') into :myVar

But this generates: ORA-01008: not all variables bound

View 3 Replies View Related

Export/Import/SQL Loader :: Can Impdp Perform Checks To See If Dumps Are Valid

Jul 20, 2012

i'm writing a job to export data on a weekly basis and archive those data in-case needed to be re-imported in future, its important that we able to import successfully if ever needed.

can impdp perform checks to see if dumps are valid ?how about old imp?if not, will it be safe enough to rely on the export log file? in another word is it safe to assume its all safe if there is no error or warning in the exp log?

View 7 Replies View Related

Backup & Recovery :: RMAN - Control File Be Used To Store Scripts Which Are Used To Perform Backups?

May 12, 2011

Can the control file be used to store scripts which are used to perform backups? I know the RMAN recovery catalog can.

Does the SHOW command display detailed reporting on the RMAN catalog contents other than configuration information?

View 1 Replies View Related

Server Utilities :: What Privileges Are Required To Perform Only Schema Level Export And Import

Feb 20, 2012

Quote:The EXP_FULL_DATABASE and IMP_FULL_DATABASE, respectively, are needed to perform a full export and import.

what privileges are required to perform only schema level export and import?

View 3 Replies View Related

Data Guard :: Right Steps To Perform Failover In Case Primary Database Gets Fail

Jan 10, 2011

i have Oracle 10g data guard set up on windows environment.....i need to know the what are the right steps to perform failover in case the primary database gets fail.

View 4 Replies View Related







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