How to check if the object is valid or not?

I have a scenario in my stored procedure, where the functions seeks a User_Object and if found (= 1), then it executes.
ex:
IF TEXISTS ('LAB_IN') = 1 THEN
FOR x IN (SELECT COLUMN_NAME, SRC_COL, SRC_TBL, COLUMN_PREFX, COLUMN_STRING_OPP, DEST_TABLE L_UTIL_SRC WHERE SRC_TBL = 'L')
LOOP
VCAT: = CASE WHEN ISCAT > 0 THEN ELSE REPLACE(x.DEST_TABLE, 'UTIL_', '') "END;
vblJOB: = ";
vblJOB: = vblJOB | "CREATE OR REPLACE PROCEDURE SP_ | x.DEST_TABLE |' AS ';
vblJOB: = vblJOB | "PRAGMA AUTONOMOUS_TRANSACTION; ';
vblJOB: = vblJOB | ' vblQueryName VARCHAR2 (150); ';
..........
..........
..........

My question is, what happens if the object (LAB_IN) is not valid. Or if changes have been made to it. How can I do this function NOT run, if the object is not valid... and displays the error message without going any further...

Any suggestions or comments, would apprecaite it...

Thank you!

999355 wrote:
Hi Frank,.

I made changes to the code. Can you please let me know if that would work. Look's like I am getting a syntax error;

The error messages contain information designed to help solve problems. Always display the full error messages, including the line numbers and the complete code that caused them.

CREATE OR REPLACE PROCEDURE 'PROCEDURE_NAME' (ACE)
VARIABLE1 VARCHAR;
VARIABLE2 VARCHAR;
VARIABLE3 VARCHAR;
VARIABLE4 INT;
BEGIN
IF TEXISTS ('LAB_IN') = 1 THEN

What is TEXISTS? Is - this function that queries user_objects? Perhaps you need to change to get the status.

SELECT MIN (STATUS)
IN OBJ_STATUS
WHERE OWNER = "
AND OBJECT_NAME = 'LAB_IN. '
AND OBJECT_TYPE = 'VIEW.

You need one; After the above statement

IF OBJ_STATUS = "VALID".
THEN
FOR x IN (SELECT COLUMN_NAME, SRC_COL, SRC_TBL, COLUMN_PREFX, COLUMN_STRING_OPP, DEST_TABLE TABLE_NAME WHERE SRC_TBL = 'L')
LOOP
VCAT: = CASE WHEN ISCAT > 0 THEN ELSE REPLACE(x.DEST_TABLE, 'UTIL_', '') "END;
vblJOB: = ";
vblJOB: = vblJOB | "CREATE OR REPLACE PROCEDURE SP_ | x.DEST_TABLE |' AS ';
vblJOB: = vblJOB | "PRAGMA AUTONOMOUS_TRANSACTION; ';
vblJOB: = vblJOB | ' vblQueryName VARCHAR2 (150); ';
..........
..........
..........
EXECUTE IMMEDIATE (vblJOB);
COMMIT;
END LOOP;
ON THE OTHER
DBMS_OUTPUT. Put_line (' table LAB_IN is missing.) Please check...');
END IF;
END IF;
     
IF TEXISTS ('RX_IN') = 1 THEN
SELECT MIN (STATUS)
IN OBJ_STATUS
WHERE OWNER = "
AND OBJECT_NAME = 'RX_IN. '
AND OBJECT_TYPE = 'VIEW.

You need one; After the above statement, too.

IF OBJ_STATUS = "VALID".


THEN
FOR x IN (SELECT COLUMN_NAME, SRC_COL, SRC_TBL, COLUMN_PREFX, COLUMN_STRING_OPP, DEST_TABLE L_UTIL_SRC WHERE SRC_TBL = 'L')
LOOP
VCAT: = CASE WHEN ISCAT > 0 THEN ELSE REPLACE(x.DEST_TABLE, 'UTIL_', '') "END;
vblJOB: = ";
vblJOB: = vblJOB | "CREATE OR REPLACE PROCEDURE SP_ | x.DEST_TABLE |' AS ';
vblJOB: = vblJOB | "PRAGMA AUTONOMOUS_TRANSACTION; ';
vblJOB: = vblJOB | ' vblQueryName VARCHAR2 (150); ';
..........
..........
..........
EXECUTE IMMEDIATE (vblJOB);
COMMIT;
END LOOP;
ON THE OTHER
DBMS_OUTPUT. Put_line (' table RX_IN is missing.) Please check...');
END IF;
END IF;
     
IF TEXISTS ('SUPPL_RX_IN') = 1 THEN
SELECT MIN (STATUS)
IN OBJ_STATUS
WHERE OWNER = "
AND OBJECT_NAME = 'SUPPL_RX_IN. '
AND OBJECT_TYPE = 'VIEW.

The same problem.
Don't make the same mistake 3 times. Don't do so many changes at once to your procedure. Decide when you need to make the same change to 3 different places, do it in only 1 place and make sure it works before making the same change elsewhere.

IF OBJ_STATUS = "VALID".
THEN
FOR x IN (SELECT COLUMN_NAME, SRC_COL, SRC_TBL, COLUMN_PREFX, COLUMN_STRING_OPP, DEST_TABLE L_UTIL_SRC WHERE SRC_TBL = 'L')
LOOP
VCAT: = CASE WHEN ISCAT > 0 THEN ELSE REPLACE(x.DEST_TABLE, 'UTIL_', '') "END;
vblJOB: = ";


vblJOB: = vblJOB | "CREATE OR REPLACE PROCEDURE SP_ | x.DEST_TABLE |' AS ';
vblJOB: = vblJOB | "PRAGMA AUTONOMOUS_TRANSACTION; ';
vblJOB: = vblJOB | ' vblQueryName VARCHAR2 (150); ';
..........
..........
..........
EXECUTE IMMEDIATE (vblJOB);
COMMIT;
END LOOP;
ON THE OTHER
DBMS_OUTPUT. Put_line (' table SUPPL_RX_IN is missing.) Please check...');
END IF;
END IF;
END;
/

Tags: Database

Similar Questions

  • What ever the data that we are loading in HFM, how to check if the data are correct or not?

    Hello!

    This is SANDEEP, I loaded data using FDM in HFM. How to check if the data is correct or not, what ever the data I was responsible in HFM.

    Please tell me how to recover the data and what format, clearly can you me the data verification process step by step.

    It would be useful for me...

    Thanks in advance...

    Kind regards

    SANDEEP

    Hi Sandeep,

    I think the best way is to extract data from HFM for the same POV that you have loaded FDM and check if it is the same.

    If you then use HFM 11.1.2.x version

    1. login to the application and go to the menu Administration / extract / data.

    2. set the POV that you have loaded the data, then unzip it. You can open the file unzipped in a notebook

    3. you can compare the file with the data file generated by FDMEE under Outbox folder.

    But what would you give all the data corresponding to the POV that you set. So please ensure that you have the correct POV, defined according to the export FDMEE.

    Thank you

    Chandra

  • How to check if the directory is created using create or replace directory

    Hello

    I create a directory like below:

    Create or replace directory TEST_DIR AS 'C:\ABCD '.

    How to check if the directory is created or not? Is there any request for it?

    Thanks in advance.

    PK

    SELECT * FROM ALL_DIRECTORIES WHERE DIRECTORY_NAME LIKE '% TEST_DIR %. "

    Published by: user3522507 on 2010.06.16. 07:19

  • How to check if the persistence Unit objects are persistent or not?

    How to check if the persistence Unit objects are persistent or not?

    I have correctly set up and deploy the object used as a persistence in Oracle coherence unit according to the guide Chapter 6 of tutorial for Oracle coherence 3.5
    Using the RunEmployeeExample script, I had good results. I see that once the cache object is updated, the database table (employees) is also updated accordingly. Here is the result:
    2009-11-05 11:09:55.043/53.467 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member(Id=2, Timestamp=2009-11-05 11:09:54.867, Add
    ress=192.168.8.80:8089, MachineId=24656, Location=process:1684, Role=OracleRunEmployeeExample) joined Cluster with senior member 1
    2009-11-05 11:09:55.604/54.028 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 joined Service Management with senior memb
    er 1
    2009-11-05 11:09:56.885/55.309 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): TcpRing: connecting to member 2 using TcpSocket{Sta
    te=STATE_OPEN, Socket=Socket[addr=/192.168.8.80,port=8089,localport=4084]}
    2009-11-05 11:09:57.847/56.281 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 joined Service JpaDistributedCache with se
    nior member 1
    2009-11-05 11:09:57.917/56.341 Oracle Coherence GE 3.5.2/463 <D5> (thread=DistributedCache:JpaDistributedCache, member=1): Service JpaDistributed
    Cache: sending ServiceConfigSync containing 258 entries to Member 2
    2009-11-05 11:10:04.086/62.510 Oracle Coherence GE 3.5.2/463 <D5> (thread=DistributedCache:JpaDistributedCache, member=1): Deferring the distribu
    tion due to 1 pending configuration updates
    [EL Info]: 2009-11-05 11:10:14.36--ServerSession(2883071)--EclipseLink, version: Eclipse Persistence Services - 1.1.1.v20090430-r4097
    [EL Info]: 2009-11-05 11:10:22.312--ServerSession(2883071)--file:/C:/JDeveloper/mywork/AppJPA/JPA/classes/-JPA login successful
    2009-11-05 11:10:24.305/82.729 Oracle Coherence GE 3.5.2/463 <D5> (thread=DistributedCache:JpaDistributedCache, member=1): 3> Transferring 128 ou
    t of 257 primary partitions to member 2 requesting 128
    2009-11-05 11:10:25.697/84.121 Oracle Coherence GE 3.5.2/463 <D4> (thread=DistributedCache:JpaDistributedCache, member=1): 1> Transferring 129 ou
    t of 129 partitions to a node-safe backup 1 at member 2 (under 129)
    2009-11-05 11:10:25.857/84.281 Oracle Coherence GE 3.5.2/463 <D5> (thread=DistributedCache:JpaDistributedCache, member=1): Transferring 0KB of ba
    ckup[1] for PartitionSet{128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
    152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
    181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
    210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238,
    239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256} to member 2
    2009-11-05 11:10:40.678/99.102 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): TcpRing: disconnected from member 2 due to a kill r
    equest
    2009-11-05 11:10:40.678/99.102 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 left service Management with senior member
     1
    2009-11-05 11:10:40.678/99.102 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 left service JpaDistributedCache with seni
    or member 1
    2009-11-05 11:10:40.708/99.132 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member(Id=2, Timestamp=2009-11-05 11:10:40.708, Add
    ress=192.168.8.80:8089, MachineId=24656, Location=process:1684, Role=OracleRunEmployeeExample) left Cluster with senior member 1
    2009-11-05 11:10:40.879/99.303 Oracle Coherence GE 3.5.2/463 <Info> (thread=DistributedCache:JpaDistributedCache, member=1): Restored from backup
     128 partitions
    2009-11-05 11:10:40.879/99.303 Oracle Coherence GE 3.5.2/463 <D4> (thread=DistributedCache:JpaDistributedCache, member=1): 0, 1, 2, 3, 4, 5, 6, 7
    , 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 4
    4, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80
    , 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 11
    3, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
    2009-11-05 11:28:39.800/1178.224 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member(Id=2, Timestamp=2009-11-05 11:28:39.635, A
    ddress=192.168.8.80:8089, MachineId=24656, Location=site:metsys.metex.com,machine:mw12,process:1752, Role=CoherenceConsole) joined Cluster with s
    enior member 1
    2009-11-05 11:28:40.231/1178.655 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 joined Service Management with senior me
    mber 1
    2009-11-05 11:28:41.633/1180.057 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): TcpRing: connecting to member 2 using TcpSocket{S
    tate=STATE_OPEN, Socket=Socket[addr=/192.168.8.80,port=8089,localport=4143]}
    2009-11-05 11:30:01.658/1260.082 Oracle Coherence GE 3.5.2/463 <D5> (thread=Cluster, member=1): Member 2 joined Service DistributedCache with sen
    ior member 2
    But I can't check whether the persistence unit is still persistent.

    Published by: jetq on November 5, 2009 11:49

    Re:

        Does the above result shows that the persistence work is finished successfully?
       
    

    Yes, it's nice. What is persistence. These are the characteristics of persistence.

    Junez

  • HP50g: HP50g - hot to check if the object of the stack is a number?

    How to check if an object on the stack is a number or another type of data? There seems to be no any function to check on 50g.

    50 g advanced users to see, page 1-13:

    "The order TYPE ([left SHIFT] PRG-> TEST-> NXT-> TYPE) accepts any object as argument and returns the number that identifies the type of this object." For example, 'HELLO' TYPE returns 2, the value of a string object. See table of object types in Chapter 3, in the command TYPE, to find objects of calculator and corresponding type numbers.

    Generally want to DUP the object to the level of the stack 1 first of all, because likely you want to do something with it, after checking his type.  The following RPL program checks the type of the object in level 1 of the pile and adds a string to the stack indicating its type.  Only some of the possible types are checked and a generic "something else" translates to others:

    «
    TYPE OF DUP
    CASE
    DUP 0 == THEN DROP 'real number' END
    DUP 1 == THEN DROP "complex number" END
    DUP 2 == THEN DROP 'chain' END
    DUP 3 == THEN DROP "real array" END
    DUP 5 is THEN DROP 'list' END
    DROP "something else"
    END
    »

  • Publish in the In - App tests. "The object you requested is not valid."

    I am trying to test In - App, but I can not able to test it.

    I've implemented this code. and after that for the test test in the BlackBerry World sandbox.

    I downloaded my app as a project and added my a/c in the sandbox sand.

    I can't find my device app on AppWorld.

    When I add ContentID (virtual goods Id) in development mode.

    I can see my good virtual but there is a "Not available for this device" message in red.

    When I test my application through debugging I get this message "the object you requested is not valid."

    I also checked the version of the device and the build version. My version of the device is greater than my build version.

    I downloaded yesterday...

    Thanks for your reply...

    I found the solution...

    I tried to search for the application by name...

    I got my app via enter sku or Application id in AppWorld > parameters > Decelopement Mode > ContentID

  • When you try to upgrade to photos in app store I get this message "the object you requested is not available in the store US." does anyone else have this problem or can you tell me how to find pictures in the app store

    "When you try to upgrade to photos in app store I get this message"the object you requested is not available in the store US."does anyone else have this problem or can you tell me how to find pictures in the app store" someone else meets this.  Is it me or is it pictures?

    Ever photos first? It should have been included when you first update of Yosemite and now El Capitan. I know that iPhotos updates get a message like that, but I didn't know the Photos app with a message with it.

    Update to iPhoto to Photos for OS X - Apple support

  • My MacBook Pro suddenly becomes very slow, accepting orders very slow how to check if the ram is working properly

    My MacBook Pro suddenly becomes very slow, accepting orders very slow how to check if the ram is working properly

    You can try this download.   Etrecheck.   https://etrecheck.com/#about

    Then publish the report as a reply in this thread.

    It will allow us to review your system without disclosing a private matter.

  • How knowledge/check if the RMAN backup was performed using a current control file or database catalog?

    Hello

    How knowledge/check if the RMAN backup was performed using a current control file or database catalog? I mean RMAN prompt or sqlplus is it possible to know.

    Thank you

    You're welcome my friend

    You can see them using two methods.

    as I mentioned above, you can see them connect to the catalog database and you can query using the view that I sent

    http://docs.Oracle.com/CD/E11882_01/backup.112/e10642/rcmreprt.htm#BRADV89601

    the other method is the list command, you must use the list command after connecting using rman "rman target / catalog cat_user/cat_pass@catdbtns" command

    http://docs.Oracle.com/CD/E11882_01/backup.112/e10642/rcmreprt.htm#BRADV8136

    Check the value of the control_file_record_keep_time parameter. The default value is 7 days. in the output of the list command, if you can see the old backups to the value, you must be sure that the backup information comes from the catalogue database

    SELECT * FROM parameter $ v where name = 'control_file_record_keep_time '.

    an example of command list

    the list of completed database before backup ' sysdate-10'.

    Concerning

  • How to check if the acrobat adobe pro xi is enabled

    How to check if the acrobat adobe pro xi is enabled

    Hi Shubham,

    If the product is activated it will give the option to disable under the Help menu. Also whenever you launch Acrobat it will bring activation window if it requires one.

    Thank you

    Abhishek

  • How can I save a document in pdf format pdf.p7m? I have digitally signed by Aruba I signed and the signature is valid, but not in pdf format, I contacted Aruba, I sent my card and regular and correct. Who can help me?

    How can I Save a document in PDF format PDF.p7m ?
    I digitally signed Aruba
    J’ai signed and the signature is valid, but not in pdf format pdf.p7m
    I contacted Aruba, I sent my card and regular and correct.
    Which peut help to me?

    Not possible with Adobe Acrobat.

    Open File Extension P7M

  • How to check on the website of Adobe Creative Suite 6 Design &amp; Web Premium (student version)?

    How to check on the website of Adobe Creative Suite 6 Design & Web Premium (student version)? I don't find the sea site.

    Check what... your serial number?

    Your serial number appears on your account page?

    https://www.adobe.com/account.html for numbers on your page from Adobe

    Or do you want to download? Other downloads

  • How can I customize the object of a hyperlink email

    How can I customize the object of a hyperlink email? I added a hyperlink to an image. I want to click, a new message of pop e-mail filled up with a topic already personalized.

    hyperlink would be

    topic of mailto:youremailaddress?subject=email here

  • How to check if the database for DRDA gateway is installed and configured.

    Hi all

    How can we check if the database for DRDA gateway is installed and configured.

    Our operating system is AIX 5 L 64 bit OS.
    RDBMS: 11.2.0.3

    Kind regards

    Duplicated
    How to check if the database for DRDA gateway is installed and configured.

    + - locked thread-+.

    Nicolas.

  • How to check if the selection is any text tho:

    Ok.. Another question:

    How to check if the selection is any text tho:

        if (app.documents.length != 0 && app.selection.length != 0 &&

         (app.selection[0].constructor.name=="Text"||app.selection[0].constructor.name=="Paragraph"))

    but sometimes the selection is 'textStyleRange', sometimes 'character' etc. is there a shortcut to check both?

    I usually do something like this:

    if ( app.documents.length && app.selection.length && app.selection [ 0 ].hasOwnProperty ( 'baseline' ) )
         alert ( "It's a text!" );
    

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

Maybe you are looking for

  • Switch to a different space drives me crazy

    I'll have a big problem with several spaces and OS X switch automatically between them. I disabled the option in system preferences to switch automatically to a space with open windows when switching to an application, but this option do not what it

  • Firefox Sync see my custom server URL as invalid and reports then a script is not responding.

    I'm trying to implement a synchronization server. I have a linux machine running the package AUR arch. I have install sync.conf to http://192.168.x.x:5000 / and followed the instructions on this page: https://wiki.archlinux.org/index.php/Mozilla_Sync

  • After you have set the HTTPS access locked out E4200

    Decided to put communication based on a browser with the settings of the router advanced for HTTPS.  As soon as I saved the settings, I received a message from Internet Explorer that the security certificate for the site is not safe, and it offers no

  • don't know password to connect, can't find it

    Help me please get back on my computer

  • ASSISTANT FAX CONSOLE

    I have downloaded on my pc, Vista When I click on all programs and click on accessories, I can't pinpoint communications, I need to click on the communications so that I can click on fax, I am unable to find a fax on my pc. can you help me please, I