Logic inside the procedure should be run only in environments dev and qa

Hi all

I need to create the procedure and the logic with the procedure should be called in development and qa (testing) environment only and not in production.

Version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

The procedure should be in all environments, that it is the requirement.

Please advice me which I can create the logic.

Thank you
Rambeau

Dear

Within your stored procedure, use as a kind of PL/SQL code to get the database of runing

SELECT case
          when instr (global_name, '.') > 1
             then substr (global_name, 1, instr (global_name, '.') - 1)
          else global_name
       end global_name
   INTO lv_database_name
   FROM global_name;

and keep it

  if lv_database_name in ('your_sid_dev', 'your_sid_test)
  then
    your executable code goes here
 end if;

Best regards

Mohamed Houri

Tags: Database

Similar Questions

  • How to compile packge inside the procedure that uses this package

    ORACLE 10g, 11g

    CREATE OR REPLACE PACKAGE PKG_TEST_COMMIT
    PROCEDURE Insert_into_table_T1;
    PROCEDURE Update_table_T1;
    END PKG_TEST_COMMIT;

    CREATE OR REPLACE PROCEDURE PROC_TEST_COMMIT as
    Begin
    PKG_TEST_COMMIT. Insert_into_table_T1; -Insert data into table T1
    EXECUTE IMMEDIATE 'DROP table T1;
    IMMEDIATE EXECUTION
    "create table T1 as select"1 ","d"," s "from DUAL;" -now PKG_TEST_COMMIT package at the stage not compiled
    -compile the package
    DBMS_DDL.alter_compile ('PACKAGE', 'OWNER', "PKG_TEST_COMMIT");
    PKG_TEST_COMMIT. Update_into_table_T1;
    End PROC_TEST_COMMIT;

    When I try to run the PKG_TEST_COMMIT I get an error: cannot lock the package.
    I tried to create a separate procedure for compiling, but the result is the same.
    If I'm done PROC_TEST_COMMIT before compiling, then compile - OK.

    It's a way to compile the package inside the procedure?

    TRUNCATE and INSERT / * + APPEND * / should be more effective than deleting them and recreating a table wouldn't it because you don't have to worry about the invalidation and recompilation of all dependent objects.

    Justin

  • What is the procedure how to make my system image backup and data through Windows NAS Server?

    I work the iMac with bootcamp for Windows 7 - Home Premium.

    I want to return to the system image and data etc. of the 'Windows Back up and Restore' to my Synology NAS (network attached storage). When I do the setting changes, I could not find the option to connect to the NAS, but have only the offer to connect to the external hard drive.

    (1) the 'Windows Back up and Restore' allows to connect to the NAS for the back of my files, in particular for the iamge system? If not, any other method to make the back upward, especially for the system image?

    (2) what is the procedure how to make my system image backup and data through Windows NAS Server?

    Original title: save the Windows image

    Backup to a network location is not supported by Windows 7 Home Premium. Do you need Windows 7 Professional or ultimate edition.

    http://Windows.Microsoft.com/en-GB/Windows7/where-should-i-save-my-backup

  • Help! I need to connect my iPhone5s to the stereo, but it has only one usb port and whenever I connect it, it connects? Is there a setting on my phone, I need to change? Help, please

    Help! I NEED to connect my iPhone5s to the stereo, but it has only one usb port and whenever I connect it, it connects? Is there a setting I need to change on my phone? Help, please

    You will need something like that and a micro USB to USB cable

    http://www.Apple.com/shop/product/MD820AM/A/lightning-to-micro-USB-adapter

  • Timer of $ v (view does not exist) inside the procedure

    Hello

    I am very new to Oracle, please forgive me in advance for the novice questions. DB = Oracle 9i R2, develop using SQL Developer 1.51.5440. I'm an admin on a test server account. On the screen of the application, I can run this query:

    SELECT hsecs FROM V$ TIMER

    Inside a procedure, this line hsecs SELECT INTO pseudoRandomSeed OF V$ TIMER;

    failed to compile with error: "Error (19.43): PL/SQL: ORA-00942: table or view does not exist. What is the reason why I can run the query outside of the procedure, but not on the inside? And how to fix it?

    I tried to GRANT SELECT on the view SYS.v_$ timer to my user. But I don't know the SYS pwd and wonder if it would be the solution. Because my account is already the admin of the schema.

    Can you please suggest a solution or links to documentation topics where I can continue the investigation.

    Thaks in advance for any help.

    V_$ TIMER is owned by SYS. Ask your DBA or connect as SYSDBA and issue:

    GRANT SELECT ON V_$TIMER TO your-username;
    

    Then log in as your user name and the compilation.

    SY.

  • Exception management - inside the procedure

    Hello

    I'm trying to insert records into our target within a cursor table.

    (For after the analysis of the values of the Source table and to make changes in the format of the value and insert into the target table)

    I need to capture the exception within the cursor and save these exception in an error table.

    I use the exception within the cursor for loop block.

    example code:

    C1 loop c_cursor1

    Start

    ... Insert the statement after the analysis of the values...

    exception

    while others

    then

    DBMS_OUTPUT. Put_line (' error code: ' |) SQLCODE);

    dbms_output.put_line (' error: ' |) SQLERRM);

    end;

    end loop;

    Examples of exception scenarios:

    1)

    Error report:

    ORA-01476: divisor is equal to zero

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 165

    ORA-06512: at line 3 level

    01476 00000 - "the divisor is equal to zero.

    Error code: - 1476

    Error message: ORA-01476: divisor is equal to zero

    2)

    Error report:

    ORA-12899: value too large for column 'APX_DEVELOPMENT '. "" "" RG_ORIGINATOR '. "" CREATED_BY' (real: 14, maximum: 10)

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 133

    ORA-06512: at line 3 level

    12899 00000 - "value too large for column %s (actual: %s, maximum: %s)).

    Error code: - 12899

    Error message: ORA-12899: value too large for column 'APX_DEVELOPMENT '. "" "" RG_ORIGINATOR '. "" CREATED_BY' (real: 14, maximum: 10)

    I use SQLCODE and SQLERRM to capture the codes and messages.

    But how to capture the package or the procedure name, and line number.

    for example. I need to capture something like below

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 165

    ORA-06512: at "APX_DEVELOPMENT. PKG_CUSTOMER_FEDERATION', line 133

    How to get to this

    Thanks in advance for your help.

    Please let me know for further details.

    Use dbms_utility.format_error_backtrace... Check below...

    http://docs.Oracle.com/database/121/ARPLS/d_util.htm#i1003874

    Thank you

    Ann

  • How to call the page url inside the procedure.

    Hello


    I'm not exhibition in plsql.
    I have some problem in utl_http link.

    I create a procedure. The procedure has been compiled successfully. But the page url does not open...

    I have attached the procedure,

    create or replace procedure p (number of mob)
    IS
    long l_page;
    l_url varchar2 (25000 char);

    Start
    null;
    l_page: = utl_http.request ("http://www.yahoo.com");
    end;


    Please tell me the solution for this problem...


    I await your response.

    Thank you
    Sasi.

    This is a duplicate thread:

    How to open the web page in pl/sql

    the OP doesn't seem to understand the difference between a web browser and a programming language... I can't say I've ever had to explain the difference before...

    Let's say that... the butterflies are not somehow similar to razors electric...

  • Should I run / have several AV programs and GOT on my computer?

    I have two computers (Vista OS) desktop and a laptop (OS-Windows 7). Do I need to have any other AV/AS programmed on/running on my computers?

    Hello

    You should have only one protection on each major system however antivirus/security program
    on all of them at once. Two must not be installed on the computer running much less because
    the remains of those even uninstalled can cause problems. Remove always unused antivirus/security
    programs using their Creator removal tools.

    List of tools to remove the antivirus/security programs.
    http://social.answers.Microsoft.com/forums/en-us/msestart/thread/407bf6da-C05D-4546-8788-0aa4c25a1f91/

    ================================

    Here's what I use and recommend: (these are all free and works very well.)

    Avast and Prevx proved extremely reliable and compatible with all I have
    launched on them. Microsoft Security Essentials and Prevx have also proven to be very
    reliable and compatible. Use MSE or Avast and Prevx, Prevx 3 but not all.

    Avast Home free - stop any shields is not necessary except leaving Standard, Web, and
    Operation of the network.

    Prevx - Home - free

    Windows Firewall

    Windows Defender (is not necessary if you use MSE)

    Protected IE - mode

    IE 8 - SmartScreen filter WE (IE 7 phishing filter)

    I also IE always start with asset if filter InPrivate IE 8.
    (It may temporarily turn off with the little icon to the left of the + bottom
    right of IE)

    Two versions of Avast are available 5.x and 4.8 x

    Avast - home - free - 5.x stop shields you do not use (except files, Web, network, &)
    Shields of behavior) - double click on the icon in the Notification area - real time Orange - click on the
    Shield that you want to stop - STOP. To stop the Orange icon to show an error indicator-
    Click on the Orange icon - top right - settings - click on the status bar - uncheck shields you
    disabled - click OK
    http://www.avast.com/free-antivirus-download

    Avast 4.8 x - home - free - stop shields, you don't need except leaving Standard, Web,.
    and the network running. (Double-click the blue icon - look OK. - upper left - Shields details
    Finish those you don't use).
    http://www.avast.com/free-antivirus-download#TAB4

    Or use Microsoft Security Essentials - free
    http://www.Microsoft.com/Security_Essentials/

    Prevx works well alongside MSE or Avast

    Prevx - home - free small, fast, exceptional protection CLOUD, working with other security
    programs. It is a single scanner, VERY EFFICIENT, if it finds something come back here
    or use Google to see how to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp  <-->

    PCmag - Prevx - Editor's choice
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Also get Malwarebytes - free - use as scanner only. If you ever think malware and that
    would be unusual with Avast and occasional Prevx running with the exception of a low level cookie
    (not much), to UPDATE and then run it as a scanner. I have a lot of scanners and they
    never find anything of note that I started to use this configuration.

    http://www.Malwarebytes.org/

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • How can I reset or change the password of the laptop, if it is only given to me and im using a guest account

    So I got a laptop for my aunt, sound in windows vista. There are 3 accounts and 2 of them are protected by Word. I can use only one who doesn't have a password. I want to know if there is a way I can reset or remove the password of the administrator. The owner does not remember the password she more used then if there in any case that you can help me to delete or change the password, please let me know. I really need to install applications, but I can't because it's ask the admin password.

    Hello

    If this is not applicable, you must reinstall the operating system.

    "What to do if you forget your Windows password"

    http://Windows.Microsoft.com/is-is/Windows-Vista/what-to-do-if-you-forget-your-Windows-password

    "If you forget the administrator password, and you do not have a password reset disk or another administrator account, you will not be able to reset the password. If there is no other user account on the computer, you will not be able to log on Windows and you need to reinstall Windows. »

    http://support.Microsoft.com/kb/189126/en-us

    Tools third password

    Some third-party companies claim to be able to bypass the password that have been applied to files and features that use Microsoft programs. For legal reasons, we cannot recommend or endorse any of these companies. If you want to help to break or reset a password, you can locate and contact a third party company for this help. You use these third-party products and services at your own risk.

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Microsoft prohibits any help given in these Forums for you help bypass or "crack" passwords lost or forgotten.

    Here's information from Microsoft, explaining that the policy:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/keeping-passwords-secure-Microsoft-policy-on/39f56ef0-5d68-41AD-9daa-6e6019c25d37

    See you soon.

  • What are the best practices for creating only time data types, and not the Date

    Hi gurus,

    We use 12 c DB and we have a requirement to create the column with datatype of time only, if someone please describe what are the best practices for the creation of this.

    I would strongly appreciate ideas and suggestions.

    Kind regards
    Ranjan

    Hello

    How do you intend to use the time?

    If you are going to combine with DATEs or timestamps from a other source, then an INTERVAL DAY TO SECOND or NUMBER may be better.

    Will you need to perform arithmetic operations on time, for example, increase the time to 20%, or take an average?   If so, the NUMBER would be preferable.

    You are just going to display it?  In this case, DAY INTERVAL in SECONDS, DATE or VARCHAR2 would work.

    As Blushadow said, it depends.

  • I have one and a 5 s iPhone, videos do not show. The file looks like to only as a picture and not the actual video. Download photos perfectly. How can I solve the problem of the video? Video is on VGA is said by the way, please help

    Help

    What you trying to do? Transfer files between iPad and iPhone or what? Please give more details.

    That means "the video is on VGA? VGA is the old connector between a computer and a monitor.

    Videos on iOS Photos have thumbnails which resemble pictures with a small camera icon and the playing time. But when you click on them, they play.

  • to do that the terrible should get explore to open a file and print it shame on you I have firefox as my browser for a long time b

    tried to print a form and could not print using the browser firefox open and print without problem. I can send you the page if you wish.

    is the form a pdf file? There are currently known issues with firefox's built-in pdf viewer. to avoid that by using a plugin third pdf - adobe like - you can go to firefox options > applications & scroll down and set the default action for the portable document (pdf) format.

    How to disable the built-in PDF Viewer and use another Viewer

  • Why is the cloud creative mobile applications only available for iphone and ipad? I need basic apps Android

    Where mobile applications base android? Why people do you assume that everyone uses an ipad or iphone

    I want applications android mobiles!

    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform for feature requests

  • I can't program my defrag to run only the Cancel button is turned on, not on the ok button

    How can I program my Defrag to run every week? When I try only the Cancel lights if I hit the ok button nothing happens

    How can I program my Defrag to run every week? When I try only the Cancel lights if I hit the ok button nothing happens

    Have you seen this ttorial?
    http://www.Vistax64.com/tutorials/72832-Disk-Defragmenter.html

    Excerpt:

    This will show you how to enable or disable the Disk Defragmenter automatically run according to a schedule and how to change the schedule to run Disk Defragmenter when you want it to run.
    PS Suggestion only...
    I would use Auslogics disk defrag instead.
    It's free.
    It only runs when you turn it on.
    It gives the options of what disk to defragment.
    It takes less than 20 minutes.
    It displays on the screen there is progress.
    It gives you a report summary at the end.
     
    If you are interested, here is the link to download Auslogics:
  • Run the procedure after the application deployment

    Hi all

    I faced a small question.
    When I deploy my application to another server - it must run a procedure (this means that the procedure must be run once immediately after successful deployment).
    It takes to update some records in the system tables.

    Apex supports characteristic or something like that?

    APEX 4.1

    Thank you

    Published by: Rod 13.05.2013 confidence 0:56

    Cane Trust wrote:

    I faced a small question.
    When I deploy my application to another server - it must run a procedure (this means that the procedure must be run once immediately after successful deployment).
    It takes to update some records in the system tables.

    Apex supports characteristic or something like that?

    APEX 4.1

    How do you deploy your application? The documentation contains all the details of creating a packaged application with all dependencies for database included as items of support. Your procedure must be performed in one of these objects support scripts.

Maybe you are looking for

  • Problems uploading images to photos on Pages

    I recently updated my computer iMac to El Capitan. For years, I hung pictures from iPhoto to a document from the Page successfully to make Christmas letters, posters, etc.. Now I can not do. I used to go to the media on the toolbar and iPhoto would c

  • HP-S5-1014: s5-1014 green blinking on power supply

    I have a S5-1014 HP that I'm fixing for a friend.  I was told he was "struck by lighting.  I know that the mouse and keyboard no longer works which was connected to the computer.  I tried pluggin a power cord to the power outlet, but the computer doe

  • Photosmart 7525 eprint do not print

    I put eprint in place and when I send something it will not only print the computer says there is a problem and it is supposed to be an error on the printer control panel.  BUT there is no error message.  I have updated firmware update.

  • Photosmart D5460 driver for win 7 64 bit moved

    Photosmart D5460 driver for win 7 64 bit moved

  • Cannot run Windows backup because I get an error message.

    original title: malfunction backup cannot back up my files because the backup program continues to show failure. It may take a dvd but when I put in the second, I was a failure. I'm using memorex DVD-R for backup. Save seems to freeze or stop working