--------------------------------------------------
you may face this problem
that is your form becomes very slow after running it on Sun JRE instead of Oracle jinitiator
to solve this problem :
open basejpi.htm and add this parameter
--------------------------------------------
--------------------------------------------
Monday, August 24, 2009
problem with java plugin for mozilla or firefox with forms
--------------------------------------------------
If you replaced oracle Jinitiator or JRE, you may not unable to run forms using Firefox or Mozilla
To solve this problem edit formsweb.cfg
jpi_mimetype=application/x-java-applet
If you replaced oracle Jinitiator or JRE, you may not unable to run forms using Firefox or Mozilla
To solve this problem edit formsweb.cfg
jpi_mimetype=application/x-java-applet
Wednesday, July 8, 2009
Installing Oracle on DHCP server
--------------------------------------------------
If you are using DHCP or Your computer is not connected to a local network, You have to Follow these steps before beginning installation for Oracle Database
1-ADD Microsoft loopback adapter
To install the Microsoft Loopback Adapter, follow these steps:
1-Go to Start | Control Panel | Add Hardware.
2-In the introductory dialog box, click Next.
3-Select Yes, I Have Already Connected The Hardware, and click Next.
4-Scroll to the bottom of the Installed Hardware list box, select Add A New Hardware Device, and click Next.
5-Select the Install The Hardware That I Manually Select From A List (Advanced) option, and click Next.
6-Under Hardware Types, select Network Adapters, and click Next.
7-Under Manufacturer, select Microsoft.
8-Under Network Adapter, select Microsoft Loopback Adapter.
9-Click Next twice, and click Finish.
Assign a non-routable IP like"192.168.1.1" to Loopback Adapter
don't assign xxx.xxx.xx.xx to network adapter. because that's usually reserved for default router. Use 192.168.1.1
Go to c:\window\system32\drivers\etc
open hosts file
add at the end
192.168.1.1
Note: is your computer name
Now begin installing oracle on you PC
If you are using DHCP or Your computer is not connected to a local network, You have to Follow these steps before beginning installation for Oracle Database
1-ADD Microsoft loopback adapter
To install the Microsoft Loopback Adapter, follow these steps:
1-Go to Start | Control Panel | Add Hardware.
2-In the introductory dialog box, click Next.
3-Select Yes, I Have Already Connected The Hardware, and click Next.
4-Scroll to the bottom of the Installed Hardware list box, select Add A New Hardware Device, and click Next.
5-Select the Install The Hardware That I Manually Select From A List (Advanced) option, and click Next.
6-Under Hardware Types, select Network Adapters, and click Next.
7-Under Manufacturer, select Microsoft.
8-Under Network Adapter, select Microsoft Loopback Adapter.
9-Click Next twice, and click Finish.
Assign a non-routable IP like"192.168.1.1" to Loopback Adapter
don't assign xxx.xxx.xx.xx to network adapter. because that's usually reserved for default router. Use 192.168.1.1
Go to c:\window\system32\drivers\etc
open hosts file
add at the end
192.168.1.1
Note:
Now begin installing oracle on you PC
Monday, July 6, 2009
service started and Stoped
--------------------------------------------------
OracleOraHome10g service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alert service."
solution
Check windows/system32/drivers/etc/hosts for the hostname and IP of the server you are using for the OMS, you may need to add an entry here to resolve a DNS problem.
OracleOraHome10g service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alert service."
solution
Check windows/system32/drivers/etc/hosts for the hostname and IP of the server you are using for the OMS, you may need to add an entry here to resolve a DNS problem.
Installing and running oracle databse on standalone PC
--------------------------------------------------
- go to control panel
- add new hardware then add new networkadapter
- after adding the network adapter, go to network setting and add a static IP address
- then start installation
- go to control panel
- add new hardware then add new networkadapter
- after adding the network adapter, go to network setting and add a static IP address
- then start installation
Sunday, July 5, 2009
Some Useful WIndow Conmmands
--------------------------------------------------
dxdiag to find specifications for your computer
dxdiag to find specifications for your computer
Monday, June 29, 2009
Expand and Collapse tree
--------------------------------------------------
To Collapse tree nodes
PROCEDURE collapse_tree IS
vnode ftree.node;
vhtree ITEM;
vstate varchar2(30);
BEGIN
-- Search the tree identifiant --
vhtree := Find_Item('TREE_BLOCK.HTREE');
-- Search the root --
vnode := Ftree.Find_Tree_Node(vhtree, '');
-- Collapse all nodes --
WHILE NOT ftree.ID_NULL(vnode) LOOP
vstate := Ftree.Get_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE);
IF vstate = Ftree.EXPANDED_NODE THEN
Ftree.Set_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
END IF;
vnode := Ftree.Find_Tree_Node(vhtree, '', Ftree.FIND_NEXT,Ftree.NODE_LABEL, '', vnode);
END LOOP;
END;
To Expand tree nodes :
PROCEDURE explose_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('BL_TREE.MENU');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- Expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
END LOOP;
END;
To Collapse tree nodes
PROCEDURE collapse_tree IS
vnode ftree.node;
vhtree ITEM;
vstate varchar2(30);
BEGIN
-- Search the tree identifiant --
vhtree := Find_Item('TREE_BLOCK.HTREE');
-- Search the root --
vnode := Ftree.Find_Tree_Node(vhtree, '');
-- Collapse all nodes --
WHILE NOT ftree.ID_NULL(vnode) LOOP
vstate := Ftree.Get_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE);
IF vstate = Ftree.EXPANDED_NODE THEN
Ftree.Set_Tree_Node_Property(vhtree, vnode, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
END IF;
vnode := Ftree.Find_Tree_Node(vhtree, '', Ftree.FIND_NEXT,Ftree.NODE_LABEL, '', vnode);
END LOOP;
END;
To Expand tree nodes :
PROCEDURE explose_tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('BL_TREE.MENU');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- Expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
END LOOP;
END;
Wednesday, June 17, 2009
How to replace oracle JInitiator with other Native Java Virtual Machine?
--------------------------------------------------
1- Open forms\server\ formsweb.cfg
2- Search for [JPI] section. This section exists by default.
3- You now will add three new parameters (jpi_download_page, jpi_classid, jpi_codebase)
[jpi]
baseHTMLJInitiator=basejpi.htm
jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_09/index.html
jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
Notes:
You can modify the partion that you call and add the three previous parameters mentioned above.
For further readings you may read Forms9i or forms10g Configurations
1- Open forms\server\ formsweb.cfg
2- Search for [JPI] section. This section exists by default.
3- You now will add three new parameters (jpi_download_page, jpi_classid, jpi_codebase)
[jpi]
baseHTMLJInitiator=basejpi.htm
jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_09/index.html
jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
Notes:
You can modify the partion that you call and add the three previous parameters mentioned above.
For further readings you may read Forms9i or forms10g Configurations
how to create journalling tables and thier triggers
--------------------------------------------------
create Journalling tables:
1. go to http://iai2.iai.org.kw:7778/forms/frmservlet?config=hsd65_utilities
2. Productivity Boosters --> Data Layer --> Logical Database Design (DB.010)
3. click on Maintain journal tables
4. select the names of Tables to be journaled, then click on run
5. generate th journal tables from DB Admin and grant roles to ADMIN and APPROVE
6. you don't need to generate CAPI for the journal table from the utilities, just generate the table from DB admin and then generate Table API from the Server model.
7. in the properites of the table to be journalled , put Journal in the notes filed
create journalling triggers:
1.go to http://iai2.iai.org.kw:7778/forms/frmservlet?config=hsd65_utilities
2. Productivity Boosters --> Business Logic Layer --> Rule Layer - CDM RuleFrame --> Standar rule patterns
3. click on Maintain Journalling Business Rules
4. Select the tables to be journaled, then click on run
5. go to the tables triggers in the Server Model and update the logic to insert the required information in the journalling tables.
6. jenerate the table TAPI and CAPI.
Notes:
please note that when you pass the columns in arguments of the journalling triggers, name them as old. ex: P_OLD_MGH_ID, P_OLD_ID. define them as columns, and map them to the corresponding columns in table.
you can check the pms_activities t
Labels:
using HeadStart version 6.5
Tuesday, June 9, 2009
What is the difference between ROWNUM and ROWID
--------------------------------------------------
This artical is Quoted from http://thinkoracle.blogspot.com/2005/10/rownum-and-rowid.html
ROWNUM and ROWID
Questions:
How do I limit the number of rows returned by a query?
How do I write a query to get the Top-N salaries from the employee table?
How can I add unique, sequential numbers to an existing table?
How can I differentiate between two completely identical rows?
How can I find a faster way to retrieve a queried row?
How can I find the last row processed in a big batch?
There is one thing all these questions have in common: the answer involves either ROWNUM or ROWID.
So what is ROWNUM and ROWID?
First of all, both are covered in the SQL Reference, Basic Elements of Oracle SQL, Chapter 2:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540.pdf
They are also both referred to as pseudo-columns. That is, they are not "real" columns that will show up when you DESC a table. They don't actually exist anywhere in the database. But they're available for you to use.
In fact, ROWNUM only exists for a row once it is retrieved from a query. It represents the sequential order in which Oracle has retrieved the row. Therefore it will always exist, be at least 1, and be unique (among the rows returned by the query). Obviously it will change from query-to-query. Let's look at a quick example:
Ok so let's say we want the 5 highest paid employees. Should be easy:
Whoops! Turns out ROWNUM is assigned before results are ordered, not after. Knowing that, we can write it like this:
What about ROWID? ROWID actually represents the physical location of the record/row in the database. That being the case, it is (according to Oracle documentation) the fastest way to retrieve a particular row. Faster than an index, even.
Can you use ROWID to differentiate between duplicate rows?
Yes, you can. Since it actually represents the physical location of a row, no two rows within the same table will have the same ROWID. Notice the caveat I added: within the same table. If you're using clustering, two records from different tables could theoretically share the same ROWID.
Do ROWIDs change?
Yes, especially with index organized or partitioned tables. Because ROWIDs represent the physical location of a record/row, the ROWID will change every time the record is physically moved.
Can you use ROWID as a primary key?
No, that's not advisable. While the ROWID will be unique, you would ideally want to use a primary key that doesn't change.
How do you use ROWID to figure out what was the last record that was processed?
Using DBMS_SQL.LAST_ROW_ID to get the ROWID of the last row processed.
You'll see ROWNUM and ROWID pop up occasionally within solutions to problems on AskTom and various Discussion Forums, so I recommend adding it to your own toolbelt as well.
How do I limit the number of rows returned by a query?
How do I write a query to get the Top-N salaries from the employee table?
How can I add unique, sequential numbers to an existing table?
How can I differentiate between two completely identical rows?
How can I find a faster way to retrieve a queried row?
How can I find the last row processed in a big batch?
There is one thing all these questions have in common: the answer involves either ROWNUM or ROWID.
So what is ROWNUM and ROWID?
First of all, both are covered in the SQL Reference, Basic Elements of Oracle SQL, Chapter 2:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540.pdf
They are also both referred to as pseudo-columns. That is, they are not "real" columns that will show up when you DESC a table. They don't actually exist anywhere in the database. But they're available for you to use.
In fact, ROWNUM only exists for a row once it is retrieved from a query. It represents the sequential order in which Oracle has retrieved the row. Therefore it will always exist, be at least 1, and be unique (among the rows returned by the query). Obviously it will change from query-to-query. Let's look at a quick example:
scott@Robert> SELECT ROWNUM, ENAME, SAL
2 FROM EMP;
ROWNUM ENAME SAL
---------- ---------- ----------
1 SMITH 800
2 ALLEN 1600
3 WARD 1250
4 JONES 2975
5 MARTIN 1250
6 BLAKE 2850
7 CLARK 2450
8 SCOTT 3000
9 VOLLMAN 5000
10 TURNER 1500
11 ADAMS 1100
12 JAMES 950
13 FORD 3000
14 MILLER 1300
Ok so let's say we want the 5 highest paid employees. Should be easy:
scott@Robert> SELECT ROWNUM, ENAME, SAL
2 FROM EMP
3 WHERE ROWNUM < 6
4 ORDER BY SAL DESC;
ROWNUM ENAME SAL
---------- ---------- ----------
4 JONES 2975
2 ALLEN 1600
3 WARD 1250
5 MARTIN 1250
1 SMITH 800
Whoops! Turns out ROWNUM is assigned before results are ordered, not after. Knowing that, we can write it like this:
scott@Robert> SELECT ENAME, SAL
2 FROM (SELECT ENAME, SAL FROM EMP ORDER BY SAL DESC) E
3 WHERE ROWNUM < 6;
ENAME SAL
---------- ----------
VOLLMAN 5000
SCOTT 3000
FORD 3000
JONES 2975
BLAKE 2850
What about ROWID? ROWID actually represents the physical location of the record/row in the database. That being the case, it is (according to Oracle documentation) the fastest way to retrieve a particular row. Faster than an index, even.
Can you use ROWID to differentiate between duplicate rows?
Yes, you can. Since it actually represents the physical location of a row, no two rows within the same table will have the same ROWID. Notice the caveat I added: within the same table. If you're using clustering, two records from different tables could theoretically share the same ROWID.
Do ROWIDs change?
Yes, especially with index organized or partitioned tables. Because ROWIDs represent the physical location of a record/row, the ROWID will change every time the record is physically moved.
Can you use ROWID as a primary key?
No, that's not advisable. While the ROWID will be unique, you would ideally want to use a primary key that doesn't change.
How do you use ROWID to figure out what was the last record that was processed?
Using DBMS_SQL.LAST_ROW_ID to get the ROWID of the last row processed.
You'll see ROWNUM and ROWID pop up occasionally within solutions to problems on AskTom and various Discussion Forums, so I recommend adding it to your own toolbelt as well.
Tuesday, March 24, 2009
Working With File Throgh WebUtill
--------------------------------------------------
Document
Required Configuraion :
By default the file transfer is disabled in webutil for a security measure. So, you have to enable File transfer configuration in webutil.cfg file. The webutil.cfg file is located in forms\server.
Open The webuil.cfg file and edit the following parameters :
transfer.database.enabled=FALSE Change To TRUE
transfer.appsrv.enabled=FALSE Change to TRUE
WebUtil_File contains APIs to manipulate files and directories on the client. These Functions Or APIs are:
Copy_File : Copies a file Returns a Boolean to indicate success.
Syntax :
Webutil_File.Copy_File(SourceFileName in Varchar2 , Destination In Varchar2) Return Boolean
Example
Declare
vCopied Boolean;
Begin
vCopied := Webutil_File.Copy_File('C:\temp\mypic.jpg','X:\destination_folder');
If vCopied = true Then
Message('File copied Successfully');
Else
Message('Error in Copying File');
End if;
Delete_File: Deletes a file. Returns a Boolean to indicate success.
Rename_File Renames a file. Returns a Boolean to indicate success.
Create_Directory Creates the named directory if it does not exist.
Any intermediate directories will also be created.
Returns a Boolean to indicate success.
Directory_Root_List Returns a FILE_LIST containing the directory roots on the client system. On a Windows PC these would correspond to the drives on the computer.
Directory_List :Returns a FILE_LIST containing all the files and subdirectories in a particular directory. There is an optional Return_Files_Only argument to restrict the returned list to just files with no directories.
Directory_Filtered_List : Like Directory_List this will return a list of files in a directory but you are able to file filter using the '*' and '?' wildcards e.g. *.FMB to restrict the list.
File_Exists :Returns a Boolean value indicating if the named file exists on the client
File_Is_Directory Returns a Boolean value indicating of the file name supplied is actually a directory on the client.
File_Is_Hidden :Returns a Boolean value indicating of the file has it's hidden attribute set.
File_Is_Readable :Returns a Boolean value indicating of the file can be read.
File_Is_Writable :Returns a Boolean value indicating of the file canbe written to.
File_Size :Returns the size of the file in bytes.
Directory_Selection_Dialog :Displays a Directory selection dialog. The initial directory and the title for the dialog can be defined. The selected directory is returned.
File_Selection_Dialog :Allows the definition of a File Save or Open dialog with a configurable file filter. Returns a single file selection. The file filter can use ? and * as wildcards and is in the format |
can be specified, e.g. |Gif Files|*.gif|JPEG Files|*.jpg|.
File_Multi_Selection_Dialog :As File_Selection_Dialog except that the user can select multiple files and these are returned in a FILE_LIST.
File_Open_Dialog :A convenience method that creates a File Open Dialog. File_Save_Dialog A convenience method that creates a File Save Dialog.
Get_file_Separator :Returns the character used on the client computer as the file separator e.g. "\" on Windows.
Get_Path_Separator :Returns the character used to separate directory locations on Paths e.g. ";" on Windows.
Document
Thursday, March 19, 2009
Reading From File
--------------------------------------------------
Declare
vfilename varchar2(500);
in_file Client_Text_IO.File_Type;
linebuf VARCHAR2(1800);
BEGIN
vfilename := client_get_file_name('c:/temp/', File_Filter=>'Comma Dialimeted Files (*.csv)|*.csv|');
in_file := client_Text_IO.Fopen(vfilename, 'r');
GO_BLOCK('Emp');
FIRST_RECORD;
LOOP
Client_Text_IO.Get_Line(in_file, linebuf);
p_output_line(linebuf);
Client_Text_IO.New_Line;
Next_record;
END LOOP;
FIRST_RECORD;
EXCEPTION
WHEN no_data_found THEN
Client_Text_IO.Put_Line('Closing the file...');
Client_Text_IO.Fclose(in_file);
END;
-------------------------------------------------------
PROCEDURE p_output_line(p_line varchar2) IS
vLINE VARCHAR2(4000);
vVALUE VARCHAR2(1000);
vCOMMA_COUNT NUMBER;
vREPORT_DATE DATE;
BEGIN
vLINE := p_line;
vCOMMA_COUNT := LENGTH(vLINE)- LENGTH(REPLACE(vLINE,',','')); -- COUNT THE NUMBER OF COMMAS
FOR I IN 1.. vCOMMA_COUNT+1 LOOP
vVALUE := SUBSTR(vLINE,1,INSTR(vLINE,',')-1); -- IF vLINE = 123,ABC,9877 THEN VVALUE WILL BE 123
IF vVALUE IS NULL THEN
vVALUE := vLINE;
END IF;
vLINE := SUBSTR(vLINE,INSTR(vLINE,',')+1) ; -- CHANGE 123,ABC,9877 TO BE ABC,9877
IF I = 1 THEN
:DATA.BMK_NAME := vVALUE;
ELSIF I = 2 THEN
vREPORT_DATE := last_day(to_date(vVALUE,'dd-mm-yyyy'));
:DATA.REPORT_DATE := vREPORT_DATE;
ELSIF I = 3 THEN
:DATA.BMK_RETURN := to_number(vVALUE);
END IF;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE('Please Check the data type is appropriate on you excel file');
MESSAGE('Please Check the data type is appropriate on you excel file');
END;
-----------------------------------------------------------------------
-- notes
1- you must install webutil version 106 or later
2- make sure that you attached and compiled the webutill.pll scucessfuly
Tuesday, March 17, 2009
Read From Excel
--------------------------------------------------
DECLARE
application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheets OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
args OLE2.OBJ_TYPE;
cell_value number;
BEGIN
application := OLE2.CREATE_OBJ('Excel.Application');
ole2.set_property(application,'Visible','true');
workbooks := OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
args := OLE2.CREATE_ARGLIST;
ole2.add_arg(args,'c:\test.xls');
workbook := ole2.GET_OBJ_PROPERTY(workbooks,'Open',args);
ole2.destroy_arglist(args);
worksheets := ole2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
worksheet := OLE2.GET_OBJ_PROPERTY(application,'activesheet');
for cols in 1..4 loop -- columns
for rows_index in 1..3 loop -- rows
args:= ole2.create_arglist;
ole2.add_arg(args, rows_index);
ole2.add_arg(args, cols);
cell:= ole2.get_obj_property(worksheet, 'Cells', args);
ole2.destroy_arglist(args);
--cell_value :=ole2.get_char_property(cell, 'Value');
cell_value :=ole2.get_num_property(cell, 'Value');
go_block('t');
create_record;
:t.a := cell_value;
end loop;
end loop;
-- Release the OLE2 object handles
ole2.release_obj(cell);
ole2.release_obj(worksheet);
ole2.release_obj(worksheets);
ole2.release_obj(workbook);
ole2.release_obj(workbooks);
ole2.invoke(application,'Quit');
ole2.release_obj(application);
END;
---------------------------------------------------------------------
notes:
/*
-- PASS VALUE INTO Excel CELL (ROW 371, COL 3)
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 1);
OLE2.ADD_ARG(args, 1);
cell := OLE2.GET_OBJ_PROPERTY(worksheet,'Cells', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(cell, 'Value', '97FI01');
*/
-- save document as test.xls
/*
OLE2.INVOKE(worksheet, 'Save');
OLE2.INVOKE(workbook, 'Save');
OLE2.INVOKE(workbook,'CLOSE');
*/
Monday, March 2, 2009
ora-12638 credential retrieval failed
--------------------------------------------------
check the sqlnet.ora file. Change the following entry and try, this will work.
Original Entry - SQLNET.AUTHENTICATION_SERVICES= (NTS)
Modified Entry - SQLNET.AUTHENTICATION_SERVICES= (NONE)
Original Entry - SQLNET.AUTHENTICATION_SERVICES= (NTS)
Modified Entry - SQLNET.AUTHENTICATION_SERVICES= (NONE)
Tuesday, February 24, 2009
Friday, February 20, 2009
Developing powerful Oracle Business Intelligence Beans

Prerequisites
Oracle Forms 10g Rel. 2
•
•
•

Forms_Demos_10gr2.zip
Installation (1)
Download from OTN: Forms_Demos_10gr2.zip
•
•download.oracle.com/otndocs/demos/Forms_Demos_10gr2.zip
–
•Unzip it into an example-Folder of your choice
•
•Copy FormsGraph.jar into \forms\java
Source-Codes
PROCEDURE BT_Compare IS
vItem VARCHAR2(200) := :SYSTEM.Cursor_Item;
vGrafik ITEM := FIND_ITEM (Const_lokal.itm_Chart);
vData VARCHAR2(200);
BEGIN
-- Initialize Graph
SET_CUSTOM_PROPERTY (vGrafik, 1, 'CLEAR_GRAPH', '');
GO_BLOCK ('UMSATZUEBERSICHT');
FIRST_RECORD;
LOOP
vData := :UMSATZUEBERSICHT.Ums_Geschaeftsbereich || ',' ||
:UMSATZUEBERSICHT.Ums_Jahr || ',' ||
:UMSATZUEBERSICHT.Ums_Umsatz;
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_ROWDATA', vData);
IF :SYSTEM.Last_Record = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
-- Show Graph
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_DATA_TO_GRAPH', '');
SET_CUSTOM_PROPERTY(vGrafik, 1, 'GRAPHTYPE', 'VERTICAL_BAR');
GO_ITEM(vItem);
END
PROCEDURE BT_Sum IS
vGrafik ITEM := FIND_ITEM (Const_lokal.itm_Chart);
vData VARCHAR2(200);
BEGIN
-- Initialize Graph
SET_CUSTOM_PROPERTY(vGrafik, 1, 'CLEAR_GRAPH', '');
FOR rUms IN (SELECT Ums_Geschaeftsbereich, SUM(Ums_Umsatz) Ums_Umsatz
FROM UMSATZUEBERSICHT
GROUP BY Ums_Geschaeftsbereich)
LOOP
vData := rUms.Ums_Geschaeftsbereich || ',' ||
'Total Sales 2000 - 2005' || ',' ||
rUms.Ums_Umsatz;
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_ROWDATA', vData);
END LOOP;
-- Show Graph
SET_CUSTOM_PROPERTY (vGrafik, 1, 'GRAPHTYPE', 'PIE_GRAPH');
SET_CUSTOM_PROPERTY (vGrafik, 1, 'ADD_DATA_TO_GRAPH', '');
END;
•
how to make print screen from your form
---------------------------------------------------------------
package screen; import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; public class ScreenCapture { public void printScreen() throws AWTException, IOException { // capture the whole screen BufferedImage screencapture = new Robot().createScreenCapture( new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) ); // Save as JPEG File file = new File("screencapture.jpg"); ImageIO.write(screencapture, "jpg", file); // Save as PNG // File file = new File("screencapture.png"); // ImageIO.write(screencapture, "png", file); } }
---------------------------------------------------------------------------
-- form builder implementation
--------------------------------------------------------------------------
PROCEDURE printscreen IS jo ora_java.jobject; BEGIN jo:=ScreenCapture.new; ScreenCapture.printScreen(jo); END;
Sunday, March 30, 2008
Configuring DAD file and MODPLSQL on Oracle Application server 10g
mod_plsql DAD Configuration
This file contains documentation of all the Database Access Descriptor (DAD)level parameters that can be specified in the mod_plsql configuration file$ORACLE_HOME/Apache/modplsql/conf/dads.conf
A DAD is a set of values that specify how mod_plsql connects to a databaseserver to fulfill an HTTP request. Besides the connect details, a DAD containsimportant configuration parameters for various operations in the databaseand for mod_plsql in general. Any web-enabled PL/SQL application which makesuse of the PL/SQL Web ToolKit needs to create a DAD to invoke the application.
Some typical PL/SQL applications which would require DAD's are- Any PL/SQL Application written using the PL/SQL Web ToolKit- Oracle Application Server Portal- Oracle Application Server Single Sign-On
Creating a DAD------------------
If OHS/mod_plsql is part of the Oracle Application Server product, it isrecommended that you use Oracle Enterprise Manager to create a DAD. Otherwise,perform the following steps to create a DAD
1. Edit the DAD configuration file ORACLE_HOME/Apache/modplsql/conf/dads.conf.
2. Add a DAD where the DAD has the following format:
- The Oracle HTTP Server directive which defines a virtual path used to access the PL/SQL Web Application. This directive begins enclosing a group of directives that apply to the named Location.
Note: Older versions of mod_plsql were always mounted on a virtual path with a prefix of '/pls'. This restriction is removed in newer versions but might still be a restriction imposed by some older PL/SQL applications.
- The Oracle HTTP Server "SetHandler" directive which directs Oracle HTTP Server to enable mod_plsql to handle the request for the virtual path defined by the named Location
SetHandler pls_handler
- Additional Oracle HTTP Server directives that are allowed in the context of a directive. Typically, the following directives are used:
Order deny,allow Allow from all AllowOverride None
- One or more mod_plsql specific directives. For example:
PlsqlDatabaseUsername scott PlsqlDatabasePassword tiger PlsqlDatabaseConnectString orcl PlsqlAuthenticationMode Basic
3. Save the edits.
4. Obfuscate the DAD password by running the "dadTool.pl" script located in ORACLE_HOME/Apache/modplsql/conf. For instructions on performing the obfuscation, please refer to ORACLE_HOME/Apache/modplsql/conf/dadTool.README
If OHS/mod_plsql is part of the Oracle Application Server product, then issue $OH/dcm/bin/dcmctl updateConfig -ct ohs
5. Restart the Oracle HTTP Server for the configuration to take effect.
You can create additional DADs by defining other uniquely named Locations indads.conf.
Here is an example of a typical PLSQL application DAD
SetHandler pls_handler Order deny,allow Allow from all AllowOverride None PlsqlDatabaseUsername scott PlsqlDatabasePassword tiger PlsqlDatabaseConnectString orcl PlsqlAuthenticationMode Basic PlsqlDefaultPage scott.home PlsqlDocumentTablename scott.wwdoc_document PlsqlDocumentPath docs PlsqlDocumentProcedure scott.wwdoc_process.process_download
here is my example that I made it in my company
SetHandler pls_handler
Order deny,allow
Allow from all
AllowOverride None
PlsqlDatabaseUsername moi
PlsqlDatabasePassword moi
PlsqlDatabaseConnectString moidb
PlsqlAuthenticationMode Basic
Tuesday, March 18, 2008
Sunday, March 16, 2008
Executing Server side procedure and publishing result on HTML
source code will be avalibale soon
web.show_document('http://moiserver:7778/appweb/PKG_Download_BLOB.Download_Blob?P_tbl=CE_NOTICE&p_tranid=':CE_NOTICE.NOTICE_RECID,'_blank');
END;
another example
CREATE OR REPLACE procedure TEST.queryemp is
cursor emp_cur is
select ename,sal
from emp;
begin
htp.prn('');
htp.prn(' ');
htp.prn('
htp.prn(' ');
htp.prn(' ');
for i in emp_cur loop
htp.prn('
| '||i.ename||' |
end loop;
htp.prn(' ');
htp.prn('');
end;
/
--- dads conf
SetHandler pls_handler
Order allow,deny
Allow from All
AllowOverride None
PlsqlDatabaseUsername test
PlsqlDatabasePassword test
PlsqlDatabaseConnectString pmstst
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
PlsqlDocumentTablename smm_doc_table
PlsqlDocumentPath docs
PlsqlDocumentProcedure wwdoc_process.process_download
PlsqlDefaultPage portal.home
PlsqlPathAlias url
PlsqlPathAliasProcedure wwpth_api_alias.process_download
-- restart http server
-- run this url
http://iai2.iai.org.kw:7778/myapp/queryemp
Labels:
عرض MULTIMEDIA من جدول
Subscribe to:
Posts (Atom)