to_char
12 lutego 2014
NVL NULL, to_date, to_char
27 grudnia 2013
jdeveloper info
instalkę uruchamiać jako zwykły user
wersja 11.1.1.7 instalka na 64bit linuksie
najpierw apt-get install libxtst6.i386
start jdeveloper
sh /home/jsen/Oracle/Middleware_jdev11117/wlserver_10.3/common/quickstart/quickstart.sh &
start weblogic server:
~/Oracle/Middleware_jdev11117/user_projects/domains/base_domain$ ./startWebLogic.sh
uruchamianie i zatrzymywanie:
http://help.adobe.com/en_US/enterpriseplatform/10.0/AdminHelp/WS92d06802c76abadb-5145d5d12905ce07e7-7c8f.html
26 grudnia 2013
1 listopada 2013
java library path
java.library.path is the path that Java uses to find native libraries (such as lwjgl.dll). You should set it to the directory that contains the DLL files. You specify this with the -D switch on the command line, for example:
java -Djava.library.path=C:\Java\ljwgl\libs org.mypackage.MyProgram
29 października 2013
sqldeveloper
Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk
/usr/lib/jvm/java
18 października 2013
Multiple Java versions.
13 października 2013
java – two versions
Maintaining Multiple Java Versions on Red Hat Linux
I had the need to maintain more than one Java version on a Red Hat Linux machine. I was able to install a new version of Java, and then configure the machine to use the new version by default. It’s also very easy to switch back to using the previous version of Java.
The first step is to download the Java version that you want from the Oracle/Java web site. In my case, I downloaded the following file.
Executing this file as root will perform the installation. You’ll, of course, have to make the file executable after download. By default, the installation “wanted” to install Java in the following directory.
I still wanted to make the new installation the default Java used by the machine. Linux has a nice utility called alternatives to do this, and more specifically, the update-alternatives command. With this command, I was able to first register the newly installed Java as a version of Java that would be recognized by the utility, and I was then able to use the utility to make the new version of Java the default version. When I used the utility to make the newly installed Java the default, the /usr/bin/java on the machine was modified to point to the new version.
Here is the script that I used to have the new version of Java recognized by the alternatives utility.
JAVA_HOME=/usr/java/jre1.6.0_27
# The following command added the new java installation as a java alternative.
# The slave commands bring the related commands with it.
update-alternatives \
–install /usr/bin/java java $JAVA_HOME/bin/java 1 \
–slave /usr/bin/javac javac $JAVA_HOME/bin/javac \
–slave /usr/bin/javadoc javadoc $JAVA_HOME/bin/javadoc \
–slave /usr/bin/jar jar $JAVA_HOME/bin/jar \
–slave /usr/bin/keytool keytool $JAVA_HOME/bin/keytool \
–slave /usr/local/java java_home $JAVA_HOME# A web site suggested that these steps would also be required, but they were not
#ln -s /etc/alternatives/java /usr/bin/java
#ln -s /etc/alternatives/javac /usr/bin/javac
#ln -s /etc/alternatives/javadoc /usr/bin/javadoc
#ln -s /etc/alternatives/jar /usr/bin/jar
#ln -s /etc/alternatives/keytool /usr/bin/keytool
#ln -s /etc/alternatives/java_home /usr/local/java
It’s important to make sure that JAVA_HOME is set to point to the new installation directory. The update-alternatives command links multiple Java utility programs together so that when you switch from one Java version to the next, the proper versions of the related tools come with it (note the slave option in the script above). One web site I visited indicated that I would have to update symbolic links, but the links were made automatically when I tried this on Red Hat 5 and 6.
Running the script above does not make the new version of Java the default. It simply registers that version of Java as a known version of java. Run the following command to change the default.
You should see the following after entering the above command.
There are 3 programs which provide ‘java’.Selection Command———————————————–1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java*+ 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java3 /usr/java/jre1.6.0_27/bin/javaEnter to keep the current selection[+], or type selection number:
I entered 3, and pressed the enter key, and the newly installed version of Java became the default. You can run the update-alternatives command again to change the version back.
I assume that this works on other flavors of Linux as well, but I’ve never tried. I have done this on both Red Hat Linux 5 and 6
SOURCE:
http://mikes-web-site.blogspot.com/2012/02/maintaining-multiple-java-versions-on.html
28 lutego 2012
PL/SQL temporary tables
22 lutego 2012
Using PL/SQL Loops and Control Structures
25 stycznia 2012
Retrieve Top N records from a query
23 stycznia 2012
Declaring Collections with %TYPE
Example 5-4 Declaring Collections with %TYPE
DECLARE TYPE few_depts IS VARRAY(10) OF VARCHAR2(30); TYPE many_depts IS VARRAY(100) OF VARCHAR2(64); some_depts few_depts; /* If the type of some_depts changes from few_depts to many_depts, local_depts and global_depts will use the same type when this block is recompiled */ local_depts some_depts%TYPE; global_depts some_depts%TYPE; BEGIN NULL; END; /
22 stycznia 2012
ora-00054
ORA-00054: resource busy and acquire with NOWAIT specified
po zerwaniu sesji – nie można zrobić drop table
aby sprawdzić jaka sesja trzyma:
źródła:
Prosty CURSOR
27 listopada 2011
Associative arrays, cursors – PL/SQL
declare |
02 |
type apollo_rec is record( |
03 |
commander varchar2(100), |
04 |
launch date ); |
05 |
type apollo_type_arr is table of apollo_rec index by varchar2(100); |
06 |
apollo_arr apollo_type_arr; |
07 |
begin |
08 |
apollo_arr( 'Apollo 11' ).commander := 'Neil Armstrong' ; |
09 |
apollo_arr( 'Apollo 11' ).launch := to_date( 'July 16, 1969' , 'Month dd, yyyy' ); |
10 |
apollo_arr( 'Apollo 12' ).commander := 'Pete Conrad' ; |
11 |
apollo_arr( 'Apollo 12' ).launch := to_date( 'November 14, 1969' , 'Month dd, yyyy' ); |
12 |
apollo_arr( 'Apollo 13' ).commander := 'James Lovell' ; |
13 |
apollo_arr( 'Apollo 13' ).launch := to_date( 'April 11, 1970' , 'Month dd, yyyy' ); |
14 |
apollo_arr( 'Apollo 14' ).commander := 'Alan Shepard' ; |
15 |
apollo_arr( 'Apollo 14' ).launch := to_date( 'January 31, 1971' , 'Month dd, yyyy' ); |
16 |
17 |
dbms_output.put_line(apollo_arr( 'Apollo 11' ).commander); |
18 |
dbms_output.put_line(apollo_arr( 'Apollo 11' ).launch); |
19 |
end ; |
20 |
/ |
http://tylermuth.wordpress.com/2008/02/21/plsql-associative-arrays/
25 listopada 2011
pl/sql package – prosty przykład
http://sueharper.blogspot.com/2006/10/running-plsql-code-using-sql-developer.html
23 listopada 2011
PL/SQL – uruchamianie procedur
execute procedure_name
execute procedure_name(‘in_param’,'in_param’);
execute package_name.procedure_name (….
select myPackage.myFunction(rec_id) from myTable;
select myPackage.myFunction(argValue) from dual;
SQL> @pass2proc SQL> CREATE OR REPLACE PROCEDURE PASS2PROC(VAL1 IN NUMBER, VAL2 OUT NUMBER) 2 AS 3 BEGIN 4 VAL2 := VAL1*2; 5 END PASS2PROC; 6 / Procedure created. SQL> var ret1 number SQL> exec pass2proc(1,:ret1); PL/SQL procedure successfully completed. SQL> print ret1 RET1 ---------- 2
ORA-01882 on SQL Developer
Edit sqldeveloper.conf configuration file located in the folder SQLDeveloper / bin
Add this line with the timezone:
AddVMOption -Duser.timezone="Europe/Warsaw"
Restart and try again.
SQL – duplicates
Here’s a handy query for finding duplicates in a table. Suppose you want to find all email addresses in a table that exist more than once:
SELECT email, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
You could also use this technique to find rows that occur exactly once:
SELECT email FROM users GROUP BY email HAVING ( COUNT(email) = 1 )
Źródło: http://www.petefreitag.com/item/169.cfm
22 listopada 2011
Instalacja Java7 na Fedora 16 (64 bit)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
ia32-libs is a Debian(/Ubuntu) package name, it brings the 32-bit
version of the C standard library. The Fedora equivalent is glibc.i686.
So here:
# yum install glibc.i686
sprawdzenie wersji:
glibc (ldd –version)
java (java -version)
lokalizacja: /usr/java/latest