How to dynamically retrieve the host name of the server APEX?

Hello

I have request Express installed 3.1.0.00.32 on 2 servers in a configuration of dataguard, which means I can failover from one server to the other.

The problem I encounter is the URL. I wrote a beautiful PL/SQ/procedure to send mail, in the body of the mail it is a URL that points to a hard-coded host name (teleg1:7777)
BEGIN
....
 l_url := 'http://teleg1:7777/pls/apex/f?p=109:29:::NO::P29_ID:'||C1.ID ;
....
It can occur I the digital switchover to the other server which name would be teleg2, but then the url change because the host name is "teleg2:7777".

It should be like this:
 l_url := 'http://teleg2:7777/pls/apex/f?p=109:29:::NO::P29_ID:'||C1.ID ;
Is there a way to retrieve the host name of a global variable of APEX, something like G_HOSTNAME? Or from another source? As a result, the procedure is as follows:
 l_url := 'http://||G_HOSTNAME||:7777/pls/apex/f?p=109:29:::NO::P29_ID:'||C1.ID ;
The varialbe G_HOSTNAME would contain etiher "teleg1" or "teleg2" according to the APEX server that executes the PL/SQL procedure at this time.

I hope I am clear.

Good day!

Christian

Use the functionowa_util.get_cgi_env . You'd be interested in CGI environment variables SERVER_NAME and SERVER_PORT.

Tags: Database

Similar Questions

  • How to dynamically change the host name in the Pages of the URL of the APEX

    Dear gurus,

    Please advise me on how to dynamically change the hostname in the URL used in the pages of the APEX.

    For example: I have the below URL in one of the apex pages.
    owa_util. REDIRECT_URL ("http://adminlxdb03.texas.org:7780/pls/htmldb ' |' / f?") p ='|| v ('APP_ID') | ": 151:" | " v ('APP_SESSION'));

    in the case of a Migration of this apex from one server to another (for example, TEST the PROD box), this / these pages are wrong because the different host id name in the PROD box.

    Is it possible that we can dynamically change the hostname in the URL used in the pages of the APEX.

    for example
    owa_util. REDIRECT_URL ("http://adminlxdb03.texas.org:7780/pls/htmldb ' |' / f?") p ='|| v ('APP_ID') | ": 151:" | " v ('APP_SESSION'));

    should become

    owa_util. REDIRECT_URL ("http://adminetuxdb09.texas.org:7780/pls/htmldb ' |' / f?") p ='|| v ('APP_ID') | ": 151:" | " v ('APP_SESSION'));

    It's adminlxdb03.texas.org (TEST) at adminetuxdb09.texas.org (PROD).

    If the page has no error...

    Please notify.

    Thank you
    Sheik

    You don't need to provide the hostname while redirecting in the pages of the apex

    owa_util. REDIRECT_URL ('f? p ='| v ('APP_ID') |) ": 151:" | " v ('APP_SESSION'));

    should work just fine.

  • Crash in firefox that I open it: How can I retrieve the addresses of Web sites in my bookmark? If all is lost?

    Firefox crashes when I open it (Mac OS). How can I retrieve the addresses of all the Web sites in my bookmarks before attempting to reinstall firefox?

    ID of the Crash

    c427216d-8a2f-8b48-Beca-50074acfbc6b

    User Agent

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; TI - TI) AppleWebKit/533.16 (KHTML, like Gecko) Safari/533.16 Version/5.0

    Yes, all your personal information is stored in your profile folder.

    Again, see back up and restore the information contained in the profiles of Firefox to manually back up your profile folder. This article also contains information about what information is stored where (for example, Places.sqlite for bookmarks and history).

    Then save that manually uninstall Firefox and delete the profile folder. Then you should be able to do a completely clean install and then restore your settings accordingly.

  • Satellite A505 - How can I retrieve the registration information

    I bought a Toshiba A505 in March 2010. Currently, I registered the product with Toshiba. This laptop was stolen. How can I retrieve the registration information. Unfortunately, I don't have the serial number or product.

    Thank you.

    Hello

    You should get in touch with Toshiba using the stolen units interface.
    http://EU.computers.Toshiba-Europe.com/innovation/generic/STOLEN_UNITS_SUPPORT

    Here, you should go to the point: * registration *.

    Hope I could help you.

    Welcome them

  • How do to retrieve the message not sent wrong email address

    I need to change the address of electronic mail for a message not sent - how can I retrieve the original e-mail so I can change the bad e e-mail address and or copy the letter sent

    It is impossible not to have an Outbox.

  • How can I retrieve the original online windows

    DEAR SEAR
    TOW MONTHS AGO, I GOT THE NEW COMPUTER COMPANY OFFICE IN MY COUNTRY CALLED NATCO AND I USE IT SINCE A MONTH AFTER I HAVE INSTALLED WINDOWS ORIGINAL LOSS, I DON'T KNOW WHY. I HAVE NO CD OF RESTORATION,
    DESCRIPTION OF THE OFFICE
    HP COMPAQ 8100 ELITE CONVERTIBLE MINITOWERS PC ENERGY STAR
    INSTALLED WINDOWS: WINDOWS 7 PRO OA MEA
    I HAVE THE ORIGINAL FOR WINDOWS SERIAL NUMBER.
    HOW CAN I RETRIEVE THE ORIGINAL ONLINE WINDOWS

    Computers HP recovery partition come preloaded will allow you to create a set of restore disks from Hp that can be used to retrieve all software of origin in case of major problem by tapping the key F10 or F11 permanently when the PC is first boots to the top. However, there may be times when the recovery disks are needed to restore the PC.

    If your recovery partition is not available or damaged, you must contact the manufacturer of your computer, and request that a defined recovery disk you can use to reinstall Windows 7. They could practice a small shipping and handling.

    HP recovery disk:

    http://h10025.www1.HP.com/ewfrf/wc/document?LC=en&DLC=en&cc=us&DocName=c00810334

    Another option is, if you have the COA sticker with your product key, you can download a copy of Windows 7 Professional, burn it to a blank DVD, then use the key on the sticker COST to reinstall and reactivate. You will need to go to the manufacturers website and download the correct drivers that came with your system:

    COA certificate of authenticity:

    http://www.Microsoft.com/howtotell/content.aspx?PG=COA

    Download the Windows 7 ISO Image
    Windows 7 Professional x 64 (64-bit)

    English: http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65805/X15-65805.iso

    Windows 7 Professional x 86 (32 bit)

    English: http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65804/X15-65804.iso

    ImgBurn - supporting the creation of CD more. ISO files,
    It supports a wide range of image file formats, and it's free.
    (BIN, CUE, DI, DVD, GI, IMG, MDS, NRG, PDI and ISO)
    http://www.ImgBurn.com/

    http://NeoSmart.NET/wiki/display/G/Burning+ISO+images+with+ImgBurn

    Note: Use always slower burning (4 x or 2 x) speed is offered a choice

    http://Windows.Microsoft.com/en-us/Windows7/installing-and-reinstalling-Windows-7

  • When I try to connect to my remote server the message "an ftp error occurred - cannot establish a connection to the host." How can I get the server to which to connect with dreamweaver?

    When I try to connect to my remote server the message "an ftp error occurred - cannot establish a connection to the host." How can I get the server to which to connect with dreamweaver?

    After spending most of the day on this I found that my password required to upgrade... so two of my sites are now meet Dreamweaver. And the other will be taken care by the owner of the Web site. Thank you, Nancy!

    gay

  • How to connect to the server from VPN Windows Sever?

    Hey guys, I recently created my own VPN server to connect to my home network using Windows Server 2003. I know I probably still need to do this if I don't know what I have to do, but how to connect to the server, or at least set it up in order to be logged in? I think I got the computers communicating with each other, but I think that I am running into errors of authentication. Could someone point me in the right direction with regard to what I have to do what I already have Setup? Thanks in advance.

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • don't know how to find out the server for my email information.

    I had to reinstall Windows Vista (my computer was a mess), and now I don't know how to get information on the mail server

    I don't know how to find out the server information I need

    to set up my email again.

    Also, my pictures 'lost' since I have done this?

    Hello

    Contact your ISP (Internet Service Provider); They provide your broadband / dial connection.

    Ask them to:

    1. your username with them

    2. your password with them.

    3 incoming mail POP3 server.

    4. the outgoing mail SMTP server

    All the settings that you need to come from them, not Microsoft; and they are usually happy to help you set up your e-mail program.

    You can use this guide to set up Windows Mail, too:

    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-mail-setting-up-an-account-from-start-to-finish

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

    A relocation normally wipes the hard clean everything, as part of the resettlement process.

    Two things you can try:

    1. find a windows.old folder (depends how you reinstalled Vista)

    "How to restore your personal files after performing an installation of Windows Vista or Windows 7"

    http://support.Microsoft.com/kb/932912

    2. This program has had good results in data recovery in circumstances similar to yours.

    http://www.Piriform.com/Recuva

    See you soon.

  • How can I locate the server info and start it I can send documents

    I can't send or send my 'file documents' file incorrect server. How can I locate the server info and start it I can send documents

    I have a problem, find out who is my server and then set this info in my PC so that I can send or send my files that are in my Document folders

    http://www.SimpleHelp.NET/2007/02/07/a-beginners-guide-to-setting-up-Windows-Mail/

    Link above has an easy to follow Guide to set up Windows Mail.

    Contact your ISP (Internet Service Provider).

    They offer your broad band/Dial-up connection.

    Ask them to:

    username
    password for your service account to wide band/Dial-Up with them

    Server of incoming POP3 mail
    outgoing mail SMTP server

    The above information is required to set up Windows Mail.

    ISPS are usually happy to help you set up your email account.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to connect to the server ESXI vSphere Client side WAN?

    How to connect to the server ESXI vSphere Client side WAN?

    through firewall

    I tried to open the ports 902 903, 443... and so on...

    and I tried several sites to find the solution but...

    nothing works...

    connectivity works on local network

    Help, please...

    Source Destination Port

    ESXI 443/TCP client

    ESXi 902/TCP client

    ESXi 902/TCP Client

    ESXi 902/UDP Client

    ESXi 903/TCP client

    Edit: Also check if the firewall ESXi all IP addresses are allowed to connect:

    Example:

    See attachment...

  • How can I download the server behavior extensions?

    How can I download the server behavior extensions?

    the page will have to be carried out has been an HTML page.

    You cannot use the old panels of database server & PHP on ordinary HTML files.  They need to be saved as .php files to analyze the code on the server side.

    If your remote & local test server uses PHP 5.5 or higher, I do not recommend using panels of database server & deprecated.  The code is incompatible, obsolete & non-secure.

    Further, you should be manually coding with (improved) MySQLi or PDO.

    Nancy O.

  • CF8 dev edition - how to start / stop the server?

    Mac osx - CF8 dev edition - how to start / stop the server?

    I would turn off auto CF8 start at startup and I can manually start and stop the server...

    Q: How do I configure this?

    > Now, I'm also interested to extinguish CF8.01 "auto start on startup.
    > (currently set to that now)
    >
    > Q: How can I turn off that autostart?
    >
    > Hi folks - I'm always interested in the CF on MAC OS x 10.5 server configuration to
    > * NOT * Auto Start - how can I turn off that autostart?

    I googled "cf8 osx doesn't autostart" and turned to the top this:
    http://www.Feed-Squirrel.com/index.cfm?evt=viewItem&ID=96307

    Who is? That's all a little Greek to me because I have not used a
    Mac for...

    Crikey...

    TWENTY YEARS.

    --
    Adam
    (suddenly feel old enough)

  • How can I retrieve the name of the server and the database to a system dsn

    Hello

    I am trying to create a database that will be used by many stores. Each store has its own server and the database and the access runtime version. I want to create a system dsn name, but allowing the administrator to modify the server and the database for that dsn and then, when you connect to the database, the database must be able to find this DSN and the 'new' name of the server and name of 'new' database and connect to point to this server and the database tables. I don't have a login form and I can get the name of the dsn, but I can't find a way to get the server name and database name for that dsn. Does anyone know a way to retrieve this from the registry. I can see it using regedit but have no idea on how to get this in vba access.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • How to dynamically access the SQLite result set?

    I want to dynamically access the SQLite result set. Since webworks does not support the "PRAGMA table_info (table_name); I save all newly created information tables in a single two-column table called schema. schema has two columns, table_name, and column_name.

    So I created a function to dynamically access the data in the table. I use the item = results.rows.item (i) and that the data access with item.column line.

    column is a variable that will receive the value of a schema representative of column_name. When I alert (column) I get the column_name is correct, but when I used item.column my results are "not defined".

    any advice on how to solve this issue.

    I managed to solve this issue. The solution is the following: the normal way to access the data of the variable item = results.rows.item (i) is item.column (where the column is the name of the column in the database table. To access the data dynamically, I Specifies a var col1 to assign different values in col1. I then access the data in the database using point [col1] hope that makes sense. If you need a further explanation contact me at [email protected]

Maybe you are looking for