Create pakage&procedure in PL/SQL

First of all you should create your spec then body;

To create your table:

CREATE TABLE APPS.XXPC_ATALAY_USERS
(
IDENTIFIER VARCHAR2(50 BYTE),
ALIAS VARCHAR2(50 BYTE),
TITLE VARCHAR2(1000 BYTE),
TYPE VARCHAR2(50 BYTE),
REGISTERTIME DATE
);

To create your type:

create or replace type xxpc_atalay_user_t as object (
identifier varchar2(50),
alias varchar2(50),
title varchar2(1000),
TYPE varchar2(150),
registertime date
);

spec:

/* Formatted on 6/3/2013 2:10:22 AM (QP5 v5.163.1008.3004) */
CREATE OR REPLACE PACKAGE apps.xxpc_atalay_user_pkg –spec
AS
PROCEDURE set_user (p_user IN xxpc_atalay_user_t,
p_debug IN VARCHAR2 DEFAULT ‘N’,
x_retcode OUT VARCHAR2,
x_retmsg OUT VARCHAR2);
END xxpc_atalay_user_pkg;

body:

/* Formatted on 6/3/2013 2:11:29 AM (QP5 v5.163.1008.3004) */
CREATE OR REPLACE PACKAGE BODY apps.xxpc_atalay_user_pkg
AS

g_debug VARCHAR2 (10) := ‘Y’;
g_location VARCHAR2 (80) := ”;


PROCEDURE LOG (p_subject IN VARCHAR2)
IS
BEGIN
IF (g_debug = ‘Y’)
THEN
DBMS_OUTPUT.put_line (‘[Log (‘ || g_location || ‘)]:’ || p_subject);
END IF;
END LOG;

PROCEDURE set_user (p_user IN xxpc_atalay_user_t,
p_debug IN VARCHAR2 DEFAULT ‘N’,
x_retcode OUT VARCHAR2,
x_retmsg OUT VARCHAR2)
IS
l_ctr NUMBER := 0;
BEGIN
g_debug := p_debug;

g_location := ‘set_user.01:check exist’;


SELECT COUNT (*)
INTO l_ctr
FROM XXPC_ATALAY_USERS X
WHERE 1 = 1 AND x.identifier = p_user.identifier;

IF l_ctr = 0
THEN

g_location := ‘set_user.02:insert’;

INSERT INTO xxpc_atalay_users (identifier,
alias,
title,
TYPE,
registertime)
VALUES (p_user.IDENTIFIER,
p_user.alias,
p_user.title,
p_user.TYPE,
p_user.registertime);

LOG (‘inserted 1 row’);
ELSE

g_location := ‘set_user.03: update’;

UPDATE xxpc_atalay_users x
SET alias = p_user.alias,
title = p_user.title,
TYPE = p_user.TYPE,
registertime = p_user.registertime
WHERE x.identifier = p_user.identifier;

LOG (‘updated’ || SQL%ROWCOUNT || ‘row (s)’);
END IF;

–commit;

x_retcode := ‘S’;
x_retmsg := ”;
EXCEPTION
WHEN OTHERS
THEN

x_retcode := ‘E’;
x_retmsg := ‘ERROR (‘ || g_location || ‘):’ || SQLERRM;
LOG (x_retcode || ‘-‘ || x_retmsg);
–Rollback
END set_user;
END xxpc_atalay_user_pkg;

Apps initiliaze

First of all you can check from DB apps_initiliaze(if there is new section);

==>
select fnd_global.org_id,fnd_global.resp_id,fnd_global.user_id from dual;

Then you’ll see like this;

apps_inilitiliaze_show

Below examples is very helpful to find out apps initiliaze ;

Example:-

declare
l_user_id fnd_user.user_id%type;
l_responsibility_id fnd_responsibility_tl.responsibility_id%type;
l_application_id fnd_responsibility_tl.application_id%type;
begin
select t.user_id
into l_user_id
from fnd_user t
where t.user_name = ‘SYSADMIN’;
select t.responsibility_id, t.application_id
into l_responsibility_id, l_application_id
from fnd_responsibility_tl t
where t.responsibility_name like ‘Application Developer’ and
t.language = ‘US’;
fnd_global.apps_initialize(l_user_id,
l_responsibility_id,
l_application_id);
dbms_output.put_line(‘begin fnd_global.apps_initialize’ ||
‘ (user_id => ‘ || l_user_id || ‘, resp_id => ‘ ||
l_responsibility_id || ‘, resp_appl_id => ‘ ||
l_application_id || ‘); end;’);
end;

select fnd_global.org_id,fnd_global.resp_id,fnd_global.user_id from dual;

This select should be changed.

Oracle E-Business Suite R12&11i Form Startup with Chrome

Tags

, ,

Oracle E-Business Suite R12&11i Form Startup.

You can use this Chrome Extension to log in Oracle E-Business R12 Form UI without FRM-92129 error .

V0.1.1 Update: Support https Protocol

V0.1.2 Update: Support Oracle EBS 11i forms


Dowloand plugin:
https://chrome.google.com/webstore/detail/oracle-ebs-r1211i-enablem/ekkagabmggbmpmncofhgkfigmeldifnc

Basic Syntax

Be carefull when you are writing Java Code since;

  • Case Sensitivity – Java is case sensitive which means identifier out and Out would have different meaning in Java.
  • Class Names – For all class names the first letter should be in Upper Case.                             example: MyFirstJavaClass
  • Method Names – All method names should start with a Lower Case letter                                 example: public void myMethodName()
  • Program File Name – Name of the program file should exactly match the class name.
  • public static void main(String args[]) – java program processing starts from the main() method which is a mandatory part of every java program.

public class MyFirstJavaProgram {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println(“This is my first program,Hello World”);
//Prints -This is my first program,Hello World
}
}

Java Keywords:

The following list shows the reserved words in Java. These reserved words may not be used as constant or variable or any other identifier names.

abstract assert boolean break
byte case catch char
class const continue default
do double else enum
extends final finally float
for goto if implements
import instanceof int interface
long native new package
private protected public return
short static strictfp super
switch synchronized this throw
throws transient try void
volatile while

Enviroment Setup

Tags

How to SetUp Java_Home? Computer right click then Advanced system settings >> Enviroment Variables >> New java_home

Then Let’s check it out the java_version from CMD

cmd

How to Setup JAVA_HOME from Command Line:

If you want to setup JAVA_HOME from CMD, follow up these steps;

To check it which java_home are you using with command  “java -version” or echo %JAVA_HOME%

SET JAVA_HOME=C:/Program Files/Java (The path where your JRE or JDK is installed)

Then you can set the bin path by typing;

SET PATH = %PATH%;%JAVA_HOME%\bin

Lets check your path : echo %PATH%

 

Another way to change JAVA_HOME,

@echo off
echo Setting JAVA_HOME
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_11
echo setting PATH
set PATH=C:\Program Files\Java\jdk1.6.0_11\bin;%PATH%
echo Display java version
java -version

Popular Java Editors:

Video:   http://www.youtube.com/watch?v=v9_K5plEOBU

  • Eclipse : is also a java IDE developed by the eclipse open source community and can be downloaded from http://www.eclipse.org/.

Video:     http://www.youtube.com/watch?v=URCyWNflkpQ

Overviews

Java programming language was originally developed by Sun Microsystems, which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems.s Java platform (Java 1.0 [J2SE]).

jamesGosling

Java is:

  • Object Oriented
  • Platform independent
  • Simple
  • Secure
  • Architectural- neutral
  • Portable
  • Robust
  • Multi-threaded
  • Interpreted
  • High Performance
  • Distributed
  • Dynamic

History of Java

Since 1995, Java has changed our world . . . and our expectations.. Today, with technology such a part of our daily lives, we take it for granted that we can be connected and access applications and content anywhere, anytime. Because of Java, we expect digital devices to be smarter, more functional, and way more entertaining. In the early 90s, extending the power of network computing to the activities of everyday life was a radical vision. In 1991, a small group of Sun engineers called the “Green Team” believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java.

more :http://www.oracle.com/technetwork/java/javase/overview/javahistory-index-198355.html