Procedure to check the existence of Indexes
I have a procedure whcih drops all the indexes, when the same procedure is executed again, it gives error "object does not exists" (obviously)
I want to avoid this error, how can I check the existence of index inside the procedure, so that the procedure will check if the index exists before deleting the index?
Is there a ready-made procedure available for such scenario?
Thanks in advance
The other approach is to catch the exception in your script, i.e.
BEGIN
EXECUTE IMMEDIATE 'DROP INDEX <<index name>>';
EXCEPTION
WHEN OTHERS THEN
-- Drop failed. Do something to record the failure.
NULL;
END;Now, most of the time, you'll want to catch a few specific exceptions and you'll want to do something when you catch them (i.e. generate a log entry).
Justin
Similar Messages
-
Is there any FUNCTION I can use to check the existence of a USER?
Hi,
Is there any FUNCTION I can use to check the existence of a USER? I dont want to write a function by myself to access usr01 directly.
Thanks in advance.You can use FM USER_EXISTENCE_CHECK
Thanks
Seshu -
How to check the existence of DB400 library from java
Hi all,
I actunally need to validate a DB400 library via java. so is there any way to check the existence of DB400 library from java side.
Thanks in advance.Hi Sarvan,
You might not even need a function to tell you if a record exists or not.
Here in below example i do a check with exists .you will find couple of other ways too..
create table t as select * from emp where deptno=10now i set salary of every person present in table 'T' to 1111 in emp table.
update emp e
set sal=1111
where exists
(select 1
from t
where t.empno=e.empno) Remember that plain SQL will always outperform PLSQL.
Hope it helps
CKLP
Edited by: CKLP on Sep 26, 2011 3:41 AM -
How to check the existence of file without any error dialog?
Hi everybody,
I am trying update some labview programs from LV6.1 to LV7.1, I used the
function "File/Dictionary Info" to check if the file
exists or not (if the size=0 then file does not exist), and it ran well with
LV6.1, but now it shows every time a labview error dialog
about "LabView: file not found..." with 7.1, if this file dosn't exist.
Sometimes I feel that it is really stupid to show the dialog, because I
can write handling by myself, if the error should be handled, and
I don't want all the process is interrupted because of such dialogs. Is
there any way to shut the dialog down or check the existence of
file smoothly?
Thanks a lot!
L.WangHello,
The dialog is probably appearing because you have Auto Error Handling turned on. This feature is turned on by default in LabVIEW 7.0. You should go to VI Properties (Ctrl-I) > Execution and deselect "Enable automatic error handling". Also you should go to Tools > Options > New and Changed in LabVIEW 7.x and deselect "Enable automatic error handling in new VIs". If you never want to see one of those dialogs again, you can also deselect "Enaeble automatic error handling dialogs"...I wouldn't recommend this, however, as you would never know if one of your VIs had this setting enabled...you would only find out once somebody else tried to use your VI on another LabVIEW install.
-D
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
Programmatically check the existence of objects in the system
Hi,
Is there a way to programmatically check the existence of objects? The idea is I'll accept a list of names of objects and their object types and then programmatically check their existence in the system?
Can you point me to a resource on how to do it?
Thanks in advance.
--CarlHi.
All custom objects (z, y) being referred to a program. May it be z or y table, data element, domain, sapscript form, function module/group.
The goal is actually to be able to transport a program from a source machine to a target machine. The objects being referred to from the program must also be transported, of course, for it to run properly. Thus, the need to check the objects' existence.
Thanks.
--Carl -
Write a procedure to check the count is less than 1300 for every 3 hours
Good Morning all,
I want to write a procedure to check the count is less than 1300 for every 3 hours
Query:*
Select count(*) from sample where trx_date=sysdate;
I want to run this query every 3 hours daily
If the count is less than 1300 every 3 hours, we should sent a reminder mail like 'Data not copy'.
Please help me how to write a procedure.hi there
first
--define the SMTP_OUT_SERVER parameter in your init.ora initialization file
--ALTER SYSTEM SET smtp_out_server='my.domain.com' SCOPE=SPFILE;
after that create a procedure
CREATE OR REPLACE procedure SCOTT.hrsmail
is
v_count number;
begin
Select count(*) into v_count from emp;
if v_count < 1300
then
UTL_MAIL.send(sender => '[email protected]',
recipients => '[email protected]',
cc => '[email protected]',
bcc => '[email protected]',
subject => 'Testing the UTL_MAIL Package',
message => 'If you get this, UTL_MAIL package
else
null; --what you want to do here
end if ;
end;
/we should create a job which run after every 3 hrs and send a reminder mail like 'Data not copy'.
BEGIN
SYS.DBMS_JOB.REMOVE(373);
COMMIT;
END;
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'begin hrsmail; end;'
,next_date => to_date('14/02/2011 18:39:29','dd/mm/yyyy hh24:mi:ss')
,interval => 'SYSDATE+3/24 '
,no_parse => FALSE
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
COMMIT;
END;
/hope this will help you
Regards
Hitesh
Edited by: Hitesh Nirkhey on Feb 14, 2011 3:34 PM -
Revision: 23143
Revision: 23143
Author: [email protected]
Date: 2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
Log Message:
Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method. Promote it to be at the top instead of at the bottom.
Modified Paths:
blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.javaRevision: 23143
Revision: 23143
Author: [email protected]
Date: 2011-10-27 06:31:02 -0700 (Thu, 27 Oct 2011)
Log Message:
Certain code needs to check the existence of the class validation validator (some brokers and other listeners) during message broker init, however the validator was not being created till the very end of the method. Promote it to be at the top instead of at the bottom.
Modified Paths:
blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java -
Any means to check the existence of a .pdf file before opening in SAP GUI
Dear,
I've learnt from one of the thread that there is a sample program SAP_PDF_VIEWER_DEMO that allows us to open a .pdf file within a SAP windows.
However, I would like to know if there are any means to perform a checking on the existence of the .pdf file first before calling the method open_document as coded in the demo program.
Thanks a lot for your advise in advance,
Franciswhere is this pdf file is ? in user desktop?
if yes you can simply use cl_gui_html_viewer for viewing pdf files. and you can use cl_gui_frontend_service=>file_exists method to check whether the file exists
Raja -
How to check the existence of a storeProcedure
Hello everyone,
today I discovered how to call an oracle store procedure with jdbc classes, and it's been easy with tutorials and reading posts on this forum.
The problem I have is the following:
if i try to execute a store procedure which does not exist on the oracle schema with this code:
try{
con = DriverManager.getConnection(databaseurl,username,password);
cstmt = con.prepareCall"{call procedure_that_not_exist(?,?,?)}";
cstmt.setString(1, "try");
cstmt.registerOutParameter( 2, Types.VARCHAR );
cstmt.registerOutParameter( 3, Types.VARCHAR );
cstmt.executeUpdate();
catch(Exception e)
e.printStackTrace();
System.out.println(e.getMessage());
I get the following error:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'PROCEDURE_THAT_NOT_EXIST' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
how is it possible to check before getting this "not specific error" wheter the procedure exist on the database schema?
Thank you!
GianniI mean the error PLS-00201 is not only related to the
fact that the procedure does not exist, but more
generally to "identifiers". (what are identifiers?)The 'name' of something. So, using your example code the following is an identifier....
procedure_that_not_exist
Other identifiers are variables in procs, table names, field names, constraint names, etc. -
Checking the existence of a file b4 creating a file by the same name
Hi All,
I hav a scenario where I hav to check for the existence of a file by the same name (<b>XXXFile</b> say). If i don't hav any file by the name <b>XXXFile</b>, then i hav to create a file by the name <b>XXXFile</b> at that location. If it already exists, then i hav to wait till it gets deleted (takes hardly 1 min to get deleted).
Can any one tell me :
How to do this without using operating system command?
And using operating system command?
Any help wud be appreciated.
Thnx in Adv
AnilHi Anil,
You will i guess have a standard format in which you are going to write the file with a counter or something.
Whenever you are going to write a file, you can:
1. Check if there is a file already sent by this name?
2. If no, then you can send the file at the same time update the name.
You can do this by creating a ztable in SAP and accessing it through JCO/RFC. You can do this in your module or in the mapping.
eg. /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
Regards
Vijaya
Message was edited by: vijaya kumari -
Pl/sql stored procedure code2 check the emial id is correct or not
if the mail id is [email protected]@.com
then how we do validations means
there must be only one @
i wnat all tghis type of validations 2 check the email id is correct or not?
the procedure that i wnat to validate akll the validationsThis appears to be a duplicate of your existing thread
pl/sql stored procedure for email id validations
I'll answer there.
Justin -
Check the existence of sales order
Hi all,
I am working on the scenario Jdbc to SAP(BAPI's).In Jdbc there is a flag field which indicates the status whether it is create or update or delete.I am using recieve and steps in BPM.
If it is create i have to first check whether already sales order is presented in the SAP data base.If it is already there ,then it must update the existing salesorder with create option.
similarly with update also...
How can i check the data existed in SAP database in BPM ?
Could anybody please help me?
Thanks,
sekhar.you receive a jdbc "data type" and you want to post an rfc to check if the sales order is created so
you have to map the "jdbc" to RFC (transformation step)
then after the swith you can map your "jdbc" again to your z_bapi which now will create or update a sales order for instance
now a little bit clearer?
Regards,
michal
Message was edited by: Michal Krawczyk -
Checking the Existence of Flat File
Hi,
I want to know whether a flat file is existing in the presentation server.
I want to check the text file's availability and upload if it is there using GUI Upload.
Regards
AnilHi,
Try this.
AT SELECTION-SCREEN ON p_file.
PERFORM f_validate_file.
FORM f_validate_file .
*VARIABLE DECLARATIONS
DATA:loc_result TYPE abap_bool,
loc_file TYPE string.
loc_file = p_file.
*Checking the file exist or not
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = loc_file
RECEIVING
result = loc_result
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
IF loc_result = wl_space.
MESSAGE e368(00) WITH text-003. "ENTER CORRECT FILE PATH
ENDIF.
ENDFORM. " F_VALIDATE_FILE
Regards,
Rohan. -
File problem - checking the existence of a remote file
I have absolute paths to several text files from a ftp server (which don't require any
authentication and can be accessed over the internet).
I am trying to write a Java method that can check any of the above absolute ftp file
paths and returns true/false depending on whether the file exists/doesn't exist.
I tried somewhat this way:
File current_file = new File(absolute_file_path);
// absolute_file_path comes as a parameter
// e.g. "ftp://ftp.test.com/myfile.txt"
if(current_file.exists()) return true;
// if the file exists return true
return false;
// otherwise return false
Then I ran the program in my local machine which has internet access. But it returned
false for all the files (even if the file exists). Seems like it's unable to get those
files.
Could someone please tell me how can I rewrite my program so that it can be executed
locally.
Thanks,
SQDoes anyone know if URL and URLConnection support FTP
directly? I can imagine downloads being simple, but
how about uploads? Never tried with FTP myself.Yes, they do. But uploads don't work properly with Java 1.3. (Note: I only know this because I've seen questions asked about it here, not from personal experience.) If I wanted to know whether a certain file existed on an FTP server, I would use an FTP client that could tell me that. Such as the Jakarta Commons/Net FTP client. -
How to check the existence of a file?
Hi,
I want to know how to use FileNotFoundException to check whether a text file exists in local directory.
How should I do the code?
Thanks
gogoLike this:
private File f = new File ("c:\\projects\\sutil\\err\\temp_err.txt");
if (f.exists()) {
f.delete();
}
Maybe you are looking for
-
Windows server 2012 R2 randomly BSOD's
Dear all, Since recently we suffering from random BSOD's on a Windows 2012 R2 terminal server. We already checked if there has been any changes, updates, new drivers installed, etc. around the time we receive the first one, but we cannot find anythin
-
Related to Fi when SD people Realesing the Fi document
Hi to All I have one issue regarding When Sales and Distribution People they going to realese the Bulling Document they are getting one error like *No account was specified in for account type "S" in item "0000001003" of the FICO documents*,
-
How to get Mail address of an Employee in Workflow ?
Hello Everybody , I want to send mail to employee through workflow . I have Employee number PERNR but which method and B.O should i used to get email address of that employee .? Any solution .? Regards, Sandeep Jadhav
-
ITunes 7.1.1 not displaying correctly
Having recently upgraded from 7.0.1 to 7.1.1, the interface is not displaying properly. The icons have disappeared down the left side (for music, movies, podcasts, playlists etc). But my main problem is that the scroll bars have also vanished - which
-
My M505 still functions perfectly, and has served me for a number of years while coping with many changes in operating systems including Windows 95,98,Millenium,and XP. I recently installed it on a new laptop running Windows 7. The desktop seemed to