Help with procedures
If I create a procedure like:
procedure (number a =100;number b=150; number c);
Exec procedure(500,650);
What is the output?
Please help
If you could call like your mentioned means (parameter lacking call),
you must get error message as
PLS-00306: wrong number or types of arguments in call to 'PROCEDURE'.
BTW, I think you perhaps couldn't create and/or execute procedure,
'cause you wouldn't know how to do those.
PLS refer documentations
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
Similar Messages
-
New to pl/sql and need help with procedure
Hello there, I got two tables STAFF and BONUS which are not related by any constraints
STAFF
ID_NUMBER HIREDATE SALARY BONUS
100020 12-MAY-03 13600
100021 04-NOV-01 30000
100022 08-APR-02 28000
100023 08-APR-02 24000
BONUS
PERCENTAGE MORE_THAN_YEARS
0.1 3
0.15 5
0.3 7
0.45 9
0.5 12
I am trying to create a procedure that would calculate bonus based on years of employment according to bonus table.
If employees sysdate -hiredate is greater than 5, he would get salary*0.15%....
I created this procedure, but I got stuck here.
I calculated the length of employment for every soldier using cursor in a loop, but I don't know how to get values from bonus table and connect them together.
Please help me!
create or replace
procedure bonus_staff
as
cursor c1 is select *from staff;
bon real;
begin
FOR ITEM IN C1
LOOP
bon := FLOOR(months_BETWEEN(SYSDATE,ITEM.hiredate)/12)*
update staff
set bonus = bon
where id_number = ITEM.id_number;
exit when c1%notfound;
end loop;
end;
Thanks in advance..update staff
set bonus = (select percentage
from bonus
where more_than_years = (select max(more_than_years)
from bonus
where more_than_years <= FLOOR(months_BETWEEN(SYSDATE,staff.hiredate)/12)
You can do this in pure SQL, which operates on a set, so no PL/SQL is required.
Sybrand Bakker
Senior Oracle DBA -
Hi everyone,
If someone can help me with this..
I have a mster table that is used by our billing software which is a non custom designed s/w. I still can work on the tables for that s/w but i do not want to modify any of them and get no references(set const as froeign keys) from them. I want to run some scripts and do some checking on the data..my primary key is invoice in the master table which is auto gen when ever a new invoice is created for a cust.
I want to create a table and that has some fields liked with this invoice...which wud be values like memo or some other comments in another table.
What i need to do is whenever a new record is inserted ie a new inv is generated the invoice number is added in to the sec tabble as well...But the problem here is that i dont want all the invoice numbers to be added as i said i am using a script to check for a condition..so if that invoice number exist true for that cond only then it cud be added....for example we can say it is checkin for total invoice being less then has a particular item so only those invoices with with that item should be added...in to the sec table..
Is there any way to do it without the use of triggers and can someone send me the syntax ...with either the use of triggers..or without them ..
AshishCan anyone help..?
Ashish -
Need Help With a Stored Procedure
Help With a Stored Procedure
Hi everyone.
I am quite new relative to creating stored procedures, so I anticipate that whatever help I could get here would be very much helpful.
Anyway, here is my case:
I have a table where I need to update some fields with values coming from other tables. The other tables, let us just name as tblRef1, tblRef2 and tblRef3. For clarity, let us name tblToUpdate as my table to update. tblToUpdate has the following fields.
PlanID
EmployeeIndicator
UpdatedBy
CreatedBy
tblRef1, tblRef2 and tblRef3 has the following fields:
UserName
EmpIndicator
UserID
In my stored procedure, I need to perform the following:
1. Check each row in the tblToUpdate table. Get the CreatedBy value and compare the same to the UserName and UserID field of tblRef1. If no value exists in tblRef1, I then proceed to check if the value exists in the same fields in tblRef2 and tblRef3.
2. If the value is found, then I would update the EmployeeIndicator field in tblToUpdate with the value found on either tblRef1, tblRef2 or tblRef3.
I am having some trouble writing the stored procedure to accomplish this. So far, I have written is the following:
CREATE OR REPLACE PROCEDURE Proc_Upd IS v_rec NUMBER;
v_plan_no tblToUpdate.PLANID%TYPE;
v_ref_ind tblToUpdate.EMPLOYEEINDICATOR%TYPE;
v_update_user tblToUpdate.UPDATEDBY%TYPE;
v_created_by tblToUpdate.CREATEDBY%TYPE;
v_correct_ref_ind tblToUpdate.EMPLOYEEIDICATOR%TYPE;
CURSOR cur_plan IS SELECT PlanID, EmployeeIndicator, UPPER(UpdatedBy), UPPER(CreatedBy) FROM tblToUpdate;
BEGIN
Open cur_plan;
LOOP
FETCH cur_plan INTO v_plan_no, v_ref_ind, v_update_user, v_created_by;
EXIT WHEN cur_plan%NOTFOUND;
BEGIN
-- Check if v_created_by has value.
IF v_created_by IS NOT NULL THEN
-- Get the EmpIndicator from the tblRef1, tblRef2 or tblRef3 based on CreatedBy
SELECT UPPER(EmpIndicator)
INTO v_correct_ref_ind
FROM tblRef1
WHERE UPPER(USERNAME) = v_created_by
OR UPPER(USERID) = v_created_by;
IF v_correct_ref_ind IS NOT NULL THEN
-- Update the Reference Indicator Field in the table TRP_BUSPLAN_HDR_T.
UPDATE TRP_BUSPLAN_HDR_T SET ref_ind = v_correct_ref_ind WHERE plan_no = v_plan_no;
ELSIF
-- Check the Other tables here????
END IF;
ELSIF v_created_by IS NULL THEN
-- Get the EmpIndicator based on the UpdatedBy
SELECT UPPER(EmpIndicator)
INTO v_correct_ref_ind
FROM tblRef1
WHERE UPPER(USERNAME) = v_update_user
OR UPPER(USERID) = v_created_by;
IF v_correct_ref_ind IS NOT NULL THEN
-- Update the Reference Indicator Field in the table TRP_BUSPLAN_HDR_T.
UPDATE TRP_BUSPLAN_HDR_T SET ref_ind = v_correct_ref_ind WHERE plan_no = v_plan_no;
ELSIF
-- Check the Other tables here????
END IF;
END IF;
END;
END LOOP;
CLOSE cur_plan;
COMMIT;
END
Please take note that the values in the column tblToUpdate.UpdatedBy or tblToUpdate.CreatedBy could match either the UserName or the UserID of the table tblRef1, tblRef2, or tblRef3.
Kindly provide more insight. When I try to execute the procedure above, I get a DATA NOT FOUND ERROR.
Thanks.Ah, ok; I got the updates the wrong way round then.
BluShadow's single update sounds like what you need then.
I also suggest you read this AskTom link to help you see why you should choose to write DML statements before choosing to write cursor + loops.
In general, when you're being asked to update / insert / delete rows into a table or several tables, your first reaction should be: "Can I do this in SQL?" If you can, then putting it into a stored procedure is usually just a case of putting the sql statement inside the procedure header/footers - can't really get much more simple than that! *{;-) -
Error is
ORA-06550: line 1, column 71:
PLS-00103: Encountered the symbol ">" when expecting one of the following:
. ( ) , * @ % & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
ORA-06550: line 1, column 71:
PLS-00103: Encountered the symbol ">" when expecting one of the following:
. ( ) , * @ % & = - + < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The problem is I don't have < or > in my procedure. The error shows when I call procedure from c# using OleDb provider. Any help with this. The procedure works fine from sql developer.Hi Marcus ,
I did the same thing on my database based on the script you had given.
Please go through it.
SQL> create table location(location_number number, location_id number, usage_id number);
Table created.
SQL> insert into location values(10,20,30);
1 row created.
SQL> insert into location values(11,21,31);
1 row created.
SQL> create table usage( usage_number number, usage_id number);
Table created.
SQL> insert into usage values(50,30);
1 row created.
SQL> insert into usage values(60,40);
1 row created.
SQL> commit;
Commit complete.
SQL> create or replace
PROCEDURE P_GET_ALL(
p_place in number,
2 p_location out number,
3 4 p_usage out number)
5 6 is
begin
7 select loc.location_number into p_location from location loc where
8
loc.location_id=p_place;
select us.usage_number into p_usage from usage us where us.usage_id=(select
loc.usage_id from location loc where loc.location_id=p_place);
end; 9 10 11 12 13 14
15 /
Procedure created.
Hope it would help you. :)
Thanks,
Balaji K. -
Help with Command - Stored Procedure
Hi all,
I'm having a great deal of difficulty getting my head around
an update command / stored procedure, I've pulled out all of my
books and spent the last two days on Google which has made my
confusion worse. In simple terms what I'm trying to do is update a
field in a table with the value y, but based on certain criteria.
So my table has the following fields -
JBAID
JBASiteID
JBADatePosted
JBAPostFor
JBANotified
What i want to do is update the value of field JBANotified on
all records that meeting the following criteria to Y
The criteria is -
WHERE DATEADD(d,JBAPostFor,JBADatePosted) BETWEEN DATEADD(d,
-7, GETDATE()) AND GETDATE() AND JBANotified = 'n' AND JBASiteID =
MMColParam (where MMColParam is Session("SITEID"))
So I've just tried building a command / stored procedure -
which reads (see attached code)(more than likely all wrong)
The things that I cant get my head around are -
Firstly getting the code right in the first place, running
the command on page load and then when the command has run
redirecting to the next page.
I really would appreciate some help with this -
thanks allEd Stewart wrote:
> Are you using CS3 with ASP/VBScript? There is a bug in
the command
> implementation that has this function broken.
>
> I asked about it in this forum several months ago, but
now I can't find my
> original post, but I did find another post that talks
about the same thing:
>
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=26
> 3&threadid=1281539&enterthread=y
>
> My solution is to drop back to DW8 for command editing,
but use CS3 for
> everything else. I don't know what you're supposed to do
if you don't have an
> earlier version.
>
> It looks like your sql is correct, but the bug prevents
the second code block
> is not being updated with the correct values.
>
> I hope a solution is forthcoming....
>
Create a stored procedure and then use a recordset to
exectute it,
making sure the recordset has matching parameters that the
stored
procedure expects.
Commands are broken, I reported it to Adobe and they said it
might get
fixed in the next version.
Steve -
Help with if statement in cursor and for loop to get output
I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
Here is my cursor:
/*Cursor for Email procedure. It is working Shows userid and the string
You need to update these folders*/
DECLARE
a_user varchar2(200) := null;
v_assigneduser varchar2(20);
v_folderrsn varchar2(200);
v_emailaddress varchar2(60);
v_subject varchar2(200);
Cursor c IS
SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
--MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
WHERE f.foldertype = 'HJ'
AND f.statuscode NOT IN (20, 40)
AND f.folderrsn = fp.folderrsn
AND fp.processrsn = fpa.processrsn
AND vu.userid = fp.assigneduser
AND vu.statuscode = 1
GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
ORDER BY fp.assigneduser;
BEGIN
FOR c1 IN c LOOP
IF (c1.assigneduser = v_assigneduser) THEN
dbms_output.put_line(' ' || c1.folderrsn);
else
dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
END IF;
a_user := c1.assigneduser;
v_assigneduser := c1.assigneduser;
v_folderrsn := c1.folderrsn;
v_emailaddress := c1.emailaddress;
v_subject := 'Subject: Project for';
END LOOP;
END;
The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
emailaddress
Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
v_folderrsn
v_folderrsn
etc
[email protected]......
Subject: 'Project for: ' Jim...'not updated in the last 30 days'
284087
292709
[email protected].....
Subject: 'Project for: ' Kim...'not updated in the last 30 days'
185083
190121
190132
190133
190159
190237
284109
286647
294631
322922
[email protected]....
Subject: 'Project for: Joe...'not updated in the last 30 days'
183332
183336
[email protected]......
Subject: 'Project for: Sam...'not updated in the last 30 days'
183876
183877
183879
183880
183881
183882
183883
183884
183886
183887
183888
This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
JIM......... jim@ aol.com.... 284087............. 9/28/2006.......10/5/2006...........690
JIM......... jim@ aol.com.... 292709............. 3/20/2007.......3/28/2007............516
KIM......... kim@ aol.com.... 185083............. 8/31/2004.......2/9/2006............. 928
KIM...........kim@ aol.com.... 190121............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190132............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190133............. 2/9/2006.........2/9/2006.............928
KIM...........kim@ aol.com.... 190159............. 2/13/2006.......2/14/2006............923
KIM...........kim@ aol.com.... 190237............. 2/23/2006.......2/23/2006............914
KIM...........kim@ aol.com.... 284109............. 9/28/2006.......9/28/2006............697
KIM...........kim@ aol.com.... 286647............. 11/7/2006.......12/5/2006............629
KIM...........kim@ aol.com.... 294631............. 4/2/2007.........3/4/2008.............174
KIM...........kim@ aol.com.... 322922............. 7/29/2008.......7/29/2008............27
JOE...........joe@ aol.com.... 183332............. 1/28/2004.......4/23/2004............1585
JOE...........joe@ aol.com.... 183336............. 1/28/2004.......3/9/2004.............1630
SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............ 1631
SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............ 1631
PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............ 48
PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............ 175
NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
[email protected]/27/2004.......3/8/2004............1631
How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
Edited by: user4653174 on Aug 25, 2008 2:40 PManalytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
CASE
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
Incorporating either of these into your query should assist you in returning the desired results. -
Query Help with Parent, Child, Child's Child
Hi all,
Need some help with a query. I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details. In my situation the tables are different but nevertheless, I want to grab all the fields from the Parent, Child,
and Childs' Child, where the Parent.ParentID = @Parameter. I tried this:
CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
@ProjectID int = 0
AS
SELECT *,
(SELECT *,
(SELECT *
FROM PageControls
WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
FROM ProjectPages
WHERE (ProjectPages.ProjectID = @ProjectID))
FROM Projects
WHERE (ProjectID = @ProjectID)
FOR XML AUTO, ELEMENTS
RETURN 0
I think I'm close, but it was my best effort. Could someone help?
thanks in advanceHi TPolo,
Regarding your description, are you looking for a sample like below?
CREATE TABLE customer(customerID INT, name VARCHAR(99))
INSERT INTO customer VALUES(1,'Eric')
INSERT INTO customer VALUES(2,'Nelson')
CREATE TABLE orders(orderID INT,customerID INT)
INSERT INTO orders VALUES(1,1);
INSERT INTO orders VALUES(2,1)
INSERT INTO orders VALUES(3,2)
INSERT INTO orders VALUES(4,2)
CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
INSERT INTO orderDetails VALUES(1,'APPLE1')
INSERT INTO orderDetails VALUES(1,'BANANA1')
INSERT INTO orderDetails VALUES(2,'APPLE2')
INSERT INTO orderDetails VALUES(2,'BANANA2')
INSERT INTO orderDetails VALUES(3,'APPLE3')
INSERT INTO orderDetails VALUES(3,'BANANA3')
INSERT INTO orderDetails VALUES(4,'APPLE4')
INSERT INTO orderDetails VALUES(4,'BANANA5')
SELECT customer.customerID,customer.name,
(SELECT orderId,
SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
FROM customer WHERE customerID=1
FOR XML AUTO,ELEMENTS
DROP TABLE customer,orderDetails,orders
If you have any feedback on our support, please click
here.
Eric Zhang
TechNet Community Support -
Hi All,
i have a few triggers that I need your help with.
The first trigger (below) is fired when an update is made to a column in an invoices table.
The question I have is to do with the exception section.
I want to change the status of the invoice if it fails to F.
This trigger has already complied fine but I have no test data yet to test against.
I was unsure of the mutating effect and was wondering if the exception section will cause it to mutate since it is trying to update the status of the current invoice being processed. Pls see below
create or replace
TRIGGER POP_STAGE AFTER
UPDATE OF "EXCHANGED_DATE" ON "INVOICES" FOR EACH ROW
declare
-- check if the invoice.mco_transfer_status has been updated to R
-- if it has then insert records into the relevant tables
-- Start the Insert based on the update of invoices.mco_transfer_status
ecode varchar2(100);
thisproc CONSTANT VARCHAR2(80) := 'trap_errmesg for transfer_status';
v_value varchar2(150);
BEGIN
-- do updates based on update of invoices.transfer_status column
IF :NEW.TRANSFER_STATUS='R'
THEN
-- Insert into E_TICKET_STAGE
INSERT INTO E_TICKET_STAGE (emco_document_number,exchanged_date,pax_seq,pax_forename,pax_surname,pax_type)
select :NEW.EMCO_DOCUMENT_NUMBER, :NEW.EXCHANGED_DATE,PX.PAX_SEQ,PX.FORENAME,PX.SURNAME,PX.PAX_TYPE
FROM PAX PX WHERE PX.BOOKING_ID=:NEW.BOOKING_ID;
-- Insert into SECTOR_STAGE table
INSERT INTO SECTOR_STAGE (emco_document_number,ps_id,sector_seq,pax_seq,fare_class,fare_basis,net_fare,tax,gross_fare,
flight_number,departure_date,dep_airport_code,dest_airport_code)
SELECT :NEW.EMCO_DOCUMENT_NUMBER, PS.PS_ID,PS.SECTOR_SEQ,PS.PAX_SEQ,PS.FARE_CLASS,PS.FARE_BASIS,PS.NET_FARE,PS.TAX,PS.GROSS_FARE,BS.FLIGHT_NUMBER,BS.DEPARTURE_DATE,
BS.DEP_AIRPORT_CODE,BS.DEST_AIRPORT_CODE
FROM PAX_SECTORS PS, BOOKING_SECTORS BS
WHERE PS.BOOKING_ID=:NEW.BOOKING_ID
AND BS.BOOKING_ID=PS.BOOKING_ID;
-- Insert into TAX_STAGE table
INSERT INTO TAX_STAGE (emco_docUment_number,PS_ID,TAX_SEQ,TAX_CODE,VALUE)
SELECT :NEW.EMCO_DOCUMENT_NUMBER, pt.PS_ID,TAX_SEQ,TAX_CODE,VALUE
FROM PAX_TAX pt,PAX_SECTORS ps
WHERE ps.BOOKING_ID=:OLD.booking_id and pt.PS_ID=ps.PS_ID;
-- Insert into CHARGES_STAGE table
insert into CHARGES_STAGE (emco_document_number,CHARGE_TYPE,CHARGE_AMOUNT)
select :NEW.EMCO_DOCUMENT_NUMBER, CHARGE_TYPE,VALUE FROM INVOICE_DETAILS IND
WHERE :NEW.INVOICE_ID=IND.INVOICE_ID;
END IF;
EXCEPTION
WHEN OTHERS THEN
ecode := SQLCODE|| ' '||sqlerrm ;
dbms_output.put_line(thisproc || ' - ' || ecode);
v_value := thisproc || ' - ' || ecode;
-- Insert into DOCUMENT_STATUS_STAGE ANY ERRORS DURING PROCESSING
insert into DOCUMENT_STATUS_STAGE (EMCO_DOCUMENT_NUMBER, STATUS,STATUS_DATE)
VALUES (:NEW.EMCO_DOCUMENT_NUMBER,v_value,sysdate);
update invoices set TRANSFER_STATUS='F' where invoice_id=:old.invoice_id;
END pop_stage;
The second trigger (also below) does a check on the payments table to see if the payment_complete date has been set.
If this has been set then we want to sum all the payments (based on invoice_id). once this sum has been made we want to compare this value to the value of the gross amount on the invoices table for that invoice. if they match (which shows the invoce has been fully paid) then we want to update the paid_date and set to sysdate.
create or replace
TRIGGER CHECK_INVOICE_STATUS AFTER
UPDATE OF "PAYMENT_COMPLETE" ON "PAYMENTS" FOR EACH ROW
declare
-- check if all the payments for that invoice have been received (completed)
-- if they are complete then sum all the payments for that invoice and compare to gross value on invoices
v_invoice_amount number;
v_gross_amount number;
thisproc CONSTANT VARCHAR2(80) := 'trap_errmesg for mco_transfer_status';
v_value varchar2(150);
BEGIN
IF :NEW.PAYMENT_COMPLETE is not null
THEN
-- We will sum all the payments for that invoice that have a value in payment_complete
select sum(amount) into v_invoice_amount from payments where payment_complete is not null
group by :OLD.INVOICE_ID;
-- We will also get the gross amount for the invoice to compare to the sum of the payments
select gross into v_gross_amount from invoices where
:OLD.INVOICE_ID = invoice_id;
END IF;
IF v_invoice_amount = v_gross_amount
then
update invoices set paid_date=sysdate;
end if;
end CHECK_INVOICE_STATUS;
Is this trigger sufficent?
Any tips will be appreciate.
ThanksI didn't really look into your post (rather long) ... anyway, I have 2 words for you "stored procedures".
-
Totally frustrated! I find it impossible to cut and paste parts of my video clips or to merge video clips or to move parts of a clip.Isn't that what video editing is supposed to be all about?
The help topics for iMovie aren't even in an understandable/make sense kiind of language.
Can soneone help with some simple procedures to do the above? Or do they not exist?
Thanks for any help. I'm ready to give up.
Also, why is there no iMovie 11 anywhere? I've seen references to it, but all the App Store has is 10.Thanks Alan,
The info about 10 vs 11 is helpful.
On the rest, that's helpful too. It kind of tells me I must be off base somehow. I've tried all the copying, cutting, pasting and dragging and none of it works because when I drag a selected part or all of a clip, it doesn't work and when I copy a part and then click to paste it, nothing happens and the cut and the paste and the insert are always grayed out. It makes sense what you're saying about the selecting and cutting or copying or pasting. That's always standard procedure. That's why I'm so frustrated.
Maybe I don't know exactly what the "timeline" is. ???
What I have is 5 clips from one stage show that I converted to .mov files and 6 clips from another that I also converted. Then I imported them into iMovie as 2 new events and I tried doing the editing on each of the events, deleting some frames and trying to copy some from one to the other. That didn't work, so I put both shows (events) together in the updated projects folder and nothing still worked.
I remember when I did this last year, I made it work somehow, but I sure don't get it now. I guess maybe another part that I'm missing is how to get them into a project and then to a finalized movie. None of the pieces seem to fit this time.
I sure appreciate any more help you can give me.
Thanks so much
Fred -
Urgent help with simple BPEL process for reading data from database
Hello there,
I need help with BPEL project.
i have created a table Employee in Database.
I did create application, BPEL project and connection to the database properly using Database Adapter.
I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
Can someone please describe me step by step what i need to do.
Thx,
DpsI have created a table in Database with data like Empno,name,salary,comments.
I created Database Connection in jsp page and connecting to BPEL process.
It initiates the process and it goes automatically for approval.
Please refer the code once which i created.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.Map" %>
<%@page import="com.oracle.bpel.client.Locator" %>
<%@page import="com.oracle.bpel.client.NormalizedMessage" %>
<%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
<%@page import="javax.naming.Context" %>
<%@page import="java.util.Hashtable" %>
<%@page import="java.util.HashMap" %>
<%@ page import="java.sql.*"%>
<%@ page import= "jspprj.DBCon"%>
<html>
<head>
<title>Invoke CreditRatingService</title>
</head>
<body>
<%
DBCon dbcon=new DBCon();
Connection conn=dbcon.createConnection();
Statement st=null;
PreparedStatement pstmt=null;
Hashtable env= new Hashtable();
ResultSet rs = null;
Map payload =null;
try
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
env.put("java.naming.security.principal", "username");
env.put("java.naming.security.credentials", "password");//bpel console
Locator locator = new Locator("default","password",env);
IDeliveryService deliveryService =
(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
java.util.HashMap map = new HashMap();
st=conn.createStatement();
out.println("connected");
String query1="Select * from EMPLOYEE";
rs=st.executeQuery(query1);
/*reading Data From Database and converting into XML format
so that no need of going to BPEL console and entering the details.
while (rs.next()){
String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
"<Empno>"+rs.getString(1)+"</Empno>"+
"<EmpName>"+rs.getString(2)+"</EmpName>"+
"<Salary>"+rs.getString(3)+"</Salary>"+
"<Comments>"+rs.getString(4)+"</Comments>"+
"</AsynchBPELProcess1ProcessRequest>";
out.println(xml1);
nm.addPart("payload", xml1 );
// EmployeeApprovalProcess is the BPEL process in which human task is implemented
deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
// payload = res.getPayload();
out.println( "BPELProcess CreditRatingService executed!<br>" );
// out.println( "Credit Rating is " + payload.get("payload") );
//Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
catch(Exception ee) {
//("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
%>
</body>
</html>
Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this. -
Need Help with Transporting Playlists Back to I-Tunes
If anyone can help with this issue, I would really appreciate it. Here's my situation:
After many long hours organizing my playlists on I-Tunes, my pc malfunctioned and I needed a complete software overhaul. Therefore, I have had to reinstall all software programs on my computer...including I-Tunes. Due to these procedures, I have lost all of my playlists on I-Tunes.
I did manage to save all of my songs to an external hard drive, and I have copied them back to my I-Tunes library (albeit without any playlists). What I would like to be able to do is transfer the organized playlists from my ipod back to I-Tunes to avoid a massive reorganization project.
I should point out that hardly any of my music has come from buying songs on I-Tunes so the "Transfer Purchases" option does not seem a viable option.
Thanks so much to anyone who can offer suggestions.Aside from the method I already mentioned in this thread, there is Yamipod. This is a free program that transfers music from iPod back to the computer. However, it does not transfer playcounts/ratings etc.
Other free programs are Pod Player, SharePod and Floola. -
Sry about this amount of code lines.... but i realy need help...
I must insert into a table, the date, like 10/12/2009, and the time, like 22:34:12... but, when i select the date from a datepicker, and insert the time into a text field... i got this result:
if the date inserted was 12/12/2009 and the time 22:34:12
result is.......................12/12/0922 34:12:00 <<<<< it´s getting just the two lasts number of the year and inserting the two firsts number of the time into the year, like year 0922 ....
I´m using a javascript source to create a datepicker......
and that is the procedure to insert into the table.......
PROCEDURE set_atendimento(
p_id_chamado_atendimento IN chamado_atendimento.id_chamado_atendimento%TYPE,
p_id_chamado IN chamado_atendimento.id_chamado%TYPE,
p_informacao IN chamado_atendimento.informacao%TYPE,
p_datahora_inicio IN chamado_atendimento.datahora_inicio%TYPE,
p_datahora_fim IN chamado_atendimento.datahora_fim%TYPE,
p_hora_inicio IN VARCHAR2,
p_hora_fim IN VARCHAR2
IS
v_inicio DATE;
v_fim DATE;
BEGIN
v_inicio := TO_DATE(TO_CHAR(p_datahora_inicio || p_hora_inicio), 'DD/MM/YYYY HH24:MI:SS');
v_fim := TO_DATE(TO_CHAR(p_datahora_fim || p_hora_fim), 'DD/MM/YYYY HH24:MI:SS');
UPDATE
chamado_atendimento
SET
informacao = UPPER(p_informacao)
WHERE
id_chamado_atendimento = p_id_chamado_atendimento;
IF SQL%NOTFOUND THEN
INSERT INTO
chamado_atendimento
(id_chamado_atendimento, id_chamado, id_operador, datahora_inicio, datahora_fim, informacao)
VALUES
(SEQ_CHAMADO_ATENDIMENTO.nextval, p_id_chamado, pkg_operador.get_id_operador, v_inicio, v_fim, UPPER(p_informacao));
END IF;
END;
that is the JAVASCRIPT
<script language="JavaScript" type="text/JavaScript">
$(function(){
$.datepicker.setDefaults({
showOn: 'button',
buttonImage: '/i/themes/fwsac/includes/jquery/images/calendario.gif',
buttonImageOnly: true,
closeText: 'Fechar',
prevText: '<Anterior',
nextText: 'Próximo>',
currentText: 'Hoje',
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showAnim: 'slide'
$('#P5004_DATAHORA_INICIO , #P5004_DATAHORA_FIM').datepicker({ beforeShow: fdateRange });
function fdateRange(input){
return {
minDate: (input.id == "P5004_DATAHORA_FIM" ? $("#P5004_DATAHORA_INICIO").datepicker("getDate") : null),
maxDate: (input.id == "P5004_DATAHORA_INICIO" ? $("#P5004_DATAHORA_FIM").datepicker("getDate") : null)
</script>
what i must change to get the 4 numbers of the year and all numbers of the time and conca " || " with the date??
can someone help with this, pls??Hello brugo,
Try this:
v_inicio := to_nchar((to_date(p_datahora_inicio || p_hora_inicio , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');
v_inicio := to_nchar((to_date(p_datahora_fim || p_hora_fim , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');When I substitute strings: '10/12/2009' for p_datahora_inicio and '22:30:05' for p_hora_inicio, using this format string, I get: 10/12/2009 22:30:05 as a result.
Don.
You can reward this reply by marking it as either Helpful or Correct :) -
Need some help with downloading PDF's from the net.
need some help with downloading PDF's from the net. Each time I try to click on a link from a website, if it takes me to a new screen to view a pdf, it just comes up as a blank black screen? any suggestions?
Back up all data.
Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
/Library/Internet Plug-ins
In the Finder, select
Go ▹ Go to Folder
from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
If you still have the issue, repeat with this line:
~/Library/Internet Plug-ins
If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again. -
Help with tethered capture in lightroom 4
I want to do live tetherring from the camera into lightroom four. I need help with the procedure
RicheCamera? Is it supported? There is a tutorial here which may help http://www.youtube.com/watch?v=AYs8WbTbJCk
Maybe you are looking for
-
Can't open photos from later version....
Hi- I have a mini at home and a G4 at work. I burned a DVD with photos @ home and when I try to open them at work it says that they were created with a newer version of iPhoto. I understand this part but my question is....is the only way to get the n
-
How can I burn a movie to a DVD so that it will play in a DVD player?
I've tried burning the movie in Itunes and via the "Burn" option when right clicked. The file burns just fine and it shows up on my computer as a DVD. Yet when I insert the disc into my DVD player, it says there is not any data - audio or video wise.
-
WBS settlement rule - change receiver
In the settlement rule for WBS element, catelgory G/L, how do I change the default Settlement Receiver? User wants WBS elements settling to a different account. Thanks Althea
-
hi, i got a new requirement where i need to send 2 excel files as an attachment.. Up to know i have a idea of sending one file as an attachment... Please help me... How we will attach 2 excel files as an attachment and sent it to recipient. Nice answ
-
How to create and display items
Hi All, I tried to create an item within the EBS. Using the standard user mfg/welcome, I found the section "Item Manager - Create Engineering Items" and "Item Manager - Create Production Items". Or these objects the same kind of items with just diffe