Listopad « 2011 « Różności …

Różności …

27 listopada 2011

Associative arrays, cursors – PL/SQL

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 19:55
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://docstore.mik.ua/orelly/oracle/langpkt/ch01_09.htm

http://tylermuth.wordpress.com/2008/02/21/plsql-associative-arrays/

25 listopada 2011

pl/sql package – prosty przykład

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 15:03

http://sueharper.blogspot.com/2006/10/running-plsql-code-using-sql-developer.html

typy:
http://dbahelp.co.uk/plsql.aspx

rowtype:
http://www.orafaq.com/wiki/PL/SQL_FAQ

23 listopada 2011

PL/SQL – uruchamianie procedur

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 23:02

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

Zaszufladkowany do: Oracle,PL/SQL — Tagi: , — Jacek @ 18:46

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.

sqlldr – ładownie danych z plików excell

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 17:27

CREATE TABLE HR.JS_USUN_PODWOJNE
(numerid NUMBER);
podwojne.ctl
LOAD DATA INFILE podwojne.csv
APPEND INTO TABLE HR.JS_USUN_PODWOJNE
FIELDS TERMINATED BY ‘,’
(NUMERID)
podwojne.csv
33
4534
35
645
78
2567
153

sqlldr ‘sys/haslo AS SYSDBA’ control=podwojne.ctl log=log2.log

http://infolab.stanford.edu/~ullman/fcdb/oracle/or-load.html

External tables in Oracle.

Zaszufladkowany do: Oracle — Tagi: — Jacek @ 15:54

http://www.adp-gmbh.ch/ora/misc/ext_table.html

http://www.dba-oracle.com/art_ext_tabs_spreadsheet.htm

http://www.dba-oracle.com/art_ext_tabs.htm

SQL – duplicates

Zaszufladkowany do: SQL — Tagi: — Jacek @ 12:06

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)

Zaszufladkowany do: Java,Linux,Programowanie — Tagi: , — Jacek @ 15:55

http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/

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

19 listopada 2011

Eskimo Disco 7-11 HD

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 08:22

18 listopada 2011

Oracle SOA jdev extension.

Zaszufladkowany do: Java,Oracle,Programowanie — Tagi: — Jacek @ 17:52

Extensions for JDeveloper:

http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/156082.xml

Oracle licensing – vmware.

Zaszufladkowany do: Bez kategorii,Oracle — Tagi: — Jacek @ 17:06

Oracle licensing:

http://weinshenker.net/blog/2011/04/03/licensing-oracle-vmware-vsphere/

http://oraclestorageguy.typepad.com/oraclestorageguy/2010/05/oracle-license-costs-on-the-vmware-vsphere-platform.html

Oracle partitioning document:

http://www.oracle.com/us/corporate/pricing/partitioning-070609.pdf

Hard Partitioning with Oracle VM

VM TO HOSTS AFFINITY RULE:

http://frankdenneman.nl/2010/07/vm-to-hosts-affinity-rule/

vSphere Resource Management Guide

NO for war with Iran!!!

Zaszufladkowany do: Z sieci — Tagi: — Jacek @ 10:59

17 listopada 2011

SOA

Zaszufladkowany do: Bazy danych,Oracle,Oracle — Tagi: — Jacek @ 22:11

Including SOA Features in Jdeveloper 11g R1 (11.1.1.1.0)

By rodrigo.jorquera on Jul 09, 2009

The new Jdeveloper’s release doesn’t include the development suite for SOA applications.
There’s an extension for that and can be downloaded from OTN.

The link to download the file (called Oracle SOA Composite Editor):
http://www.oracle.com/technology/products/jdev/101/update/fmw_products.xml

To download the file directly:
http://download.oracle.com/otn/java/jdeveloper/111/extensions/soa-jdev-extension.zip

After download the file, you can install it using the Check for update option in Jdeveloper.

As you can see in the following screenshot, the option is available under the Help menu.

Then select the option “Install From Local File”, and select the location where you put the zip file.

After that you will see that the Oracle SOA Composite Editor will be installed and Jdeveloper will restart.

To verify the installed extension, You can go to File -> New section and you will see the new option “SOA Tier”.

If you chose that you will have the following templates as an option:
Then, you are ready to work in your SOA project!.

źródło:

http://blogs.oracle.com/rodrigo/entry/including_soa_features_in_jdev

BPMN – podstawy

Zaszufladkowany do: Programowanie — Tagi: — Jacek @ 13:15

Tablice BPMN

BPMN_Poster_A4_ver_1.0.10

BPMN_Poster_A3_ver_1.0.10

BPMN_Poster_A2_ver_1.0.10

15 listopada 2011

PL/SQL – functions

Zaszufladkowany do: Bazy danych,PL/SQL,Programowanie — Tagi: , — Jacek @ 19:44

PL/SQL Functions

What is a Function in PL/SQL?

A function is a named PL/SQL Block which is similar to a procedure. The major difference between a procedure and a function is, a function must always return a value, but a procedure may or may not return a value.

The General Syntax to create a function is:

CREATE [OR REPLACE] FUNCTION function_name [parameters]

RETURN return_datatype;

IS

Declaration_section

BEGIN

Execution_section

Return return_variable;

EXCEPTION

exception section

Return return_variable;

END;

1) Return Type: The header section defines the return type of the function. The return datatype can be any of the oracle datatype like varchar, number etc.
2) The execution and exception section both should return a value which is of the datatype defined in the header section.

For example, let’s create a frunction called ”employer_details_func’ similar to the one created in stored proc

1> CREATE OR REPLACE FUNCTION employer_details_func

2>    RETURN VARCHAR(20);

3> IS

5>    emp_name VARCHAR(20);

6> BEGIN

7>      SELECT first_name INTO emp_name

8>      FROM emp_tbl WHERE empID = ’100′;

9>      RETURN emp_name;

10> END;

11> /

In the example we are retrieving the ‘first_name’ of employee with empID 100 to variable ‘emp_name’.
The return type of the function is VARCHAR which is declared in line no 2.
The function returns the ‘emp_name’ which is of type VARCHAR as the return value in line no 9.

How to execute a PL/SQL Function?

A function can be executed in the following ways.

1) Since a function returns a value we can assign it to a variable.

employee_name :=  employer_details_func;

If ‘employee_name’ is of datatype varchar we can store the name of the employee by assigning the return type of the function to it.

2) As a part of a SELECT statement

SELECT employer_details_func FROM dual;

3) In a PL/SQL Statements like,

dbms_output.put_line(employer_details_func);

This line displays the value returned by the function.

source:

http://plsql-tutorial.com/plsql-functions.htm

3 listopada 2011

sorry, you must have a tty to run sudo

Zaszufladkowany do: Linux — Tagi: — Jacek @ 10:32

w /etc/sudoers zakomentować:

Defaults    requiretty

Firefox – instalacja flash’a:
pobrać flash’a, skopiować libflashplayer.so do katalogu: /usr/lib/mozilla/plugins

2 listopada 2011

Windowmaker – ustawienie rozdzielczości.

Zaszufladkowany do: Linux — Tagi: — Jacek @ 14:17

xrandr -s 1280×720

xrandr -s 1280×800

Aplikacje dla windowmakera: http://www.dockapps.org/

switchdesk wmaker

xrandr --output VGA1 --preferred

Jasność obrazu:
xrandr --output LVDS1 --brightness 0.6

Strona startowa: www.jaceksen.pl