Oracle/Tools2016. 8. 9. 13:41
728x90

https://community.oracle.com/thread/2325970?tstart=0

Developer 10g Capture All CHANGED Item Values
---------------------------------------------

My successful POST-UPDATE trigger at the form level ended up like:

<<
p_html := 'Catalog item ' || :ITEMS.MANUFACTURER || ' - ' || :ITEMS.MODEL_DESC || ' ' || :ITEMS.MODEL || ' has been modified and the results are as follows: <br> '; 

v_item := 'ITEMS' || '.' || get_block_property('ITEMS',first_item); 


<<item_loop>> 

loop 
exit when v_item = 'ITEMS' || '.' || null; 
v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE); 
v_itemname := GET_ITEM_PROPERTY(v_item,ITEM_NAME); 
v_block := 'ITEMS'; 
v_name := v_block || '.' || v_itemname; 
v_frmvalue := NAME_IN(v_name); 
IF v_dbvalue <> v_frmvalue THEN 
p_html := p_html || 'OLD VALUE WAS: ' || v_dbvalue || '<br>AND NEW VALUE IS: ' || v_frmvalue || '<br>'; 
END IF; 
v_item := 'ITEMS' || '.' || get_item_property(v_item,nextitem ); 
>>

The p_html variable is the string that I send to the email package to send out via our mail service.

Posted by swanseo
Oracle/Tools2016. 8. 9. 13:41
728x90

// Note 438648.1


ChangeInputMethodOnFocus.java

package formsUI;
import java.awt.Component; 
import java.awt.event.FocusAdapter; 
import java.awt.event.FocusEvent; 
import java.awt.im.InputContext; 
import java.util.Locale;
public class ChangeInputMethodOnFocus extends FocusAdapter { 
Locale _locale;
Locale defLocale;
public ChangeInputMethodOnFocus(Locale locale) { 
_locale = locale; 
} 
public void focusGained(FocusEvent fe) { 
Component c = fe.getComponent(); 
InputContext inputContext = c.getInputContext();
defLocale = inputContext.getLocale();
inputContext.selectInputMethod(_locale);
// Added by swan
if (_locale != null) {
if (_locale == Locale.KOREAN) {
Character.Subset[] subset = { Character.UnicodeBlock.HANGUL_SYLLABLES };
inputContext.setCharacterSubsets(subset);
} else {
Character.Subset[] subset = null;
inputContext.setCharacterSubsets(subset);
}
}
}
public void focusLost(FocusEvent fe) {
Component c = fe.getComponent(); 
InputContext inputContext = c.getInputContext(); 
inputContext.selectInputMethod(defLocale); 
} 
}


VTextFieldKor.java

package formsUI;
import java.util.Locale; import oracle.forms.handler.IHandler; import oracle.forms.ui.VTextField;
@SuppressWarnings("serial")public class extends VTextField {  public void init(IHandler ih) {  super.init(ih);  //ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("ko","KR"));  ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (Locale.KOREAN);  this.addFocusListener(focusAdapter);  }


VTextFieldEng.java

package formsUI;
import java.util.Locale; import oracle.forms.handler.IHandler; import oracle.forms.ui.VTextField;
@SuppressWarnings("serial")public class VTextFieldEng extends VTextField {  public void init(IHandler ih) {  super.init(ih);  //ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("en","US"));  ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (Locale.ENGLISH);  this.addFocusListener(focusAdapter);  }



VTextAreaKor.java
package formsUI;
import java.util.Locale; import oracle.forms.handler.IHandler; import oracle.forms.ui.VTextArea;
@SuppressWarnings("serial")public class VTextAreaKor extends VTextArea {  public void init(IHandler ih) {  super.init(ih);  //ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("ko","KR"));  ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (Locale.KOREAN);  this.addFocusListener(focusAdapter);  }

VTextAreaEng.java
package formsUI;
import java.util.Locale; import oracle.forms.handler.IHandler; import oracle.forms.ui.VTextArea;
@SuppressWarnings("serial")public class VTextAreaEng extends VTextArea {  public void init(IHandler ih) {  super.init(ih);  //ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (new Locale("en","US"));  ChangeInputMethodOnFocus focusAdapter = new ChangeInputMethodOnFocus (Locale.ENGLISH);  this.addFocusListener(focusAdapter);  }


Posted by swanseo
Oracle/Tools2016. 8. 9. 13:39
728x90
formsUitl.java



package formsUtil;
import java.net.InetAddress;import java.net.NetworkInterface;
import oracle.forms.ui.VBean;import oracle.forms.handler.IHandler;import oracle.forms.properties.ID;

/* *  * In Forms: BL.INFOS := Get_Custom_Property('CONTROL.BEAN', 1, 'GET_IP_ADDRESS' ) ; */
@SuppressWarnings("serial")public class formsUitl extends VBean {
/*  * Define variables  */ private static final ID MACHINE_NAME = ID.registerProperty("GET_MACHINE_NAME"); private static final ID IP_ADDRESS = ID.registerProperty("GET_IP_ADDRESS"); private static final ID MAC_ADDRESS = ID.registerProperty("GET_MAC_ADDRESS"); private static final ID OS_NAME = ID.registerProperty("GET_OS_NAME"); private static final ID ARCHITECTURE = ID.registerProperty("GET_ARCHITECTURE"); private static final ID OS_VERSION = ID.registerProperty("GET_OS_VERSION"); private static final ID USER_NAME = ID.registerProperty("GET_USER_NAME"); private static final ID USER_HOME = ID.registerProperty("GET_USER_HOME");
/*  * Initialize forms handler  */ public void init(IHandler handler) { super.init(handler);     }
/*  * Get property  */    public Object getProperty(ID pId) {       if (pId != null) {        return getMachineInfo(pId);       } else {        return super.getProperty(pId);       }    }        /*  * getMachineInfo()  */ private final static String getMachineInfo(ID pId) {     try {         InetAddress ip = InetAddress.getLocalHost();         NetworkInterface network = NetworkInterface.getByInetAddress(ip);         byte[] mac = network.getHardwareAddress();         StringBuilder sb = new StringBuilder();
if (pId == MACHINE_NAME) {          return ip.getHostName();         } else if (pId == IP_ADDRESS) {          return ip.getHostAddress();         } else if (pId == MAC_ADDRESS) { for (int i = 0; i < mac.length; i++) { sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); } return sb.toString();         } else if (pId == OS_NAME) {          return System.getProperty("os.name");         } else if (pId == ARCHITECTURE) {          return System.getProperty("os.arch");         } else if (pId == OS_VERSION) {         return System.getProperty("os.version");         } else if (pId == USER_NAME) {          return System.getProperty("user.name");         } else if (pId == USER_HOME) {          return System.getProperty("user.home");         } else {          return null;        }     } catch (Exception e) {         e.printStackTrace();         return null;     } }
/*  * Main method for Test  */ public static void main(String[] args) {     try {         System.out.println("Host Name: " + getMachineInfo(MACHINE_NAME));         System.out.println("IP Address: " + getMachineInfo(IP_ADDRESS));         System.out.println("MAC Address: " + getMachineInfo(MAC_ADDRESS));         System.out.println("OS Name: " + getMachineInfo(OS_NAME));         System.out.println("Architecture: " + getMachineInfo(ARCHITECTURE));         System.out.println("OS Version: " + getMachineInfo(OS_VERSION));         System.out.println("User Name: " + getMachineInfo(USER_NAME));         System.out.println("User Home: " + getMachineInfo(USER_HOME));     } catch (Exception e) {         e.printStackTrace();     } }}


Posted by swanseo
Oracle/Tools2014. 11. 10. 09:41
728x90

Oracle SQL Developer 실행 시 다음과 같은 에러를 만날 수 있다.

"Unable to create an instance of the Java Virtual Machine error"



이것은 메모리 부족으로 인한 것으로 다음과 같이 JVM Memory 설정을 하여주면 가능하다.


1. Open the ide.conf file located under <Oracle SQL Developer>\sqldeveloper\bin\sqldeveloper.conf

2. Edit :

AddVMOption -Xmx1024M

=>

AddVMOption -Xmx256M or 512 MB change into 512 instead of 1024

Posted by swanseo
Oracle/Tools2014. 11. 9. 23:23
728x90

Download and Install Oracle Application Express

http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

> unzip apex_4.2.zip
> sqlplus "/as sysdba"
SQL> @apexins.sql  SYSAUX SYSAUX TEMP /i/    (Full: @apexins.sql tablespace_apex tablespace_files tablespace_temp images)
SQL> @apxrtins.sql SYSAUX SYSAUX TEMP /i/    (Runtime: @apxrtins.sql tablespace_apex tablespace_files tablespace_temp images)

 

Change the Password for the ADMIN Account

SQL> @apxchpwd.sql

 

Configure the Embeded PL/SQL Gateway

SQL> @apex_epg_config.sql c:\Oracle\app\oracle\product\11.2.0\server
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

 

Verifying the Oracle XML DB Protocol Server Port

SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;
=> 8080

  

Enabling Oracle XML DB Protocol Server

SQL> EXEC DBMS_XDB.SETHTTPPORT(8080);

  

Enable Network Services in Oracle Database 11g


DECLARE

  ACL_PATH  VARCHAR2(4000);

BEGIN

  -- Look for the ACL currently assigned to '*' and give APEX_040200

  -- the "connect" privilege if APEX_040200 does not have the privilege yet.


  SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS

   WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;


  IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN

      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect');

  END IF;


EXCEPTION

  -- When no ACL has been assigned to '*'.

  WHEN NO_DATA_FOUND THEN

  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_040200', TRUE, 'connect');

  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');

END;

/

COMMIT;

 

 

DECLARE

  ACL_PATH  VARCHAR2(4000);

BEGIN

  -- Look for the ACL currently assigned to 'localhost' and give APEX_040200

  -- the "connect" privilege if APEX_040200 does not have the privilege yet.

  SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS

   WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;

   

  IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200', 'connect') IS NULL THEN

      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_040200', TRUE, 'connect');

  END IF;


EXCEPTION

  -- When no ACL has been assigned to 'localhost'.

  WHEN NO_DATA_FOUND THEN

  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_040200', TRUE, 'connect');

  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost');

END;

/

COMMIT;

  

Installing a Translated Version of Oracle Application Express

> set NLS_LANG=American_America.AL32UTF8
> sqlplus "/as sysdba"
SQL> @load_trans.sql ko

or

> set NLS_LANG=American_America.AL32UTF8
> sqlplus "/as sysdba"
SQL> alter session set current_schema = APEX_040200;
SQL> @builder/ko/load_ko.sql

 

Configuring the SHARED_SERVERS Parameter

SQL> ALTER SYSTEM SET SHARED_SERVERS = 5 SCOPE=BOTH;

  

Connect to APEX

http://localhost:8080/apex
http://localhost:8080/apex/apex_admin



 

References

http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/otn_install.htm

 

Posted by swanseo