SQL & PL/SQL :: How To Use DEFINE Command

Jun 5, 2012

set serveroutput on
set verify off
declare
define t1='111';
begin
dbms_output.put_line(t1);
end;
/
define t1='111';
*
ERROR at line 2:
ORA-06550: line 2, column 10:
PLS-00103: Encountered the symbol "=" when expecting one of the following:

:= . ( @ % ; not null range default character

The symbol ":= was inserted before "=" to continue.

View 5 Replies


ADVERTISEMENT

Client Tools :: How To Define ED Command In Sqlplus

Jul 25, 2012

In my sql*plus when i am writing the command ed .It was showing the error as \

SQL> ed
SP2-0110: Cannot create save file "afiedt.buf"

i tried to define the editor by using the command define_editor=notepad;

But still my problem was not solved.

View 2 Replies View Related

PL/SQL :: Bind And Define Variable

Apr 2, 2013

What is the difference between these two variables and their usage?

View 6 Replies View Related

SQL & PL/SQL :: Define A Cursor Using Dynamic Query?

Aug 29, 2010

Is it possible to define a cursor using dynamic sql. Reason being is, I want to fetch data from 4 diffrent tables but dont want 4 diffrent cursors for this purpose.

I have a procedure that takes an in parameter . Cursor is declared in this procedure. Again is there a way to use dynamic sql so that this cursor declared in procedure uses all 4 table one at a time i.e cursor c1 is select * from table_name(I want this table name to be updated every time with new table name).

View 5 Replies View Related

Forms :: Define Global Variable In Oracle 6i

Aug 12, 2010

I want to define global variable in oracle form 6i....so this variable may i used anywhere in project...but i don't know where exactly global variable defined?

View 7 Replies View Related

SQL & PL/SQL :: Declare A User Define Exception Name As Per Defined Name?

Jan 25, 2011

Can we able to declare a user define exception name as per defined exception name?Ex: we have predefined exception called :"NO_DATA_FOUND "

Now in my PL/SQL block can i able to declare "NO_DATA_FOUND" like

Begin
no_data_found exception;
//statements
raise no_data_found;
end

View 6 Replies View Related

RAC & Failsafe :: Define DB Connection URL For Two Different SID Names In Single URL?

Apr 3, 2012

As you see in the following MY_DB_URL there are two hosts for one SID. This is works perfectly for oracle driver. When one of them is gone down, connection establishes with the other.

MY_DB_URL = jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.104.18)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.104.19)(PORT= 1521))(FAILOVER=true)(LOAD_BALANCE=false)(CONNECT_DATA=(SERVER=DEDICATED)(SID=SIDNAME_1)))

But i have a problem. Our partner uses Golden Gate product, and they said that they must install two different oracle with two different SID names. (For Example one of them is SIDNAME_1 the other is SIDNAME_2) So i can't use this URL in my application.

Is there a way to define a DB connection URL for two different SID names in a single URL?

View 1 Replies View Related

SQL & PL/SQL :: Can Use User Define Value In Nested Function Of A Query

Oct 14, 2010

can we use user define value (how to use '&') in nested function of a query ?

View 7 Replies View Related

PL/SQL :: Define SELECT Clause Once And Reuse It In Many Other Queries?

Mar 16, 2013

Is there a way to define a SELECT clause once and reuse it in many other queries?

I have many procedures with same SELECT statement and I'm trying to find a way to not have to write out the SELECT clause in every function or procedure. Same question applies to FROM, WHERE, etc clauses.

View 12 Replies View Related

SQL & PL/SQL :: Want To Define Dynamic Type For A Variable In Oracle 10g

Jul 17, 2013

I m trying to give table name as parameter to this function. It is compiling properly.But when an anonymous block is created to call this table value, it has to be fetched into a variable of Rowtype of this inputted table. So I am not able to create any ROWTYPE variable for this table dynamically.

//Function
create or replace function instant_tabula(tabula in varchar) return sys_refcursor
as
cur sys_refcursor;
str varchar2(20000);
begin
str := 'select * from ' || tabula;
open cur for str;
return cur;
end;
[code]....

View 7 Replies View Related

Brtools Command Versus Oracle Command For Shutdown And Startup (statistics)

Sep 13, 2013

we are running SAP application against oracle database. say, if I use brspace or brtools (from SAP side) to shutdown or startup database or collect stats, does this mean it not recommend to use oracle command to shutdown/start & collect stats?

View 3 Replies View Related

Dynamically Define Database Link To Use (at Session Level)?

Sep 1, 2010

Three databases: A, R1, R2. Database A is local and the other two databases are remote. Database A has one db link to each remote database (dblinkR1 and dblinkR2).

In some of my queries I need to get data from the remote databases, but the remote database to use depends on the application user, so, I would like to dynamically use one of the database links.

Something like this:

1 � user logs into the application;
2 � based on the user credentials the application defines the db link to use;
3 � query data using the defined db link.

(for example)

SELECT a.col1, a.col2 FROM table_A@dyndblink a ORDER BY a.col1;

@dyndblink would be a "pointer" to dblinkR1 or dblinkR1.

Is there a way to dynamically define the database link to use (at a session level)?

View 2 Replies View Related

Application Express :: Decode - Define Query Condition For The Value

Jan 24, 2013

how can i define the following condition in query definitions tab to define query condition for the value which is linked from previous tab/report ,:P2_SR_ BUSINESS_UNIT is the Item which are getting value from another report Value.

BUSINESS_UNIT=DECODE(:P2_SR_BUSINESS_UNIT,'BS&I','Business Sales And Information','WS','Whole Sale')

I am new in apex and havent had any chance to create a simple report.Version Application Express 4.1.1.00.23

View 6 Replies View Related

SQL & PL/SQL :: Describe Results / Define Output And Fetch Rows Of A Query

Jun 2, 2010

There are several stages for sql processing in 10g2 database concept document.The following stages are necessary for each type of statement processing:

■ Stage 1: Create a Cursor
■ Stage 2: Parse the Statement
■ Stage 5: Bind Any Variables
■ Stage 7: Run the Statement
■ Stage 9: Close the Cursor
Optionally, you can include another stage:
■ Stage 6: Parallelize the Statement

Queries (SELECTs) require several additional stages, as shown in Figure 241:

■ Stage 3: Describe Results of a Query
■ Stage 4: Define Output of a Query
■ Stage 8: Fetch Rows of a Query

Stage 3: Describe Results of a Query The describe stage is necessary only if the characteristics of a query's result are not known; for example, when a query is entered interactively by a user. In this case, the describe stage determines the characteristics (datatypes, lengths, and names) of a query's result.

Stage 4: Define Output of a Query In the define stage for queries, you specify the location, size, and datatype of variables defined to receive each fetched value. These variables are called define variables. Oracle performs datatype conversion if necessary.

I still don't understand what's Stage 3: Describe Results of a Query and Stage 4: Define Output of a Query.

View 2 Replies View Related

Control Existence Shared Library In Memory Space To Define Real Need Of Shutting Down Of All Oracle Instances

Feb 7, 2013

according to article "Installing Netbackup for Oracle agent on Unix". URL.... Shut Down all oracle instances on this client. The reason: sometimes Oracle will take a shared library (such as ours) and place it into its shared memory spaceMy question is how I can control existence shared library in memory space to define the real need of Shuting down of all oracle instances ? I'm usung 11.2.0.3

View 4 Replies View Related

Forms :: ORA-24374 / Define Not Done Before Fetch Or Execute And Fetch

Mar 24, 2011

FRM-40501: ORACLE error: unable to reserve record for update or delete.

ORA-24374: define not done before fetch or execute and fetch

My master-detail form has single canvas. For both blocks, master and detail, two tables joined together in each. One table to be updated, second table has some info for reference (query only).

I am getting these errors when in detail block the item from LOV is selected for existing record. This does not happen for new record inserted in detail block.

View 1 Replies View Related

RMAN - Set Command ID

Dec 27, 2011

I can successfully SET COMMAND ID inside an RMAN run block

CODErman <<EOF
connect target
connect catalog ....
CROSSCHECK BACKUP DEVICE TYPE DISK;
CROSSCHECK ARCHIVELOG ALL;
RUN {
[code]...

Can this be setup without a RUN block? I am running on 11.1.07 and 11.2.0.2

View 2 Replies View Related

SQL & PL/SQL :: Command Example In Oracle 9?

Aug 5, 2010

I want to use oracle 9 select * from tab .And use the output to issue "desc XXX " for every row of output in select statement.. .How can I do it automatically ???

View 9 Replies View Related

SQL & PL/SQL :: Use Of RAISE Command?

Aug 31, 2011

explain to me what the "RAISE" command does in PL/SQL for the following code.

EXCEPTION
WHEN OTHERS THEN
INSERT INTO TMP_ERRCHECK(
PP_CD,
IHS_CD,

[code]...

Tried searching for some explanations but I still do not have a clue as to what the RAISE actually does. Do I even need to put it in the code?

View 3 Replies View Related

SQL & PL/SQL :: Pivot Right Command To Use?

Aug 28, 2011

I have the following table structure:

PK1,PK2,PK3,A1,B1,C1,A2,B2,C2

Which I want represent as follows:

PK1,PK2,PK3,A1,A2
PK1,PK2,PK3,B1,B2
PK1,PK2,PK3,C1,C2

Is pivot the right command to use? If so, how do I do this? Most pivot examples I've looked at use an aggregate like SUM, which is not really want I am trying to accomplish here.

View 4 Replies View Related

SQL & PL/SQL :: Update Command

Jun 7, 2011

here is my table...

id name bits

A 1 011011101 00
B 2 011011111 01
C 3 100100010 11

Here, I need to write a query to change 0 to 1 and 1 to 0 for every record value in table of bits column.

for ex: 011011101 00 of id - A must be changed to 100100010 11

similarly, 100100010 11 of id - C must be changed to 011011101 00

Now I need to write a query to update values of bits column in one shot.

View 4 Replies View Related

PL/SQL :: Use Of MOD Command In Query

Jun 7, 2012

what is the use of MOD command in query.Does it have performance benefit.

View 11 Replies View Related

Adrci Purging Of Command?

Sep 27, 2011

I am using the following command within a shell scrript to purge files with adrci

adrci exec="show homes"|grep -v : | while read file_line
do
echo "adrci purging diagnostic destination " $file_line
echo "purging ALERT older than $Minutes ..."
adrci exec="set homepath $file_line;purge -age $Minutes -type ALERT"

[code]...

Is there a command I can use to see what will be purged or what has been purged?

View 2 Replies View Related

Sqlplus Copy Command

Feb 15, 2013

i am trying to copy the data from a remote database which has Oracle 8i thru Sqlplus copy command to the local database which has Oracle 11gR2.

copy from abc/abc@remote
insert emp_new
using
select *
from emp_old
where rownum < 1001;

is it possible to copy the remote database thru sqlplus copy command ?

View 6 Replies View Related

SQL & PL/SQL :: Execute Immediate Command Error

Oct 14, 2011

I am facing a problem regarding the execute immediate command. I have created a procedure as given below

SQL> set echo on ;
SQL> set serveroutput on;
SQL> declare
2 l_var varchar2(50);
3 sqlstring varchar2(3000);
4 begin
[code].......

In this procedure the execute immediate command shows error ( if i avoid exception).I have tried other syntax too of this command
but it is showing error only.

View 13 Replies View Related

SQL & PL/SQL :: Run Command And Connection In One Line

Dec 5, 2011

I want run sql connection and command in one line , something like this ...

sqlplus "/as sysdba" 'select * from dual'

is it possible to do it in one command ?

View 3 Replies View Related

SQL & PL/SQL :: Copy Command In A Procedure

Feb 22, 2010

I got to pull 30M data into local DB from a remote DB. As of now we have procedure to perform this task using an

Insert /*+append*/ table1
select *
from rdb_view;

I observed using the copy command in sql plus has taken very less time than the procedure.Can we use the Copy command inside the PL/SQL block? I tried with dynamic SQL but It is not allowed I guess.

View 16 Replies View Related

SQL & PL/SQL :: Use FROM Clause In Update Command?

Jul 13, 2011

Can we use FROM clause in update command?

View 2 Replies View Related

Forms :: Command To Run SQL File?

Mar 8, 2011

i want to run sql file by forms...is there command do that

View 3 Replies View Related

Forms :: How To Use Group By Command In 6i

Oct 28, 2011

How to use group by command in forms 6i

View 4 Replies View Related







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