PL/SQL :: Use Of MOD Command In Query
Jun 7, 2012what is the use of MOD command in query.Does it have performance benefit.
View 11 Replieswhat is the use of MOD command in query.Does it have performance benefit.
View 11 RepliesI want to run a query to generate command to rename ASM files:
This is how the ASM data looks:
+DATA/db1/datafile/report.180.248540158
This is how I want the command to look like:
SET NEWNAME FOR DATAFILE 1 TO '/u02/data/dev/db1/report.180.dbf';
How can I write the query, using SUBSTR and INSTR to generate the command:
e.g. - SELECT 'SET NEWNAME FOR DATAFILE '||FILE#||' TO '''||'/u02/......
To look like:
SET NEWNAME FOR DATAFILE 1 TO '/u02/data/dev/db1/report.180.dbf';
I dosn't want to use the command break on <column name> / how to write sql to replace the break command.
View 8 Replies View Relatedwe 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 RelatedI am using expdp command to export the table by specifying Query parameter. But i am unable to export the table based on the condition.
Ex:EXPDP username/password dumpfile=employee.dmp logfile=emp.log directory=DATADIR_EXP TABLES=EMPLOYEE query=EMPLOYEE:"UPDATED_TIME >= '04-JUN-13' AND UPDATED_TIME >= '05-AUG-13'" Estimate in progress using BLOCKS method...Processing object type TABLE_ EXPORT/ TABLE/ TABLE_ DATATotal estimation using BLOCKS method: 3 GBORA-31693: Table data object "<username>"."EMPLOYEE" failed to load/unload and is being skipped due to error:ORA-00933: SQL command not properly endedMaster table "<username>"."EMPLOYEE" successfully loaded/unloaded...Dump file set for <username>.SYS_EXPORT_TABLE_01 is: E:IMPDPemployee.dmpJob "<username>"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 12:34:45 Oracle 11g,
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
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 Relatedset 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.
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?
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.
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.
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?
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 ?
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.
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 ?
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.
Can we use FROM clause in update command?
View 2 Replies View Relatedi want to run sql file by forms...is there command do that
View 3 Replies View RelatedHow to use group by command in forms 6i
View 4 Replies View Relateddatabase 10GR2, Character_set WE8ISO8859P1
The following command not working.
update consumerappliedform
set name =replace (name,'¿','‡');
What is the problem.
OS:Linux 5
how to find out the timestamps of a OS command executed previously. "history" command doesn't show the timestamps. I checked "man history" but i couldn't able to find the proper option.
1222 db
1223 oh
1224 cd dbs
1224 cd $TNS_ADMIN
when we want to execute self join command for displaying employee names and their managers name we use the following query.
Select e1.ename"Employees",e2.ename"Managers" from emp e1,emp e2 where e1.Manager_ID=e2.Employee_ID
how it displays the above information or how it works?
am learning the Oracle PL/SQL language using CBT Nuggets tutorials and practicing what I learn. I seem to be getting confused with the ROUND function...For example, what am I doing wrong in this statement:
select avg(salary) from employees,
ROUND (avg(salary) , 2;
Basically I am trying to round the result to two decimal places but get the error ORA - 00933 - SQL command not properly ended?
I have an agent, actor, movie and producer table, I want to list the details of all agents who represented actors casting in movies produced by "X" (X is the name of producer). I want to know the command for doing this.I have the following tables:
table agent(
agentID(pk),
fname,
sname,
city,
sex
[code]...
I have a producer fname as Xavion in the table.
There is a stored procedure to which i am trying to schedule, but getting error as below:" Failed to process SQL command
-ORA-27486: insufficient privileges
ORA-06512: at "SYS.DBMS_ISCHED", line 124
ORA-06512: at "SYS.DBMS_SCHEDULER", line 271
ORA-06512: at line 2 "
I am not getting where issue is, as i am new to ORCL SQL Dev.
is there anyway to know that what dml/ddl command a user is executing and on which table the impact is taking place?
View 2 Replies View RelatedI want to rename
cf(1)
cf(2)
cf(3)
to
cf1
cf2
cf3
in DOS.
What the "change" RMAN command does? For example, what is the effect of following command:
change archivelog until time 'SYSDATE-7' delete
And what is the difference between following commands:
change archivelog all validate;change archivelog all crosscheck;change archivelog all;
I checked the following doc but could not find anything:[URL]I am using Oracle 10gR2 on RHEL 64-bit.
How a truncate command comes under DDL section, instead DML. All the operations happening inside the object is called DML and ON the object is called DDL.
View 7 Replies View RelatedI want to know what syntax I should use for encoding option with loadjava command?
here is the scenario--
Our oracle database is already compatible with UTF-8 characters i.e. charset encoding is set as 'AL32UTF8'. I am able to save Chinese characters in the database however when I trigger a stored procedure which eventually use a loaded java class I get an error.
I am suggested to provide -encoding option while running 'loadjava' command but I don't know what syntax I should provide for 'UTF8' encoding.