Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 68212 invoked from network); 22 Dec 2009 10:07:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Dec 2009 10:07:07 -0000 Received: (qmail 54536 invoked by uid 500); 22 Dec 2009 09:30:44 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 54515 invoked by uid 500); 22 Dec 2009 09:30:44 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 54506 invoked by uid 500); 22 Dec 2009 09:30:42 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 54502 invoked by uid 99); 22 Dec 2009 09:30:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 09:30:42 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 09:30:36 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id C899917620; Tue, 22 Dec 2009 09:30:15 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Tue, 22 Dec 2009 09:30:15 -0000 Message-ID: <20091222093015.8944.85850@eos.apache.org> Subject: =?utf-8?q?=5BCouchdb_Wiki=5D_Update_of_=22Getting=5Fstarted=5Fwith=5FPL?= =?utf-8?q?=5FSQL=22_by_StefanNeudorfer?= Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for c= hange notification. The "Getting_started_with_PL_SQL" page has been changed by StefanNeudorfer. http://wiki.apache.org/couchdb/Getting_started_with_PL_SQL?action=3Ddiff&re= v1=3D2&rev2=3D3 -------------------------------------------------- PLCouch is a simple way to save Oracle-Data in a document based database.= With PLCouch, you can create, updet and delete documents, manage Databases. = =3D=3D Dependencies =3D=3D - * - http://code.google.com/p/pl-couch/ + * http://code.google.com/p/pl-couch/ = - * - https://sourceforge.net/projects/pljson/ + * https://sourceforge.net/projects/pljson/ - = = =3D=3D Sample Usage =3D=3D + {{{ + SET SERVEROUTPUT ON SIZE 1000000 + DECLARE + -- + PROCEDURE ASSERTTRUE(B BOOLEAN) AS + BEGIN + IF(NOT B) THEN RAISE_APPLICATION_ERROR(-20111, 'Test error'); END IF; + END; + -- + PROCEDURE ASSERTFALSE(B BOOLEAN) AS + BEGIN + IF(B) THEN RAISE_APPLICATION_ERROR(-20111, 'Test error'); END IF; + END; + -- + BEGIN + -- + -- Connect to database + PL_COUCH_DB.INIT_DB(HOSTNAME =3D> :HOST + ,PORT =3D> :PORT + ,ADMIN =3D> :admin + ,adminpwd =3D> :adminpwd); + ASSERTTRUE(PL_COUCH_DB.PING_COUCHDB); + -- + DBMS_OUTPUT.PUT_LINE('couchDB-Version:' || PL_COUCH_DB.GET_VERSION); + -- Check Database + ASSERTTRUE(PL_COUCH_DB.PING_COUCHDB); + -- + databasename :=3D 'test' || TO_CHAR(SYSDATE, 'YYMMDDHH24MISS') || 'x'; + DBMS_OUTPUT.PUT_LINE('Create Database: ' || databasename); + ASSERTTRUE(PL_COUCH_DB.CREATE_DB(DATABASENAME)); + -- + jList :=3D PL_COUCH_DB.GET_ALL_DB; + -- + IF jList.count > 0 THEN + FOR I in 1 .. jList.count LOOP + listElement :=3D jList.get_elem(I); + dummy :=3D listElement.getvarchar2(charElement); + DBMS_OUTPUT.PUT_LINE('Database: ' || charElement); + END LOOP; + END IF; + -- + DBMS_OUTPUT.PUT_LINE('Drop Database: ' || databasename); + ASSERTTRUE(PL_COUCH_DB.DROP_DB(DATABASENAME)); + -- + END; + / = + PROMPT ENDE + }}} + More Samples see: http://code.google.com/p/pl-couch/downloads/list +=20