Pages

Monday, September 10, 2012

How to put a hyperlink in Oracle forms.....

Hi fellas,
                  Hyperlink is something like a URL. we can click on that and it will navigate us to the relevant location where we can have information we need. First of all we need to have relevant window and canvas to display the relevant information for the users. Our hyperlink will navigate the user to this newly created canvas to show the information. You can add any item like text items, display items, tables and etc...
                  To add new hyper link, first you have to add new Text item on the canvas that you need to display the hyperlink to the user. It's better change it's Visual Attribute Group as "VA_CLICK". You don't have to write anything in the "Prompt" section to display. Because hyperlinks didn't display anything in Prompt section.  Apart from that you should set BEVEL = NONE in the property palate of the text item. You should call to the newly created canvas in  WHEN-MOUSE-CLICK trigger by using SHOW_VIEW. Apart from that we can use web.Show_Document to show the relevant page to the user. But we can use web.Show_Document from within a form which run from the web.
                 If you run the form with above modification, still you wont be able to see the hyperlink. But it's there where you placed it and you can see it's functionality by clicking on the area you placed it. To display the hyperlink, you should assign a relevant name for the item within the trigger or program unit where you populate the data to the canvas where you placed your hyperlink. Otherwise it wont get display. eg - :BLK_MAIN.HYPERLINK := Hyper Link(Hyperlink name). Then only you can view this through your form.

Thursday, July 26, 2012

How to compare two columns in a same table in a select statement and show a particular result ...

Hi Oracle fellas,

                        Some times in oracle developments, we have to compare various kinds of values, table columns and etc.. to give a comfortable out put for the users. In this process, some times we have to give them feedback by showing them some kind of status or a value putting to newly created column which is not in the related database table.
                        As an example, just imagine we have table name "Employees" and it include Emp_No, Emp_name, Previous_Year_Salary and Current_Year_Salary columns. We have to compare the previous salary with current salary and return a value as M if those two values are equal and NM if not equal. Apart from that we have to display above value in a separate column name "any name" which not include in Employees table. Just image that we are advised to not to add any new column to the related table.
All you have to do is write a simple SELECT statement and put two columns into decode function with two values you have to return accordingly. It's like,
SELECT  Emp_No, Emp_name, DECODE(Previous_Year_Salary , Current_Year_Salary, 'M', 'NM') 
FROM Employees;
Above statement will return all the fetched records with the relevant comparison and relevant newly added column values. You can put a name to new column like bellow.

SELECT  Emp_No, Emp_name, DECODE(Previous_Year_Salary , Current_Year_Salary, 'M', 'NM')  as 'any name'
FROM Employees;

Apart from this DECODE function includes lots of formulas we can use. Within DECODE function we can not only compare numbers, but also dates and characters as well.

Thursday, June 21, 2012

ORA- 12154: TNS:could not resolve service name in Oracle Formbuilder or Report builder


Hi Oracle fellas,

                            You will get above problem when you are using oracle form builder or report builder. This can happen because of various kinds of reasons. It can happen because of the error of the TNS name you are trying to connect. May be the port numbers can be wrong or something like that. You cannot connect through form builder means that form builder cannot see or find your TNSNAMES.ora file. Form builder uses the TNSNAMES.ora file and SQLNET.ora file found under the iDS suite folder - under this folder the NETWORK - ADMIN folder. Sometimes there can be syntax errors like unrelated parentheses in your TNS name. Including these kind of error makes TNS file unusable.

To overcome this problem always maintain your TNSNAMES.ora file without any errors. Keep your .ora files in proper directory.

If you are using directory naming, 
Verify that "LDAP" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the oracle net profile(SQLNET.ora).
Verify that the LDAP directory server is up and that it is accessible.
Verify that the net service name or database name used  as the connect identifier is configured in the directory.
Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP Dn as the connect identifier.

If you are using easy connect naming,
Verify that "EZconnect" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the oracle net profile(SQLNET.ora).
Make sure the host,port and service name specified are correct.
Try enclosing the connect identifier in quote marks.

Sometimes this happen when your are using particular oracle version in the first time. Reason for this kind of scenario is the problem with SQLNET.ora file. You can see few lines of statements in that .ora file. In the very first moment only first two lines were commented. Therefore you wont be able to connect to needed database via form builder or report builder. Only you have to do is comment all the lines in that file and try to connect to the database you want.

There may be different oracle products installed in your computer. Each of these products contains it's own NETWORK/ADMIN directory which is the location of .ora files. Therefore we can maintain only one TNSNAMES file for all the products in your computer. TNS_ADMIN environmental variable will allow you to do that. Take any of the TNSNAMES.ora file and put it in to a directory (like "D:\0_library") which is easily accessible and let the TNS_ADMIN environment variable point to its directory. Then do as follows,

c:\ temp>set tns_admin 
tns_admin = D:\0_library
c:\ temp

Simply log in to your database.....:)

Monday, March 26, 2012

Raise form_trigger_failure... ORACLE...

Hi Oracle fellows...:)


We all are familiar with the above phrase "Raise Form_Trigger_Failure". This statement is use  freeze the program whenever we need. Freeze means stop the whole process of the oracle program. 
Normally in Oracle forms we use this statement to freeze the form whenever an error occurred. This statement mostly helpful when you are doing higher level validations like QC validations. We can use this statement when we handle an error like prompt appropriate error message. Otherwise program will prompt an appropriate error message and will try to continue the rest of the process according to the program process and code. This will make program to prompt an Oracle error messages for user and he or she will not be able to understand those messages and will get messed up with the program.


Sometimes this statement wont work properly in WHEN_BUTTON_PRESSED trigger. Sometimes this button wont be able to freeze the form and therefore program will try to proceed with the error and will prompt an oracle error. 


This happens sometime when you are using exception handling without proper manner. I mean when trying to prompt out the exception and do nothing to handle it. Actually "Raise Form_Trigger_Failure" is an predefined exception. So in a situation like that, the program will throw you an exception without freezing it.  


For these kind of scenario, we can use above statement as below mentioned.


when form_trigger_failure
Raise Form_Trigger_Failure;


Pretty easy stuff. But you have to put these two lines within the exception handling part. It will work in a nice and smooth manner...

Sunday, March 18, 2012

FRM-40735:ON-ERROR trigger raised unhandled exception ORA-06508

After converting older version of oracle forms to forms 10g using forms Migration Assistant, you are not be able to open the application or log in to the application via web. When access from developer suit 10g, it will run without any problems. One of the problem could be the related ORACLE LIBRARY PATH which attached to it. Some times this can happens when you are changing the library path according to the module or work area you work at that moment.


In older versions of forms the library path is mapped to the client pc and the forms application refer to the mapped drive letter. In the web we couldn't find specific path. It is relative. It will automatically refer the path.


If you have above mentioned problem, you will get message from oracle form builder. It says cannot attache specific libraries to your form source. Sometimes you wont get this message but wont be able to open the form. when you look in to the form source in form builder, you will see that form didn't include any library. 


There's few solution available for this matter. 

  • Open the form in Oracle form builder. Click on Attached library and plus sign item on Object Navigator.  Locate the need .plls and press YES on the message which ask whether to remove path or not.
  • Go to the regedit through Command Prompt. Go to forms_path if you are  working with 10g2 , otherwise go to forms90_path and enter the related library path to that.
  • Go to the Oracle folder where installed it in your computer and go to the forms folder if you are using oracle 10g2. Otherwise go to forms90 folder. In that folder, go in to the server folder and you can find ENV file named Default. open it on notepad or wordpad. It includes something like "FORMS_PATH" if you are using 10g2. Otherwise "FORMS90_PATH" give the related library to that path and save it. Now whole forms is under your control. 
Now you can open the form and access via web successfully. 


Additional....

  • Don't use long paths for Library folder.
  • Keep the latest libraries which are in SVN.
  • Always replace the regedit path and default.env path when you are changing the module or oracle version accordingly.
  • Oracle 10g1 use FORMS90 AND Oracle 10g2 use FORMS.

Thursday, December 29, 2011

How to create a Password Protected folder in Windows 7....

Hi folks,

We all have various kinds of personal things in our computers. Because of some reasons we want to keep those things personal. But it's hard to do that if we are sharing one computer among few people. Therefore we have to our own folder which has password to protect it from other viewers. Below steps will help you to create a hidden folder and password protected files.

  • Create a new folder and name it whatever you would like.
  • Open the folder, right click on a blank area in it, then select New and then select Text Document from the pop up menu.
  • Open the text file you just created by double clicking on it and copy / paste in the following text
cls
@ECHO OFF
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

In the above code, replace the key PASSWORD_GOES_HERE with the password you want to use. For example, if your password is 123 then,
if NOT %pass%== 123 goto FAIL

  • Save your new file in .bat format with a complete file name being locker.bat. To do this, make sure to change the Save as type: to All Files(*.*).
  • In the folder you created earlier, double click the locker.bat file and there will now be a new folder name Private where you can put anything you want


  • Upon existing, double click on the locker.bat file again. It will prompt you to answer weather you want to lock your folder or not. Press Y and the folder will disappear. 
  • In order to retrieve the folder, all you have to do is double click the locker.bat file and enter the password which you set in step 4 and the folder will be appear again and you can access. 

Wednesday, December 21, 2011

Trick to Automatically shutdown PC in Windows

Hi folks,

Sometimes we were running virus scan, huge file downloads and stuff like that in our computers. those things might take few hours to get it done. Therefore we might not be able to sit in front of the computer until those process get done. In a situation like that, we wont be able to shut the computer after complete those process. therefore it's really helpful if we have some one to do that for us.

There are lot of third party softwares available which can do this for us. these softwares can schedule the shutdown process. By using this method we can shutdown our PC using Windows Scheduler.
  • Go to Start and type Task Scheduler in search box and press enter.
  • You will get a new window and click on the Action and then lick on the Create Basic Task.

  • In the Name field give any name for your task and then click on next button.
  • Select the delay(Daily, weekly, etc) after which you want to repeat this task and click on the next button.
  • Now specify the time at which when you want this task tom execute and click on the next button.

  • Now select Start a Program and then click on the next button.
  • Browse the program which you want to execute and click on the next button.
  • For shutdown copy and paste this location.
    C:\Windows\system32\shutdown.exe

  • After this click on the Finish button.
If someone is logged-on your PC at the execution time of the task, he/she is given one minute to save all data which is open before the computer shutdown.
Task scheduler can also be use to schedule other programs.Even Google Chrome uses Task Scheduler to run the Automatic Update.

Thursday, December 1, 2011

Change the size of the virtual memory paging file.....

You must be logged on as a Administrator or a member of Administration group to do this. If your computer is connected to a network, network policy settings may also prevent you of completing this procedure.



  • Click and open Control Panel.
  • Click Performance and Maintenance and then click System.
  • On the Advanced tab, under Virtual Memory, click Change.
  • Under drive (volume), click the drive that contains the paging file you want to change.
  • Under Paging file size for selected drive, click Custom size.
  • Type a new paging file size in megabytes in the Initial size (MB) or Maximum size (MB) box, and then click Set.
If you decrease the size of either initial or maximum page file settings, you must restart your computer to see the effects on those changes. Increases typically do not require a restart.

To have windows choose the best paging file size, click System managed size.

For best performance, do not set the initial size to less than the minimum recommended size under Total paging file size for all drives. The recommended size is equivalent to 1.5 times the amount of RAM on your system.


Using memory in your storage device to speed up your computer....

Hi folks,

Recently I'm having an issue with my CPU memory. Actually is about RAM capacity. I want to increase my RAM capacity to speed up my computer. ReadyBoost helped me to do this. ReadyBoost can speed up your computer by using storage space on most USB Flash drives and Flash Memory Cards. When you plug a ReadyBoost - compatible storage device to your computer, the Autoplay dialog box offers you the option to speed up your computer by using ReadyBoost. If you select this option, you can choose how much memory on the device to use for this purpose.

When you setup a device to work with ReadyBoost, windows shows you how much space it recommends you allow it to use for optimal performance. For ReadyBoost  to effectively speed up your computer, the flash drive or memory card should have at least 1Gb of available space.

You can enable or disable ReadyBoost for a specific flash drive or other removable storage devices.



 Here are some tips on what to look for when selecting a USB flash drive or memory card to use with ReadyBoost .


  • The minimum amount of available space recommended is 1Gb.
  • For best results, use a storage device with available space of  at least double the amount of memory in your computer (RAM).
  • To work with ReadyBoost, storage device must support USB 2.0 or higher.
  • For best results, plug the device directly to the computer instead of using external cables or hubs.
If your computer has a hard disk that uses solid-state drive (SSD) technology, you might not seen an option to speed up your computer with ReadyBoost when you plug in a USB flash. You may instead receive a message " ReadyBoost is not enable on this computer because the system disk is fast enough that ReadyBoost  is unlikely to provide any additional benefit. " This is because some SSD drivers are so fast they're unlikely to benefit from ReadyBoost.

In some situations, you might not be able to use all of the memory on your device to speed up your computer. For example, some memory devices contain both slow and fast flash memory. But ReadyBoost  can only use fast flash memory to speed up computers.

This function is currently available only on WINDOWS 7 operating system.