MY First Package/Proc
Hello, It has been a couple of years since I took and Oracle class, so I am a bit rusty. I am trying to figure out the syntax on how to create the body of a package. My "Procedure" is very simple, read in a couple of parms and output some fields (multi row select). I got the "package" portion, to compile and it looks like the following:
CREATE OR REPLACE PACKAGE OPS_UI_QUERIES IS
PROCEDURE QRY_HIGHLIGHTS(i_Product_ID IN OPS_Milestones.PRODUCT_ID%TYPE,
i_Time_ID IN ops_Milestones.TIME_ID%TYPE,
o_Milestone_ID OUT OPS_Milestones.MILESTONE_ID%TYPE, o_Product_ID OUT OPS_Milestones.PRODUCT_ID%TYPE, o_Time_ID OUT OPS_Milestones.TIME_ID%TYPE,
o_Catagory_ID OUT OPS_Milestones.CATAGORY_ID%TYPE,
o_Sort_Order OUT OPS_Milestones.SORT_ORDER%TYPE,
o_Last_Update_DTTM OUT OPS_Milestones.LAST_UPDATE_DTTM%TYPE);
END;
So I have input values and output values.
When I define a cursor...do I also define all of the input and output values within the Parenthesis, like the following?
CREATE OR REPLACE PACKAGE BODY OPS_UI_QUERIES
IS
PROCEDURE QRY_HIGHLIGHTS (
CURSOR c_Highlights
(i_Product_ID IN OPS_Milestones.PRODUCT_ID%TYPE,
i_Time_ID IN ops_Milestones.TIME_ID%TYPE,
o_Milestone_ID OUT OPS_Milestones.MILESTONE_ID%TYPE;
) IS
select om.MILESTONE_ID
from ops_Milestones om
where product_id = i_Product_ID
and time_id = i_Time_ID
and deleted is null
order by sort_order;
AS
BEGIN
OPEN c_Highlights
FETCH c_Highlights INTO
o_Milestone_ID
EXIT WHEN c_Highlights%NOTFOUND;
RETURN o_Milestone_ID;
END;
END:
Do I have to place the output variables into a "DECLARE" section?
Will this return all the rows with "o_Mileston_ID"?
Im's sure there are easier ways to do this with a Cursor record, but I want to first do it the "hard way" and then come back an learn the easier way.
Thanks in advance for all of your assistance!!!
Do I have to place the output variables into a "DECLARE" section <<No, output variables are declared in the parameter list. A corresponding variable must exist in the caller.
Will this return all the rows with "o_Mileston_ID"? <<No, look up reference cursors. You need to ensure you close your cursor also. Procedures do not use the RETURN clause, functions do.
As written your procedure would read one row. You need a loop.
Either read the full pl/sql manual or buy a book on Pl/SQL. Connor MacDonnell wrote one that should be worth reading.
HTH -- Mark D Powell --
Similar Messages
-
My first Package - gnuradio-opt-git - 'provides'
Hi,
i released my first package gnuradio-opt-git. It is a fork of gnuradio-git with install Gnuradio to '/opt'. So you can install GnuRadio and GnuRadio-git parallel. Should i leave provides=('gnuradio') in the PKGBUILD? Or should i adapt it to provides=('gnuradio=3.7.4') like the wiki describe it?Here the libs from the actually git build:
ls /opt/gnuradio/lib :(
cmake/ libgnuradio-channels.so@ libgnuradio-fft.so@ libgnuradio-qtgui.so@ libgnuradio-vocoder.so@
libgnuradio-analog-3.7.5git.so@ libgnuradio-digital-3.7.5git.so@ libgnuradio-filter-3.7.5git.so@ libgnuradio-runtime-3.7.5git.so@ libgnuradio-wavelet-3.7.5git.so@
libgnuradio-analog-3.7.5git.so.0@ libgnuradio-digital-3.7.5git.so.0@ libgnuradio-filter-3.7.5git.so.0@ libgnuradio-runtime-3.7.5git.so.0@ libgnuradio-wavelet-3.7.5git.so.0@
libgnuradio-analog-3.7.5git.so.0.0.0* libgnuradio-digital-3.7.5git.so.0.0.0* libgnuradio-filter-3.7.5git.so.0.0.0* libgnuradio-runtime-3.7.5git.so.0.0.0* libgnuradio-wavelet-3.7.5git.so.0.0.0*
libgnuradio-analog.so@ libgnuradio-digital.so@ libgnuradio-filter.so@ libgnuradio-runtime.so@ libgnuradio-wavelet.so@
libgnuradio-atsc-3.7.5git.so@ libgnuradio-dtv-3.7.5git.so@ libgnuradio-noaa-3.7.5git.so@ libgnuradio-trellis-3.7.5git.so@ libgnuradio-wxgui-3.7.5git.so@
libgnuradio-atsc-3.7.5git.so.0@ libgnuradio-dtv-3.7.5git.so.0@ libgnuradio-noaa-3.7.5git.so.0@ libgnuradio-trellis-3.7.5git.so.0@ libgnuradio-wxgui-3.7.5git.so.0@
libgnuradio-atsc-3.7.5git.so.0.0.0* libgnuradio-dtv-3.7.5git.so.0.0.0* libgnuradio-noaa-3.7.5git.so.0.0.0* libgnuradio-trellis-3.7.5git.so.0.0.0* libgnuradio-wxgui-3.7.5git.so.0.0.0*
libgnuradio-atsc.so@ libgnuradio-dtv.so@ libgnuradio-noaa.so@ libgnuradio-trellis.so@ libgnuradio-wxgui.so@
libgnuradio-audio-3.7.5git.so@ libgnuradio-fcd-3.7.5git.so@ libgnuradio-pager-3.7.5git.so@ libgnuradio-uhd-3.7.5git.so@ libgnuradio-zeromq-3.7.5git.so@
libgnuradio-audio-3.7.5git.so.0@ libgnuradio-fcd-3.7.5git.so.0@ libgnuradio-pager-3.7.5git.so.0@ libgnuradio-uhd-3.7.5git.so.0@ libgnuradio-zeromq-3.7.5git.so.0@
libgnuradio-audio-3.7.5git.so.0.0.0* libgnuradio-fcd-3.7.5git.so.0.0.0* libgnuradio-pager-3.7.5git.so.0.0.0* libgnuradio-uhd-3.7.5git.so.0.0.0* libgnuradio-zeromq-3.7.5git.so.0.0.0*
libgnuradio-audio.so@ libgnuradio-fcd.so@ libgnuradio-pager.so@ libgnuradio-uhd.so@ libgnuradio-zeromq.so@
libgnuradio-blocks-3.7.5git.so@ libgnuradio-fec-3.7.5git.so@ libgnuradio-pmt-3.7.5git.so@ libgnuradio-video-sdl-3.7.5git.so@ libvolk.so@
libgnuradio-blocks-3.7.5git.so.0@ libgnuradio-fec-3.7.5git.so.0@ libgnuradio-pmt-3.7.5git.so.0@ libgnuradio-video-sdl-3.7.5git.so.0@ libvolk.so.0.0.0*
libgnuradio-blocks-3.7.5git.so.0.0.0* libgnuradio-fec-3.7.5git.so.0.0.0* libgnuradio-pmt-3.7.5git.so.0.0.0* libgnuradio-video-sdl-3.7.5git.so.0.0.0* pkgconfig/
libgnuradio-blocks.so@ libgnuradio-fec.so@ libgnuradio-pmt.so@ libgnuradio-video-sdl.so@ python2.7/
libgnuradio-channels-3.7.5git.so@ libgnuradio-fft-3.7.5git.so@ libgnuradio-qtgui-3.7.5git.so@ libgnuradio-vocoder-3.7.5git.so@
libgnuradio-channels-3.7.5git.so.0@ libgnuradio-fft-3.7.5git.so.0@ libgnuradio-qtgui-3.7.5git.so.0@ libgnuradio-vocoder-3.7.5git.so.0@
libgnuradio-channels-3.7.5git.so.0.0.0* libgnuradio-fft-3.7.5git.so.0.0.0* libgnuradio-qtgui-3.7.5git.so.0.0.0* libgnuradio-vocoder-3.7.5git.so.0.0.0*
3.7.5git vs 3.7.4. I think the simplest solution is to remove provides or have you a better idea? -
First package size is bigger then others
Hi,
I am using a data source based on a function module to extract the data from R/3 to BW.
The issue is that the data pulls the data correctly and everything is fine.
But its the first data package which is always half the size of the all the data loads.
So suppose if the total number of records in one of the deltas is 800000 then the first data package will be of the size 400000 and the rest packages will be fine and of the equal and small size and defined in the system setting.
I tried changing the settings in infopackage but it has no effect on this first data package and issue remains.
We are using the same code as used by standard SAP function module code and we give the parameter MAXSIZE when opening the cursor at the desired table.
If any can point me out on how to reduce the size of first data package??
Thanks for the help
AjeetDear Siggi,
You are write we are pulling lot of data during the datapackid=0
I just wnated to know if we can do something so that data is distributed to the other data packages equally.
Thanks for your answer
Ajeet -
ORA-06502: PL/SQL: numeric or value error ORA-06512: at "package.proc
Hi,
I'm getting the following error , when calling a procedure. Any input appreciated please
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "package.procedure ", line 513
ORA-06512: at line 26
v_counter NUMBER;
v_counter := 0; -- line number 513
FOR i in p_rec_attr.FIRST..p_rec_attr.LAST
LOOP
--IF instr(p_rec_attr(i),'=')<>0 THEN
IF v_counter = 0 THEN
soap_request := soap_request||'<doc:attributes>
<!--Zero or more repetitions:-->
<doc:CategoryAttributeVO>
<!--Optional:-->
<doc:name>'||substr(p_rec_attr(i),1,instr(p_rec_attr(i),'=')-1)||'</doc:name>
<!--Optional:-->
<doc:value>'||substr(p_rec_attr(i),instr(p_rec_attr(i),'=')+1)||'</doc:value>
</doc:CategoryAttributeVO>';
v_counter := v_counter + 1;
ELSE
IF i=p_rec_attr.last THEN
v_category_name := p_rec_attr(i);
soap_request := soap_request||'
</doc:attributes>
<!--Optional:-->
<doc:name>'||v_category_name||'</doc:name>';
v_counter := 0;
ELSE
soap_request := soap_request||'
<!--Zero or more repetitions:-->
<doc:CategoryAttributeVO>
<!--Optional:-->
<doc:name>'||substr(p_rec_attr(i),1,instr(p_rec_attr(i),'=')-1)||'</doc:name>
<!--Optional:-->
<doc:value>'||substr(p_rec_attr(i),instr(p_rec_attr(i),'=')+1)||'</doc:value>
</doc:CategoryAttributeVO>';
v_counter := v_counter + 1;
END IF;
END IF;
--ELSE
--END IF;
END LOOP;
ThanksHi
I tried this which is :
create or replace
procedure test is
v_counter NUMBER;
begin
v_counter := 0; -- line number 513
FOR i in 1..10
LOOP
--IF instr(p_rec_attr(i),'=')0 THEN
IF v_counter = 0 THEN
v_counter := v_counter + 1;
ELSE
IF i=9 THEN
v_counter := 0;
ELSE
v_counter := v_counter + 1;
END IF;
END IF;
END LOOP;
end;
Which does ot throw any error...I think it is being generated from somewhere else -
Criticisms? First package for r5u870-svn
NOTE: see below for finished product
So I'm building a Pkgbuild for the fun of learning how to do so.
In particular this one is for the r5u870 webcam driver which downloads from the svn and not a static source.
Thus far I have this:
# contributor: orionfyre <OrionFyre on ARCH Forums>
pkgname=r5u870-svn
pkgver=88
pkgrel=1
pkgdesc="r5u870 webcam driver"
arch=('i686' 'x86_64')
url="http://wiki.mediati.org/R5u870"
license=('unknown')
depends=()
makedepends=()
provides=(r5u870)
conflicts=()
source=()
md5sums=()
_svntrunk="http://svn.mediati.org/svn/r5u870/trunk"
_svnmod=r5u870
build() {
cd $startdir/src
msg "Connecting to SVN server...."
if [ -d $_svnmod/.svn ]; then
(cd $_svnmod && svn up -r $pkgver)
else
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
fi
msg "SVN checkout done or server timeout"
msg "Starting make..."
svn export $_svnmod $_svnmod-build
cd $_svnmod-build
# BUILD
sed -i 's/\/lib\/firmware/$pkgdir\/lib\/firmware/g' $startdir/src/r5u870/Makefile
# NOTE: need to send "$pkgdir/lib/firmare" without messing up the
# regex line with a bunch of extra '/' reserved characters.
make || return 1
make DESTDIR=$pkgdir install || return 1
The Makefile has a section like this:
install::
install -m 0644 -o root -g root $(FWFILES) $(FWDIR)
/sbin/depmod -a
which installs all the firmware.
FWFILES= a list of the files
FWDIR = /lib/firmware
I of course want to change the variable from '/lib/firmware' to '$pkgdir/lib/firmware'
The first method that came to mind was to use sed to edit the text contained within the Makefile
the only problem is the regex:
sed -i 's/\/lib\/firmware/$pkgdir\/lib\/firmware/g' $startdir/src/r5u870/Makefile
however $pkgdir will contain the reserved / with no character escapes '\' before it.
I'm stumped and tired. here's the relevant parts from the Makefile:
V ?= 0
MDIR := extra
KVER ?= $(shell uname -r)
KDIR ?= /lib/modules/$(KVER)/build
DESTDIR ?= /lib/firmware ## Firmware location
FWFILES = r5u870_1830.fw r5u870_1832.fw r5u870_1833.fw r5u870_1834.fw r5u870_1835.fw r5u870_1836.fw r5u870_1870_1.fw r5u870_1870.fw r5u870_1810.fw r5u870_183a.fw r5u870_183b.fw r5u870_1839.fw r5u870_1841.fw
<BIG SNIP...>
install::
install -m 0644 -o root -g root $(FWFILES) $(FWDIR)
/sbin/depmod -a
<SNIPS...>
So if you could school me on some sed regex or point me in the direction of another way of achieving the same I would be grateful.
Last edited by OrionFyre (2008-06-16 15:19:23)OK. here goes.
pkgbuild:
# contributor: orionfyre <OrionFyre on ARCH Forums>
pkgname=r5u870-svn
pkgver=88
pkgrel=1
pkgdesc="r5u870 webcam driver"
arch=('i686' 'x86_64')
url="http://wiki.mediati.org/R5u870"
license=('unknown')
depends=()
makedepends=()
provides=(r5u870)
conflicts=()
source=()
md5sums=()
install=$pkgname.install
_svntrunk="http://svn.mediati.org/svn/r5u870/trunk"
_svnmod=r5u870
build() {
cd $startdir/pkg
mkdir lib
cd lib
mkdir firmware
cd $startdir/src
msg "Connecting to SVN server...."
if [ -d $_svnmod/.svn ]; then
(cd $_svnmod && svn up -r $pkgver)
else
svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
fi
msg "SVN checkout done or server timeout"
msg "Starting make..."
svn export $_svnmod $_svnmod-build
cd $startdir/src/r5u870
sed -i 's/\/sbin\/depmod\ \-a/ /g' Makefile
cd $_svnmod-build
# BUILD
make || return 1
make DESTDIR=$pkgdir FWDIR=$pkgdir/lib/firmware install || return 1
and the install:
# arg 1: the new package version
post_install() {
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod -a > /dev/null 2>&1
modprobe r5u870
/bin/true
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod -a > /dev/null 2>&1
modprobe r5u870
/bin/true
# arg 1: the old package version
post_remove() {
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
KERNEL_VERSION=2.6.25-ARCH
depmod -a > /dev/null 2>&1
/bin/true
op=$1
shift
$op $*
I know it's messy. my first real attempt. any help at cleaning up that mkdir at the top of build{ couldn't seem to get to work any other way, would be appreciated.
Kudos? praise? criticisms? lambastes? -
Find in Package/Proc windows
I clicked on a package, a new tab was opened. I want to search that window for some text. Pressing ctrl-f does nothing, and the find commands are disabled from the menu. Is this intentional? I did not really want to edit the pkg, only take a look at something. The find is enabled in the edit pkg/proc.
So do I, but nevertheless it's a missing feature.
This was requested before, supposedly added in patch 1.1, but now it seems to be gone again. See http://htmldb.oracle.com/pls/otn/f?p=42626:39:2275182572504847::NO::P39_ID:3141 .
With all these regression issues, I wonder if the team is using a real repository as codebase, or if they are just overwriting someone else's changes... D'OH!
K. -
How to change code completion package proc name be inserted in origin case?
Hi,
it seems like the code completion for package function/procedure name is inserted in UPPER case. Is it possible to configure it to insert the name according to the exact case like what I typed in the package?
Please advise.
Thank you.Not at the moment.
They are supposedly working on improved code insight and this option may be included.
If you want it, you can add it to sqldeveloper exchange (or vote for an existing request) -
Viewing package/proc/funtion source in other schemas
There still seems to be some problems with viewing PL/SQL source in other schemas. In TOAD, I can grant SELECT ANY DICTIONARY to a developer and they can see all source in other schemas. In SQL Developer, they see nothing. If I grant EXECUTE ANY PROCEDURE, they can see the package specs, but no body (Note: we do not want developers having this priv).
Again, our developers need to be able to view the PL/SQL source in other schemas, without having execute privs on said objects, which is very easy in TOAD. I see this issue in many threads, but SQL Developer seems to have not progressed in this area (unless I'm doing something wrong).Granting select on dba_source has no affect. Sure, they can get the code from the table, but it would be nice to browse to it in the GUI. Even with "execute any procedure", the package bodies are not visible.
I've seen similar tools that have this same issue, but somehow the developers of TOAD got it right, a long time ago even. This is the only issue that keeps our development team from jumping on board with this tool. -
First package - created with compilation errors
I'm working my way through Learning Oracle PL/SQL, the O'Reilly book, the 2002 edition, page 92. These procedures work fine stand-alone but when one calls the other, when mxb_add_books calls mxb_add_book_copy, in a package I get compilation errors:
Create or replace package mxb_book
As
procedure mxb_add_book_copy (isbn_in in varchar2, barcode_ID_in in varchar2);
procedure mxb_add_books (isbn_in in varchar2, barcode_ID_in in varchar2, title_in in varchar2,
author_in in varchar2, page_count_in in number, summary_in in varchar2 default null, date_published_in in date default null);
end mxb_book;
create or replace package body mxb_book
as
/* private procedure for use only in this package body */
Procedure assert_notnull (tested_variable in varchar2)
Is begin
If tested_variable is null
Then
Raise value_error;
End if;
End assert_notnull;
procedure mxb_add_book_copy (isbn_in in varchar2, barcode_ID_in in varchar2)
is
begin
assert_notnull(isbn_in);
assert_notnull(barcode_id_in);
insert into MXB_book_copies_TEMP(isbn,barcode_id)
values (isbn_in, barcode_id_in);
exception
when dup_val_on_index
then
null;
end mxb_add_book_copy;
End;
procedure mxb_add_books (isbn_in in varchar2, barcode_ID_in in varchar2, title_in in varchar2,
author_in in varchar2, page_count_in in number, summary_in in varchar2 default null, date_published_in in date default null)
as
begin
/* check for reasonable inputs */
if isbn_in is null then
raise value_error;
end if;
/* put a record in the "books" table */
insert into MXB_books_TEMP(isbn, title, summary, author, date_published, page_count)
values (isbn_in,title_in, summary_in, author_in, date_published_in, page_count_in);
/* if supplied, put a record in the "book_copies" table */
if barcode_id_in is not null
then
mxb_add_book_copy (isbn_in, barcode_ID_in)
end if;
end mxb_add_books;
end mxb_book;welcome to the forum.
please read this to improve your posts:
SQL and PL/SQL FAQ
*[edit]*
--you're missing a ; before your last end if and <tt>END mxb_book; </tt> in the last line should be <tt>END mxb_book_body;</tt>.--
There is an additional <tt>end;</tt> after <tt> END mxb_add_book_copy;</tt> and the missing ; before your last end if .
bye
TPD
Edited by: T.PD on 14.12.2011 18:13 -
Hello everyone,
I've written a PKGBUILD for MOAI (http://getmoai.com/) but I'm not sure about a couple of things.
- I've seen in several other git-based packages that pkgver is a date (I suppose it's the packaging date). Is this a good practice?
- I'm not sure about which dependencies are really needed. I used ldd and pkgfile to discover the shared libraries which were needed but I didn't include all of them.
The full list (minus proprietary driver) is here: http://pastebin.com/4YZ7MjG2. Is there a better way?
This is the PKGBUILD (which is working fine here):
# Maintainer: Federico Rampazzo < myemail at gmail >
pkgname=moai-git
pkgver=20130208
pkgrel=1
pkgdesc=''
arch=('any')
url='https://github.com/moai/moai-dev'
license=('custom:CPAL')
depends=('freeglut' 'glu' 'libgl' 'libxmu' 'libxi' 'zlib')
makedepends=('git' 'cmake')
_gitroot='git://github.com/moai/moai-dev.git'
_gitname='moai-dev'
build() {
msg 'Connecting to GIT server...'
if [[ -d ${_gitname} ]]
then
cd ${_gitname}
git pull
else
git clone ${_gitroot}
cd ${_gitname}
fi
git checkout linux
msg 'GIT checkout done or server timeout'
cd cmake/
cmake .
make moai
package() {
cd ${_gitname}
install -d ${pkgdir}/usr/bin
install cmake/moai/moai \
${pkgdir}/usr/bin
Thanks in advanceThank you for your suggestions!
- namcap helped me with the unused dependencies and it turned out that freeglut was the only needed dependency
- I've fixed the arch, the pkgdesc and I've added the license
- I've replaced my build function with the one from PKGBUILD-git.proto (I just removed the double-clone and added the appropriate build steps)
Thanks again, I hope this is the final version
# Maintainer: Federico Rampazzo < mymail at gmail >
pkgname=moai-git
pkgver=20130208
pkgrel=1
pkgdesc='A Open Source cross-platform LUA-based tool to develop games, focused on mobile'
arch=('x86' 'x86_64')
url='https://github.com/moai/moai-dev'
license=('custom:CPAL')
depends=('freeglut')
makedepends=('git' 'cmake')
source=('CPAL')
sha256sums=('30d53bf709e16d849116bff147c59e4dfc8091672c324fc6af9caac1881c80ac')
_gitroot='git://github.com/moai/moai-dev.git'
_gitname='moai-dev'
pkgver () {
echo $(date +%Y%m%d)
build() {
cd "$srcdir"
msg "Connecting to GIT server...."
if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone "$_gitroot" "$_gitname"
fi
msg "GIT checkout done or server timeout"
msg "Starting build..."
git checkout linux
cd cmake
cmake .
make moai
package() {
install -Dm755 "$srcdir/$_gitname/cmake/moai/moai" "$pkgdir/usr/bin/moai"
install -Dm644 "$srcdir/CPAL" "$pkgdir/usr/share/licenses/$pkgname/CPAL" -
First Package, small problem
Can someone please explain how you need to properly define a
package, i keep getting told that i have to many public or private
functions and all kinds of stuff, my package below throws "Cant
have more then one externally visible definition" What does this
mean and why, i just want to understand this concept.
package Generic
import mx.effects.*;
var hideFade:Effect = new mx.effects.Fade();
public class UI
public static function
componentHide(obj:Object,dur:Number):void
hideFade.target = obj;
hideFade.duration= dur;
hideFade.play();
}Ok so i moved my effect into my class and it fixed that
"multiple visible definitions" error but now my function cant "see"
my effect, as if its not defined.. "Access of undefined property
hideFade".. what?
package Generic
import mx.effects.*;
public class UI
public var hideFade:Effect = new mx.effects.Fade();
public static function
componentHide(obj:Object,dur:Number):void
hideFade.target = obj; // THROWS ERROR //
} -
Critique requested for first package (QMentat)
I wrote a program to practice mental arithmetic, and I've just finished what I hope is a not too terrible attempt at making a PKGBUILD for it. I would greatly appreciate any critiques, pointers, etc. No warnings or errors shown from running namcap, and I paid close attention to the docs, so hopefully it's not too bad.
The PKGBUILD file is here: https://gist.github.com/RealGrep/5432464
The actual program's home page is here: http://realgrep.github.io/QMentat/
Please note that the warnings from a Qt header file when building are an issue with Qt uncovered by gcc 4.8.x, not my program.
Thanks.You shouldn't need to mkdir in the build and package functions (which solves the need for awkward "../foo" calls), nor should you have to manually clear .git files. Other than that, it seems fine.
As for gmp, it is assumed that the package groups 'base' and 'base-devel' are installed, thus there is no need to add depends on stuff like compilers.
Here's the PKGBUILD with the small tweaks applied: http://ix.io/5hH/sh
I'm not so sure about how it's installing the LICENSE though. That might be passable, although, you could remove it for a little more space saving (since GPL3 is already in /usr/share/license)
`tree -a' => http://ix.io/5hF
Last edited by Earnestly (2013-04-22 11:20:43) -
Chessdb: my first package
Hi all,
I'm trying to upgrade the package chess-db related to a chess database program. The problem is related to the permissions. It says that it cannot change permissions of '/usr/local/share/chessdb': No such file or directory
and build fails.
What can i do?
this is the pkgbuild:
# $Id$
# Contributor: Abc Def <[email protected]>
pkgname=chessdb
pkgver=3.6.18
pkgrel=1
pkgdesc="Free chess database"
arch=('i686')
url="http://chessdb.sourceforge.net"
license=('GPL')
depends=(tk)
source=(http://dl.sourceforge.net/sourceforge/chessdb/ChessDB-$pkgver.tar.gz)
md5sums=('6aee2e4eca26576cbe6e63dc6b8d55db')
build() {
cd $startdir/src/ChessDB-$pkgver
./configure BINDIR="/usr/bin" SHAREDIR="/usr/share/chessdb"
make || return 1
make DESTDIR=$startdir/pkg install
Last edited by virusso80 (2013-03-27 09:14:16)Their makefile's install target wasn't written properly. You could do everything manually inside the PKGBUILD's build function or patch Makefile.conf with something like this:
chessdb-3.6.18.diff:
diff -Naur ChessDB-3.6.18~/Makefile.conf ChessDB-3.6.18/Makefile.conf
--- ChessDB-3.6.18~/Makefile.conf 2009-05-28 10:11:16.000000000 -0500
+++ ChessDB-3.6.18/Makefile.conf 2009-05-28 10:11:49.000000000 -0500
@@ -227,14 +227,14 @@
# for all users, and put extra files in $SHAREDIR, type "make install".
install: all
- install -m 755 -d $(SHAREDIR)
+ install -m 755 -d $(DESTDIR)$(SHAREDIR)
install -m 755 -d $(DESTDIR)$(BINDIR)
- install -m 755 -d $(SOUNDSDIR)
- install -m 755 -d $(TBDIR)
- install -m 755 -d $(MANDIR)/man6
- -install -m 644 -p $(SOUNDS) $(SOUNDSDIR)
+ install -m 755 -d $(DESTDIR)$(SOUNDSDIR)
+# install -m 755 -d $(TBDIR)
+ install -m 755 -d $(DESTDIR)$(MANDIR)/man6
+ -install -m 644 -p $(SOUNDS) $(DESTDIR)$(SOUNDSDIR)
# -install -m 644 -p $(TABLEBASES) $(TBDIR)
- install -m 644 -p $(MAN6) $(MANDIR)/man6
+ install -m 644 -p $(MAN6) $(DESTDIR)$(MANDIR)/man6
install -m 755 chessdb $(SCRIPTS) $(EXECS) $(DESTDIR)$(BINDIR)
-install -m 755 -d $(DESTDIR)$(SHAREDIR)
-install -m 644 -p chessdb.eco ratings.ssp $(DESTDIR)$(SHAREDIR)
If you use the patch method, your build function would look something like this (note that SOUNDSDIR/MANDIR also have to be configured out of /usr/local):
build() {
cd "$srcdir"/ChessDB-$pkgver
patch -Np1 -i ../chessdb-$pkgver.diff || return 1
./configure BINDIR=/usr/bin SHAREDIR=/usr/share/chessdb \
SOUNDSDIR=/usr/share/chessdb/sounds MANDIR=/usr/share/man
make || return 1
make DESTDIR="$pkgdir" install -
hi Everyone!
i am trying to make my package work.
could you please tell me what am i doing wrong?
package myPackage;
import java.text.DecimalFormat;
public class Time2 extends Object
private int hour;
private int minute;
private int second;
public Time2()
setTime(0,0,0);
public Time2(int h)
setTime(h,0,0);
public Time2(int h, int m)
setTime(h,m,0);
public Time2(int h, int m, int s)
setTime(h,m,s);
public Time2(Time2 time)
setTime(time.hour, time.minute, time.second );
public void setTime(int h, int m, int s)
hour = ((h >= 0 && h < 24)? h : 0);
minute = ((m >= 0 && m < 60)? m : 0);
second = ((s >= 0 && s < 60)? s : 0);
public String toUniversalString()
DecimalFormat twoDigits = new DecimalFormat("00");
return twoDigits.format(hour) + ":" +
twoDigits.format(minute) + ":" +
twoDigits.format(second);
public String toString()
DecimalFormat twoDigits = new DecimalFormat("00");
return((hour == 12 || hour == 0)? 12 : hour%12)+
":" + twoDigits.format(minute)+
":" + twoDigits.format(second) +
(hour < 12 ? " AM" : " PM");
import myPackage.Time2;
import javax.swing.*;
public class TimeTest
public static void main(String args[])
Time2 t1, t2, t3, t4, t5, t6;
String output;
t1 = new Time2();
t2 = new Time2(2);
t3 = new Time2(21, 34);
t4 = new Time2(12, 25, 42);
t5 = new Time2(27, 74, 99);
t6 = new Time2(t4); //use t4 as initial value
output = "Constructed with: " +
"\nt1: all arguments defaulted" +
"\n " + t1.toUniversalString() +
"\n " + t1.toString();
output += "\nt2: hour specified; minute and " +
"second defaulted" +
"\n " + t2.toUniversalString() +
"\n " + t2.toString();
output += "nt3: hour and minute specified; " +
"second defaulted" +
"\n " + t3.toUniversalString() +
"\n " + t3.toString();
output += "\nt4: hour, minute, and second specified" +
"\n " + t4.toUniversalString() +
"\n " + t4.toString();
output += "\nt5: all invalide values specified" +
"\n " + t5.toUniversalString() +
"\n " + t5.toString();
output += "\nt6: Time2 object t4 specified" +
"\n " + t6.toUniversalString() +
"\n " + t6.toString();
System.exit(0);
}thanks in advance!
Regards,
Tucihi Kamran,
thanks for trying to help me.
the error message is this:
C:\JAVA>javac TimeTest.java
TimeTest.java:1: cannot resolve symbol
symbol : class Time2
location: package myPackage
import myPackage.Time2;
^
TimeTest.java:8: cannot access Time2
bad class file: .\Time2.class
class file contains wrong class: myPackage.Time2
Please remove or make sure it appears in the correct subdirectory of the classp
th.
Time2 t1, t2, t3, t4, t5, t6;
^
2 errors
how can i set the classpath to package level?
what kind of folders do i need to set?
Regards,
Tuci -
View or Package, logic problem which is better
I'm new to Oracle so I'm trying desperately to take what I know
from other systems and apply it here and I'm hitting a stumbling
block. I have a very complex view that I will spare you the
details to, but what it amounts to is:
create or replace view testview
as
select * from table_x where year_column=2001 ;
this is fine, but what do I do when I want to change the year to
something else? I don't want to have a view for every year,
that's a maintenance nightmare. I'm in the beginning stages
with packages, so I understand how they work and mostly how to
build one, and I'm halfway through building a procedure to
create the view, but in that case, I wonder what will happen
when the procedure is run a second time, will the person who ran
it the first time suddenly get the new view, will it invalidate
itself, or will it just crash? I am stuck with one schema with
a "global" type login, so it's not like each person can have
their own. I have thought of cursors, but I don't understand
how to use an explicit cursor as part of another SQL/cursor/view
because this view is only a small part of other views I am
building. I need to figure out how to pass the parameter from
an external system (non-Oracle) and handle most of the code in a
procedure/package or if I make this a view of all the available
data (with no year limit) and do the parameters on the other
side in the non-Oracle system it really slows things down to an
unacceptable level and doesn't teach me how to do anything new
or take advantage of the Oracle backend.
Any help will be deeply appreciated. thanks!Hey!
thanks for the input. It's exactly what I'm looking for as a
newbie. To give you some background, the database isn't that
unusual, it's a government financial app (non Oracle but Oracle
db) with about a million tables which I'm connecting to through
a database link which I have in my own database space because we
(devs) aren't allowed to create packages/procs in their space.
Which makes sense from a security standpoint, but it requires
some creative thinking for other issues. I'm doing reports,
which means creating a lot of "denormalized" views and when we
start talking about an entire year's worth of data at the
transaction level, it slows way down. Luckily a lot of the
stuff I'm doing is actually summaries for the year, etc. My
front end at the moment is Access/Visual FoxPro, but I'm hoping
to move to more web based reporting (tool TBD later - likely ASP
or Java, any recommendations?) as I stuff as much as humanly
possible into the PL/SQL to reduce the network traffic. Access
handles views really decently/transparently, but there's some
ugliness with ref cursors. One of my cohorts has found an
example on the web somewhere and while passing the parameter in
isn't a big deal, it's an ugly bunch of VBA code just to process
the returned cursor, something about it having to load it row by
row. I've only glanced at it and need to look at it in more
detail. I was just hoping I'd missed something more
obvious/simpler through inexperience. I do admit Oracle is
capable of doing some of the most complicated SQL I've ever seen
and it's kinda fun to see exactly how many
joins/tables/subqueries I can throw into a single SQL. I'm just
not used to looking at it that way; I'm more used to writing
several sequential SQL statements that can build on or refer to
each other by a temporary name/alias. I either haven't figured
out the syntax/commands to map what I know how to do to the way
Oracle does it, or maybe it's just never done that way? Hard to
say. But then again I live to learn through trial by fire. :)
thanks much!!
Maybe you are looking for
-
Everytime I open iTunes to play music, NOT to access the iTunes Store, I get the password sign in box for the iTunes Store. If I click cansel the box pops up a second time. When I try to sign in to the iTunes Store it does not except the password and
-
How much RAM can I put in a previous-generation (2008) iMac 2.4CHz
Hi Guys, Silly question, but can I put more than 4GB of RAM in my 2008 model 2.4GHz iMac? I have upped it to 4GB (2 sticks of 2), but wonder if you can get 4GB sticks for a total of 8GB (2 sticks of 4)? I'm running Logic Pro 8 and with the virtual in
-
DOWNGRADE TO 10.0.2
I Want to downgrade to 10.0.2 10.0.3 is by far the worst FCPX ever for all I care the multicam could go some where else I think shooting several camera angles and mounting it all with a bit of more time consuming could compensate in the performance o
-
we are running OAS 10.1.2 and need to backup Middle Tier which is on separate Server. What is essentional to Backup (whole DB or only Conf files)
-
I live on a boat so I use a wifi antenna adapter to get internet. I used mozilla 3.6 until 5 came out and I updated. After that my internet stops more so I called the manufacturer and he said it doesn't work well with Mozilla 5 and I should change ba