ORA-12514: TNS:listener does not currently know of service

June 12, 2013 at 7:48 am | Posted in Oracle Developement | Leave a comment

Reblogged from Ed Stevens, DBA:

In previous posts I have explored various reasons why a client process might not be able to connect to an Oracle database. In “Help! I can’t connect to my database” I presented an overview of the process used by sqlnet to convert a connection request to a network connection descriptor and deliver that request to a listener capable of servicing the request.

Read more… 3,635 more words

Excellent article on the database listener.

Snapper Now in SQL Developer

May 26, 2013 at 8:51 am | Posted in Oracle Developement | Leave a comment
Tags: , , ,

Snapper Now in SQL Developer

Firefox 3D Web Inspector

May 20, 2013 at 2:03 pm | Posted in Oracle Developement | 1 Comment

Firefox 3D Web Inspector

This is a very cool way to inspect a web page.

Search box with light text

May 20, 2013 at 10:37 am | Posted in Oracle Developement | 5 Comments

You can often find search boxes that are pre-populated with text in a a light-weight font. When you click the box, the text disappears to make room for your search terms. The text you then type then shows in a normal-weight font.

Here are the steps to do this in Apex:

  1. Create a text field for your search box (P11_SEARCH in my example).
  2. Set the default value to “Enter Search Terms”.
  3. Set the HTML Form Element Attributes to: style=”font-weight:100″
  4. You may also want to change the Source Used attribute to “Always, replacing any existing value in session state”

This pre-populates the text box with light weight text.

Now we need a dynamic action with two TRUE actions: One to clear out the text box when it is clicked, the other to set the font-weight to normal.

Create a dynamic action “Clear Search Box”:

da1

Make sure the DA has the condition to only fire when the current value is the default value of the text box.

Set the first TRUE action to Clear the text box,

da2

and choose the text field as the affected item.

da3

Add a second TRUE action to set the font-weight to normal:

da4

 

 

When you now click the text field, the pre-populated text clears out, and you can type in a search term in normal font weight.

See the example here.

Please leave a comment if you found this useful.

Apex: Show/Hide report column with Radio Button

May 15, 2013 at 11:07 am | Posted in Oracle Developement | 3 Comments

I was asked how to hide/show a column via a radio button in a classic report in Apex.

In order to do this you need a dynamic action triggered on change of the radio group, and a small change to the report template.

First, identify the column you wish to hide. For example empno.

Create a radio group with two buttons (P10_HIDE_SHOW), with values “hide” and “show”. Select “None” for the Page Action when Value Changed.

Create a dynamic action on the radio group (Hide Show Empno):

create_da1

For the action select: Execute JavaScript Code.

create_da3

The dynamic action has to do two things: hide the column heading, then the column values. In order to hide the report column values we need to change the report template and add a rel attribute to all the column values.

rep_template

This allows the JavaScript to reference the column values.

That’s it. The radio button should now hide/show the empno column.

You can see a demo on my apex.oracle.com page.

Creating a multi level navigation menu

March 21, 2013 at 12:07 pm | Posted in Oracle Developement | Leave a comment

Reblogged from APEXPLAINED:

Click to visit the original post

This post is the third in a series of tutorials exploring the steps necessary to build custom navigation menus in Oracle APEX. The first tutorial I wrote explains how you can create a jQuery accordion-like menu. In the second tutorial, I created a vertical collapsible menu in combination with a cookie mechanism to remember the state of each panel. These two menu types suffer from one serious restriction: the menu depth level is limited to a two-level hierarchy.

Read more… 856 more words

Configuring Apex Listener Version 2

February 21, 2013 at 10:52 am | Posted in Linux, Oracle Application Express (Apex), Oracle Developement, Oracle Tools | 17 Comments

“Where is the listenerConfigure page?”

That seems to be a common question when people attempt to deploy the Apex Listener Version 2.

Version 2 of the Apex listener is very different than version one. The configuration and maintenance is no longer done through web pages, but either through the command line or through SQL Developer. In this post I’ll try to explain how to configuration via the command line is made. I’ll dedicate another post to configuring the listener through SQL Developer.

In my example I have downloaded and unzipped the apex listener into the directory /u01/cmr. You will probably choose a different path, so make sure you substitute your path whenever necessary.

Before you configure the database connection of the listener, it is good to specify the directory where the configuration files will be stored. If you don’t do that, then the config files will be stored in /tmp/apex, which is not a good place.

To specify the configuration directory for the apex listener, navigate to the directory where you unzipped the listener files (/u01/cmr) and run:

java -jar apex.war configdir /u01/cmr

Note that whenever you run the java -jar apex.war command, it changes the files inside the apex.war archive. In this case I just picked the same directory where I  unzipped the files. The listener will create an apex directory here.

Now that we know where the configuration files will be, lets configure the database connection:

java -jar apex.war setup
 $ java -jar apex.war setup
 Feb 19, 2013 1:39:11 PM oracle.dbtools.common.config.file.ConfigurationFolder logConfigFolder
 INFO: Using configuration folder: /u01/cmr/apex
 Enter the name of the database server [localhost]:
 Enter the database listen port [1521]:
 Enter 1 to specify the database service name, or 2 to specify the database SID [1]:2
 Enter the database SID [xe]:vrep
 Enter the database user name [APEX_PUBLIC_USER]:
 Enter the database password for APEX_PUBLIC_USER:
 Confirm password:
 Enter 1 to enter passwords for the RESTful Services database users (APEX_LISTENER,APEX_REST_PUBLIC_USER), 2 to use the same password as used for APEX_PUBLIC_USER or, 3 to skip this step [1]:3
 Feb 19, 2013 1:39:50 PM oracle.dbtools.common.config.file.ConfigurationFiles update
 INFO: Updated configurations: apex
 $

After this process is complete, you will find a newly created directory inside your config dir. Note that the name of the configuration folder is mentioned on top of the program output. The listener is now ready to be either run in standalone mode or to be deployed to your web server. You can run the listener in standalone mode to test the database connection:

$ java -jar apex.war standalone --apex-images /u01/apex/images

Note that I included the argument –apex-images. This will let the listener know from which directory to pull the images. In my case I unzipped the Apex installation files into /u01. When you run the command, the last line of the screen output will tell you the URL for connecting to Apex. If everything works, deploy your file to your web server.  That process hasn’t changed from version 1.
FYI: Inside the apex/ configuration directory is a file named apex.properties which contains the port number and the images directory. This file is read when the listener starts up in standalone mode.

Apex JSTree Nodes Remain Expanded After Page Refresh

February 13, 2013 at 3:30 pm | Posted in Oracle Application Express (Apex), Oracle Developement, PL/SQL | Leave a comment
Tags: , , ,

To prevent a navigation JSTree to collapse after the page has been submitted, you need to have a page or application item to hold the menu ID value, so that the JSTree can remember which node was clicked after the page was refreshed.

In the Tree Attributes page you can then set the Selected Node Page Item to that new item and then the tree will remember which node to expand when it re-loads.

In my example I’ve created an unrestricted application item AI_TREE_NODE. You can alternatively use a page zero item or a page item.

In the link column of the tree SQL statement, I set AI_TREE_NODE to the menu id.:


select case when connect_by_isleaf = 1 then 0
            when level = 1             then 1
            else                           -1
       end as status,
       level,
       "ENAME" as title,
       null as icon,
       "EMPNO" as value,
       ename as tooltip,
       'f?p=&APP_ID.:3:&APP_SESSION.::::AI_TREE_NODE:' || EMPNO as link
from "#OWNER#"."EMP"
start with "MGR" is null
connect by prior "EMPNO" = "MGR"
order siblings by "ENAME"

In the Display Attributes section of the Tree Attributes I set the Selected Node Page Item to the application item AI_TREE_NODE.

Screen Shot 2013-02-13 at 2.23.29 PM

Now, whenever you click a node, the tree will remember which node was clicked, and expand the tree accordingly.

Screen Shot 2013-02-13 at 2.28.31 PM

Thanks to Doug Gault for help on this.

Using Notepad++ with PL/SQL

January 14, 2013 at 10:54 am | Posted in Oracle Developement, PL/SQL | Leave a comment
Tags: , ,


http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files

Getting and setting Apex page item values using $v(), $s(), $v2()

January 11, 2013 at 2:06 pm | Posted in Oracle Application Express (Apex), Oracle Developement | 10 Comments
Tags: , , ,

The Apex JavaScript API has some very convenient functions to access the values of page items.

For example, if you wante to access the contents of a text field with JavaScript, would would need to reference it something like this:

$x("P2_TEXT_FIELD").value;

If the item you want to reference is a display only item, then the syntax changes:

x = $("#P2_DISPLAY_ONLY").text();

If you need to set the values of these items, the you need to use the varying syntax as well:

$x("P2_TEXT_FIELD").value = "Hello World!";

or

$("#P2_DISPLAY_ONLY").text("Hello World!");

Dealing with these various syntax constructs can be confusing. Fortunately the Apex JavaScript API makes this process much easier. To get page item values simply use $v(“<item_name>”):

x = $v("P2_TEXT_FIELD");
y = $v("P2_DISPLAY_ONLY");

To set the item values use:

$s("P2_TEXT_FIELD","Hello World!");
$s("P2_DISPLAY_ONLY","Hello World!");

See an example on my demo page.

The $v2() is handy if you need to access multiple items in an array. For example multiple selections from check boxes or from a shuttle control can be fetched as an array and handled that way in JavaScript:

myArr = $v2("P2_SHUTTLE_CONTROL");
for (idx=0; idx<myArr.length; idx++) {
  //do something with myArr[idx];
}

An example of this functionality can be seen on my demo page, where I also compare $v() and $v2() when used in an array.

Next Page »

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

Follow

Get every new post delivered to your Inbox.