Saturday, May 21, 2011

Dynamic Function To Get Any Description Column By ID

here we will provide a dynamic Function to get any description of any table by only passing the table name , The ID column name , The Description " the value that you want to get" , The unique value for the id
-- you can modify this function to just take the table name and the id value , as you can define the id column in the database and also the description
CREATE OR REPLACE FUNCTION GET_DN(P_TABLE_NAME VARCHAR2,P_CODE VARCHAR2,P_NAME VARCHAR2,P_CODE_VALUE VARCHAR2 )RETURN VARCHAR2 IS
V_sQL VARCHAR2(500);
CURID NUMBER;
V_CODE varchar2(50);
V_NAME varchar2(100);
v_count number;

BEGIN
v_sql:='select '||P_CODE ||' ,'||P_NAME ||' from '||P_TABLE_NAME || ' WHERE '||P_CODE||'='||''''||P_CODE_VALUE||'''';
curid:=dbms_Sql.open_cursor;
dbms_sql.parse(curid,v_sql,dbms_sql.native);
v_count:=DBMS_SQL.execute(curid);
--return v_count;
dbms_sql.define_column(curid,1,v_CODE,50);
dbms_sql.define_column(curid,2,v_NAME,100);
if DBMS_SQL.fetch_rows(curid)>0 then
dbms_sql.column_value(curid,1,v_CODE);
dbms_sql.column_value(curid,2,v_NAME);

DBMS_OUTPUT.PUT(V_NAME);
dbms_sql.close_cursor(curid);

else
v_name:= 'No Rows';

END IF ;

RETURN v_NAME ;
---return v_sql;
END;

Monday, May 2, 2011

JRE Mixing Code Probem " Swing Tree"

as the first using for the JRE will be some of java beans that doesn't work with oracle jinitiator like ( Swing buttons , swing tree , Fully Gradient canvases ) , you may face some problems when trying to implement some of these java beans , this related to jar signing all jar files should be signed , the other problem is the java will raise the following exception " signer information does not match trust level of other classes in the same package"
you can overcome with this issue by setting one parameter in the java in the control panel

go to control panel ---> Java ---> advnced ---> Security --- Mixed code Security verification set its value to disable verification

Sunday, May 1, 2011

Using JRE instead Of Jinitiator to run Oracle Forms

as jinitiator have problems with windows 7 and of course the jinitiator have limited functionality rather than JRE , so you should think strongly replace your calling forms using JRE .
The most important motivator to do this is to know that you will do it very easy while still using the jinitiator in different config :
1- the first step is to create a new config section inside the formsweb.cfg as follow
baseHTML=basejpi.htm
baseHTMLJInitiator=basejpi.htm
baseHTMLjpi=basejpi.htm
baseHTMLie=basejpi.htm
# this parameter control the using of version
jpi_classid=clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA
# this parameter indicate a site specific place to download the jre to the client if the client doesn't already have the jre
# insalled on the client , note that the JREDownload should be defined as virtual directory , and # the exe file should# be existed on the physical location of the
jpi_codebase=http://168.169.1.66:52003/forms/JREDownload/jre16016.exe#Version=1,6,0,16
jpi_mimetype=application/x-java-applet;
jpi_download_page=/forms/jinitiator/us/jinit_download.htm
baseHTMLJInitiator=basejpi.htm
# The archive parameter will be used instead the archive_jini , but note the jar files should be #signed
archive=frmall.jar,frmall_jinit.jar,myappicons.jar
-------------------------------------------------------------------------------
in the forms.conf file you should add the following virtual directory
AliasMatch ^/forms/jre/(..*) "C:\DevSuiteHome_1/forms/jre/$1"
-----------------------------
the final step run your forms using the config jretest