Oracle, Web, Script, SQLserver, Tips & Trick

October 7, 2017

Auto-backups of PLSQL source

Filed under: Uncategorized — sikathabis @ 4:11 pm

Auto backups of plsql source

Learning is not a spectator sport

I saw this on an ideas forum today

image

and whilst most people would take care of this with a source code control system, its also true that people might do several compilations / tests with their PLSQL source before checking it in officially to their source repository.

So the idea has some merit… and maybe we can roll our own without too much fuss. I make no claims that this is a ‘complete’ solution, but it should get you going Smile

 SQL> set timing off SQL> drop trigger plsql_trigger; Trigger dropped. SQL> SQL> drop table plsql_params purge; Table dropped. SQL> drop table plsql_history cascade constraints purge; Table dropped. SQL> drop table plsql_history_source cascade constraints purge; Table dropped. SQL> drop table plsql_log cascade constraints purge; Table dropped. SQL> SQL> SQL> create table plsql_params 2 as select 3 versions_kept from dual; Table created. SQL> SQL> create table plsql_history ( 2 TSTAMP TIMESTAMP 3…

View original post 604 more words

Advertisements

September 14, 2017

How to connect oracle 12c from toad 9.7

Filed under: oracle,oracle:12c,toad — sikathabis @ 3:34 am
Tags: , ,

You must have Oracle Client 10g and then replace 12c
https://sikathabis.wordpress.com/2013/09/12/menjalankan-toad-dengan-oracle-client-basic-lite-for-windows/

Example
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.111)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb)))

September 7, 2017

Example how to use expdp

Filed under: dos,oracle,oracle:10g — sikathabis @ 7:07 am

example

set ORACLE_SID=VBSUPG

expdp user/user FULL=y COMPRESS=N DUMPFILE=DMP:USER%U.dmp FILESIZE=2G PARALLEL=4 LOGFILE=DMP:expuser.log JOB_NAME=expuser

March 31, 2017

How to fix Error on Birt org.xml.sax.SAXParseException: Premature end of file

Filed under: java,web — sikathabis @ 7:49 am
Tags: , , , , ,

on line 666 remark requestHeaders.push(‘Content-type’,’application/x-www-form-urlencoded’);

Example:
setRequestHeaders: function() {
var requestHeaders =
[‘X-Requested-With’, ‘XMLHttpRequest’,
‘X-Prototype-Version’, Prototype.Version];
if (this.options.method == ‘post’) {
/* biang kerok you must remark this
requestHeaders.push(‘Content-type’,
‘application/x-www-form-urlencoded’);
*/

Reference: http://developer.actuate.com/community/forum/index.php?/topic/28492-errors-from-birt-report-viewer-on-chrome-and-safari/
Reason: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310512#c6

December 2, 2016

How to get http from cmd (dev 6i)

Filed under: dev6i,dos,oracle,windows — sikathabis @ 8:05 pm
Tags: , , , ,

I have an application using oracle developer 6i (dev 6i). The application must communicate with the website to get the result. For example: If the application click the button then will access http: // localhost /show, and then the result “It works” showing to the application

I found winhttpjs.bat ( https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/winhttpjs.bat )

CMD> call winhttpjs.bat http://localhost/show -saveTo result.txt

If the result

CMD> Status: 200 OK

then file result.txt contained the result of website It work’s

If the result

CMD>  A connection with the server could not be established

then file result.txt contained The system cannot find the file specified.

To get the result for dev6i I’m using HOST to get the result and TEXT_IO for retrive text file (result.txt)

Download ~ winhttpjs-bat (erase .doc)

October 3, 2016

Windows 10 start menu doesn’t appear | start menu won’t show | start menu tidak muncul

Filed under: Uncategorized — sikathabis @ 9:32 am
Tags: , , ,

Permasalahan:

Windows 10 start menu doesn’t appear

Windows 10 start menu won’t show

Windows 10 start menu tidak muncul

Solusi:

  • Buka Regedit.exe
  • Klik kanan pada HKEY_Users / HKEY_CLASSES_ROOT / HKEY_LOCAL_MACHINE dan click permissions (jalankan di masing-masing HKEY)
  • Pastikan ALL APPLICATION PACKAGES allow read, jika ALL APPLICATION PACKAGES belum ada, maka tambahkan dengan cara:
    1. Click Add
    2. Click Advanced
    3. Click Find Now
    4. Pilih ALL APPLICATION PACKAGES
    5. Click Ok, Click Ok
    6. Lalu Check list Read pada ALL APPLICATION PACKAGES
    7. Click Ok

Referensi: https://support.microsoft.com/en-us/kb/2798317

 

September 6, 2016

How to convert full name to first, middle and last name on oracle

Filed under: oracle — sikathabis @ 8:57 am
Tags: ,

/* Sql to generate or convert fullname to firstname, middlename and lastname */

with name_list as
(select ‘1’ NO, ‘ACEP’ name from dual
union
select ‘2’ NO, ‘TAUFIK HIDAYAT’ name from dual
union
select ‘3’ NO, ‘DEPAN TENGAH BELAKANG’ name from dual
union
select ‘4’ NO, ‘DONO KASINO INDRO WARKOP’ name from dual)
select no, name
, case when length(name) – length(replace(name,’ ‘,null)) 0 then
substr(trim(name), 1, instr(trim(name), ‘ ‘) – 1) else name end AS FIRST_NAME
, case when length(name) – length(replace(name,’ ‘,null)) >1 then
rtrim(substr(trim(substr(name, instr(name, ‘ ‘) + 1)), 1, instr(substr(trim(substr(name, instr(name, ‘ ‘) + 1)), 1, length(name)), ‘ ‘)-1)) else ” end AS MIDDLE_NAME
, case when length(name) – length(replace(name,’ ‘,null)) >1 then
substr(trim(substr(name, instr(name,’ ‘,1,2) + 1)), 1, length(name))
when length(name) – length(replace(name,’ ‘,null)) >0 then
substr(trim(substr(name, instr(name, ‘ ‘) + 1)), 1, length(name)) else ” end AS LAST_NAME
from name_list order by 1;

–Output

NO   NAME                     FIRST_NAME    MIDDLE_NAME    LAST_NAME
1    ACEP                     ACEP        
2    TAUFIK HIDAYAT           TAUFIK        HIDAYAT
3    DEPAN TENGAH BELAKANG    DEPAN         TENGAH         BELAKANG
4    DONO KASINO INDRO WARKOP DONO          KASINO         INDRO WARKOP

Reference : http://stackoverflow.com/questions/371490

 

July 26, 2016

Contoh PL/SQL pengambilan nama dari separator koma (,)

Filed under: oracle — sikathabis @ 7:59 pm
Tags: ,

Contoh:

DECLARE
KALIMAT varchar2(100):=’DD_MASTER,LN_MASTER_AUDIT,TRAN_HIST,TASPEN’;
kata varchar2(100):=null;
c number:=0;
BEGIN
FOR i in 1..length(KALIMAT)
LOOP
if substr(kalimat,i,1)=’,’ then
c:=c+1;
end if;
END LOOP;
(more…)

June 9, 2016

Print using default printer on local computer (Oracle Developer 6i, windows)

Filed under: dev6i,oracle,windows — sikathabis @ 7:29 am
Tags: , , , , ,

this example, I want to show you how to automate print using default printer on local computer.

PROCEDURE GENERATE_VALIDATION (ID1 number, ID2 number, ID3 DATE) IS
    PL_ID PARAMLIST;
    filename varchar2(255);
    teks varchar2(255);
    IN_FILE TEXT_IO.FILE_TYPE;
BEGIN
    pl_id := Create_Parameter_List('TEMP'); 
    ADD_PARAMETER(PL_ID,'ID_1',TEXT_PARAMETER,ID1);
    ADD_PARAMETER(PL_ID,'ID_2',TEXT_PARAMETER,ID2);
    ADD_PARAMETER(PL_ID,'ID_3',TEXT_PARAMETER,ID3);
--this statement for get default printer and generate to text file
    host('CMD /C wmic printer where default=''TRUE'' get name > '||filename,NO_SCREEN);
--because wmic generate 3 lines, this statement for get only line where the 
--default printer located

    host('CMD /C Powershell "Get-Content '||filename||' | Select-Object -Index 1" > '||filename||'.txt', NO_SCREEN );
    begin
        IN_FILE  := TEXT_IO.FOPEN(filename||'.txt', 'r');   
        TEXT_IO.GET_LINE(IN_FILE,TEKS);
        --Trim TEKS, because there is spaces after default printer name
        TEKS := LTRIM(RTRIM(TEKS));
        TEXT_IO.FCLOSE(IN_FILE);
    exception when others then
        TEXT_IO.FCLOSE(IN_FILE);
    end;  

--erase temporary files

    host('CMD /R DEL '||filename||'.*',NO_SCREEN);    

--if there's default printer then automate print default printer on local computer

    if TEKS is null then
         ADD_PARAMETER(PL_ID,'DESTYPE',TEXT_PARAMETER,'PRINTER');
         ADD_PARAMETER(PL_ID,'DESNAME',TEXT_PARAMETER,TEKS);
--if there's no default printer then show your report
    else
         ADD_PARAMETER(PL_ID,'DESTYPE',TEXT_PARAMETER,'SCREEN');
    end if;     
    Add_Parameter(pl_id,'PARAMFORM', TEXT_PARAMETER, 'NO');
    Add_Parameter(pl_id,'PRINTJOB',  TEXT_PARAMETER,'YES'); 

    Run_Product(REPORTS,'VALIDATION', SYNCHRONOUS, RUNTIME,FILESYSTEM, pl_id, NULL);     
    Destroy_Parameter_List(pl_id);
END;

Reference: https://technet.microsoft.com/en-us/library/hh849895.aspx | https://adamstech.wordpress.com/2010/11/1 | http://stackoverflow.com/questions/17217476..

Notes: For windows XP/2003 you must install powershell, here’s the links:

  1. Microsoft .NET Framework 2.0 Service Pack 1 (x86)
  2. Update for Windows XP (KB968930): includes Windows PowerShell 2.0 and Windows Remote Management (WinRM) 2.0
  3. Update for Windows 2003

 

April 15, 2016

How to know all list printer on network

Filed under: dos,network — sikathabis @ 10:45 am
Tags: , , ,

@echo off

SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=2 delims==" %%a in ('wmic printer get name /value') do (
    set printer=%%a
    if defined printer (
      if "!printer:~0,2!"=="\\" (
        echo !printer! >> "C:\file.txt"
      )
    )
)
ENDLOCAL
echo on

reference: https://community.spiceworks.com/topic/365018-list-network-printers-via-batch-file
Next Page »

Blog at WordPress.com.

Learning is not a spectator sport

Connor McDonald's Oracle blog

Teknologi Pendidikan

Just another WordPress.com weblog

KATAKAMI

Jurnalisme Yang Dapat Dipercaya

Qey050489's Blog

Ayo Bangkit sobat..!!!!!

B. S. Totoraharjo

Orang Bodoh Yang Tak Kunjung Pandai

culturekitchen foodlab

New Food and Art in Yogyakarta

Wahyu Catur Wibowo

Musafir Dunia Maya

SQL.... Still Learning

My Reference on SQL Server

arihdyacaesar

"A distance is getting far if your heart is impatient" -ean-

neinframe

Street Photography is like a box of a chocolates, you're never know what you're gonna get - Thomas Leuthard -

Keluarga Andrivito

-- Andrivito's Journal --

DRK™

This site is about Latest NEWS, Articles, Videos, Books, Course, Presentations, Tips & Tricks related to I.T Pro's

Gaurav Saxena

|| तत् त्वम् असि ||

Be a good Moeslim

Menuju Pribadi Muslim Sejati yang Bertaqwa

TuanSUFI

Manajemen Sholat, renungan spiritual, Teknologi Informasi

Pelangi di khatulistiwa....

Mari berbagi kebaikan, pengalaman dan senyum denganku

Angkasa13

Ceritanya saya, Pikirannya saya, Hatinya saya

sikathabis

sikathabis semua informasi disini