Query about apporval procedure
Hello Expert
Does anyone has ever made a query for approval procedure where the customer is blocked if any payment is overdue
Thank you
hi G. DELANOE,
you can use query for approval procedure with overdue >= 15 days.
SELECT DISTINCT 'True' From OCRD T0 inner join oinv t1 on t0.cardcode=T1.cardcode
WHERE T0.CardCode =$[$4.0.0] and T1.DocStatus='O' AND datediff(day, T1.DocDueDate,GetDate())>= 15
thanks
H2
Similar Messages
-
Transform a Query into a procedure or a trigger
Hello All
How could i put this Query in a procedure or function to call it from form a form
*SELECT ADD_MONTHS (TO_DATE ('01/01/2001', 'dd/mm/yyyy'), (12 * 4) + 3)*
*FROM DUAL* Then the value should be added in multiple rows in a loop
CREATE OR REPLACE TRIGGER emp_alert_trig
BEFORE INSERT ON emp
FOR EACH ROW
BEGIN
DBMS_OUTPUT.PUT_LINE('New years employees experience periods 2 be added');
END; Regards,
Abdetu...I have to admit that it's a bit disconcerting that you don't seem to want to invest any time in solving your own problems while hoping that some volunteers will happily solve the problem for you.
That said, I'm afraid that I don't understand what you are looking for.
How could i put this Query in a procedure or function to call it from form a formWhat does "form" mean in this context? Oracle Forms? APEX? Something else? Forms is a bit of a special case because you may be talking about client-side PL/SQL.
SELECT ADD_MONTHS (TO_DATE ('01/01/2001', 'dd/mm/yyyy'), (12 * 4) + 3)
FROM DUAL So you want to create a function that returns a constant? Why bother with all the calculations? Maybe you're looking for
CREATE FUNCTION get_hard_coded_date
RETURN date
IS
BEGIN
RETURN ADD_MONTHS (TO_DATE ('01/01/2001', 'dd/mm/yyyy'), (12 * 4) + 3);
END;I'm somewhat hard pressed to understand how that might be useful to anyone, but that's the closest thing to what you're asking that I can come up with.
Then the value should be added in multiple rows in a loopOK. Now you've totally lost me
CREATE OR REPLACE TRIGGER emp_alert_trig
BEFORE INSERT ON emp
FOR EACH ROW
BEGIN
DBMS_OUTPUT.PUT_LINE('New years employees experience periods 2 be added');
END;And I have no idea what this trigger has to do with anything that came before. Particularly since the trigger isn't doing anything (I certainly hope that you're not expecting that dbms_output.put_line is going to cause text to appear in your application).
Justin -
Ora-04044 error on a Select . . . Into query in a procedure in an Form
Hi,
I am getting the following error upon the execution of any select . . . into query in my procedure.
Ora-04044 procedure, function, package or type is not allow here.
I am using an Oracle 10g database on Linux with a client/server configuration of Forms 6i.
Here is the code snippet that is erroring:
procedure validate_area is
begin
if :ib.area_id is not null then
declare
s_ds_type varchar2(1);
begin
select building, ds_id, ds_allow_issue, ds_emp_id, latitude, longitude, map_num, room, loc_descr, n_area_code, ds_type
into :ib.building, :ib.ds_id, :ib.allow_issue, :ib.rpt_emp_id, :ib.latitude, :ib.longitude, :ib.map_num, :ib.room, :ib.loc_descr, :n_area_code, s_ds_type
from area, dosi_subj
where area.area_id = :ib.area_id and area.ds_id = dosi_subj.id;
... more code ....
end;
end if;
end validate_area;
It is on this select . . . into statement that the above error was thrown.
Any ideas?Ernie,
Please check all the tables and columns involved in that query if there is a function, package or procedure with that same name.
I tried myself, but everything seems fine. I included an example of an ORA-04044 at the end, however.
SQL> create table area
2 as
3 select 1 area_id, 1 ds_id from dual
4 /
Tabel is aangemaakt.
SQL> create table dosi_subj
2 as
3 select 1 id, 1 building, 1 ds_allow_issue, 1 ds_emp_id, 1 latitude, 1 longitude, 1 map_num
4 , 1 room, 'z' loc_descr, 'A' n_area_code, 'A' ds_type
5 from dual
6 /
Tabel is aangemaakt.
SQL> select building, ds_id, ds_allow_issue, ds_emp_id, latitude, longitude, map_num, room, loc_descr, n_area_code, ds_type
2 from area, dosi_subj
3 where area.area_id = 1 and area.ds_id = dosi_subj.id
4 /
BUILDING DS_ID DS_ALLOW_ISSUE DS_EMP_ID LATITUDE LONGITUDE MAP_NUM ROOM L N D
1 1 1 1 1 1 1 1 z A A
1 rij is geselecteerd.
SQL> create procedure validate_area is
2 l_ib_building dosi_subj.building%type;
3 l_ib_ds_id area.ds_id%type;
4 l_ib_allow_issue dosi_subj.ds_allow_issue%type;
5 l_ib_rpt_emp_id dosi_subj.ds_emp_id%type;
6 l_ib_latitude dosi_subj.latitude%type;
7 l_ib_longitude dosi_subj.longitude%type;
8 l_ib_map_num dosi_subj.map_num%type;
9 l_ib_room dosi_subj.room%type;
10 l_ib_loc_descr dosi_subj.loc_descr%type;
11 l_n_area_code dosi_subj.n_area_code%type;
12 c_area_id number := 1;
13 begin
14 if 1 is not null then
15
16 declare
17
18 s_ds_type varchar2(1);
19
20 cursor c1 (c_area_id NUMBER) is
21 select building, ds_id, ds_allow_issue, ds_emp_id, latitude, longitude, map_num, room, loc_descr, n_area_code, ds_type
22 from area, dosi_subj
23 where area.area_id = c_area_id and area.ds_id = dosi_subj.id;
24
25 begin
26 dbms_output.put_line('open c1 cursor to retrieve data');
27 open c1(1); --code errors when opening the cursor
28
29 dbms_output.put_line('fetch area data variables');
30 fetch c1 into l_ib_building, l_ib_ds_id, l_ib_allow_issue, l_ib_rpt_emp_id, l_ib_latitude, l_ib_longitude, l_ib_map_num
31 , l_ib_room, l_ib_loc_descr, l_n_area_code, s_ds_type;
32 dbms_output.put_line('area data has been fetched');
33 end;
34 end if;
35
36 end validate_area;
37 /
Procedure is aangemaakt.
SQL> exec validate_area
open c1 cursor to retrieve data
fetch area data variables
area data has been fetched
PL/SQL-procedure is geslaagd.
SQL> drop table area
2 /
Tabel is verwijderd.
SQL> create procedure area is begin null; end;
2 /
Procedure is aangemaakt.
SQL> select building,ds_emp_id
2 from dosi_subj, area
3 /
from dosi_subj, area
FOUT in regel 2:
.ORA-04044: procedure, function, package, or type is not allowed hereRegards,
Rob. -
Hi,
i had a query about local storage.
I've a machine that hosts weblogic and tangosol. i've an ejb that accesses a distributed cache i.e NamedCache cache = CacheFactory.get("MyCache")
i modified tangosol-coherence.xml and set local-storage to false ( for distributed cache) and replaced the file in coherence.jar.
i'm using an overflow scheme and the back map uses a disk scheme.
i also start a separate standalone instance of tangosol and i set the system property of local storage to true for the standalone instance.
i start the standalone instance first and then weblogic.
The idea is ensure that the tangosol instance in weblogic or the weblogic JVM should not participate in storing data (hence local storage false).
only the JVM for the standalone instance should store data (hence local storage true -system property).
i wanted to know whether the property "local-storage" is pertinent to a member(machine) or to a JVM?
the reason for this doubt: as i'm using a disk scheme, tangosol creates a file for an overflow (e.g lh014402~.tp). i can see two such files when ideally i would have wanted only one for the tangosol instance.
-rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014402~.tp
-rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014403~.tp.
can you please let me know if we can configure tangosol in such a way that we can two separate instances running with local stroage false for one and true for the other?
Awaiting your reply
Thanks
VinayI would suggest leaving the default 'local-storage' value set to 'true' in the tangosol-coherence.xml and just use the JVM argument to control the local storage of each individual node. Then start the stand alone instance normally (I assume you are using the com.tangosol.net.DefaultCacheServer) and start the WebLogic instance with the following:
java [...] -Dtangosol.coherence.distributed.localstorage=false [...]
Hope this helps.
Later,
Rob Misek
Tangosol, Inc. -
I have a stored procedure that dynamically creates a pivot query. The procedure works and returns the correct data. Now I have a requirement to show this data in reporting system that can only pull from a table or view. Since you can not
create a dynamic query in a view I tried to do a select from using openquery.
Example 'Select * from OpenQuery([MyServername], 'Exec Instance.Schema.StoredProcedure')
I get the error back "the linked server indicates the object has no columns". I assume this is because of the first select statement that is stuffing the variable with column names.
CODE FROM PROCEDURE
Alter PROCEDURE [dbo].[Procedure1]
AS
BEGIN
SET NOCOUNT ON
Declare @cols nvarchar(2000),
@Tcols nvarchar(2000),
@Sql nvarchar (max)
select @cols = stuff ((
Select distinct '], ['+ModelName + ' ' + CombustorName
from CombustorFuel cf
join Model m on cf.modelid = m.modelid
join Combustors cb on cf.CombustorID = cb.CombustorID
where cf.CombustorID > 0
for XML Path('')
),1,2,'')+']'
Set @Tcols = replace(@Cols, ']', '] int')
--Print @Tcols
--Print @Cols
Set @Sql = 'Select GasLiquid, FuelType, '+ @Cols +'
from
Select GasLiquid, FuelType, ModelName+ '' '' +CombustorName ModelCombustor, CombFuelStatus+''- ''+CombFuelNote CombFuelStatusNote
from Frames f
join Family fa on f.Frameid = fa.frameid
join Model m on fa.FamilyID = m.FamilyID
join CombustorFuel cf on m.Modelid = cf.modelid
Join Combustors c on cf.CombustorId = c.CombustorID
join FuelTypes ft on cf.FuelTypeID = ft.FuelTypeID
where cf.CombustorFuelID > 0
and CombustorName <> ''''
) up
Pivot
(max(CombFuelStatusNote) for ModelCombustor in ('+ @Cols +')) as pvt
order by FuelType'
exec (@Sql)Then again, a good reporting tool should be able to do dynamic pivot on its own, because dynamic pivoting is a presentation feature.
SSRS Supports dynamic columns: Displaying Dynamic Columns in SSRS Report
SQL Reporting Services with Dynamic Column Reports
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014
Displaying and reading are two very different things.
#1) SSRS Needs a fixed field list on the input side to know what what to make available in the designer.
#2) SSRS cant read "exec (@Sql)" out of a proc, even if there is a fixed number of columns (at
least it can't use it to auto build the field list from the proc)
I use dynamic SQL in my report procs on a fairly regular basis and I've found it easiest to simply dump
the results of my dynamic sql into a temp table at the end of the procs and then select from the temp table.
Basically, Erland is correct. Stop trying to pivot in the query and let SSRS (or whatever reporting software you're using) handle it with a Martix.
Jason Long -
Big Troubles on designing Query about special customers' counting
Hello buddies:
I meet a problem on designing Query about special customers' counting. Let me describe the requirment first. I want to create a query with BEX , and there is a key figure with very special logic.
That is: to list the counts of the customers which has more than one sales records in a time period from sales data.
For example :
when the user excute the query , he or she must input a time period ( 2007.01~2007.03 e.g)
then the query output as follow:
District Cust-sount
North-Zone 100
South-Zone 120
The Main trouble are :
1. Threr are no document number in the detail of sales data document records. so I could not count the sales times with document number.
2. The time period is not fixed value, it depends on the user's input, so I can not define the counting logic in the update rule or in the query with fixed time period.
Anybody who met similar requirement pls show me your hand and give your solutions, thanks very much.
JasonHi,
Your solution sounds a good way to count the distinct customers. but in my case, one salse line item must not be recognize as one sales record, instead, one customer's all sales line items occurs in one day must be recognize as one sales record ( or we say that one sales behavior).
for example:
customer product quantity date
cust001 prod001 10 2007.06.06
cust001 prod002 20 2007.06.06
the two line items above means one sales record for the customer "cust001".
so I could not simply use the CKF : (( Counter ) *FV2 ) > 1 .
Best Regards,
Jason -
Query about licensing Jdeveloper
Dear Friends,
I have a query about licensing of Jdeveloper development tool. I understand that Jdeveloper is Free tool.That is we do not require license to use Jdeveloper for development as well as production.
Recent I heard that Jdeveloper is free only if we purchase Oracle Application Server. Is it correct ? Does one need to purchase Jdeveloper license if it is being deployed on any other App. server eg. Jboss etc ?
Can anyone throw light on the same ?
Many thanks,
VaijHi,
JDeveloper is free! Oracle ADF - the binding layer - ADF BC, and ADF Faces need an OracleAs licence
Frank -
since updating itunes yesterday I now can't open it and get a pop up box about the procedure entry point not being located. anyone able to help?
these are the boxes that open up:
I am unsure as to wether I need to unistall and start again but then worry about the vast amount of songs already in the folder that I would have to reload.anyone able to help me with the above?
-
New issue in R 12.1.3 in AP while query about inovice was recorded in AP
i record new invoice in ap on release R 12.1.3 and when query about it on invoice form the error appeare was it
forms
FRM-40735:POST-QUERY trigger raised unhandled exception ORA-04063
how can someone help usHi,
Please see these docs.
R12:Getting FRM-40735 Post-Query Trigger On Quering Invoice [ID 1209736.1]
After Applying Patch APXINWKB.fmb Is Not Working [ID 1159124.1]
R12.1.1 APXINWKB Invoice Workbench Form Comes Up With 'ORA-01403' [ID 949942.1]
12.1.1: FRM-40735: Post-Query Trigger Raised Unhandled Exception ORA-04063 [ID 1077613.1]
Query on Invoices, Getting "FRM-40735: POST-QUERY trigger raised unhandled exception ORA-4063" [ID 1076609.1]
Thanks,
Hussein -
I have one query about table entries.
i have one query about table entries.
suppose for particular table we maintained 5 entries in dev server. actaully in the dev we have only these 5 entries.
In production we have 200 entries actually.
If we move the cts from dev to production ,we will get 205 entries right
please help me in this.If i understood correctly, It is a Z table and you have done some changes in DEV system. If you move this to Production, it wont effect the production entries.
There are 2 different ways you can trnasport a Table. 1. with Table entries 2. Without table entries.
If you transport with Table entries then the DEV entries in this case 5 will be moved to PRODUCTION totaling 205.
If you transport without table entries, then in Production you will find only 200 entries. -
Hi Support,
I have a query about the DR -Standby:
1) Is FAL_CLIENT and FAL_SERVER parameter mandatory in both Primary and standy node?
2) How many standy by we can create for primary node?
ThanksDear Prashanth,
Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
Since quantity of 3 is rejected and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
Hope this will help you better.
Best Regards,
Shekhar -
Query about the "User Decision
Hi,
I have a query about the u201CUser Decisionu201D, Suppose I have received the 10 quantity and lot get created for 10. At time of UD (QA11) I put 7 quantities in unrestricted and 3 in blocked stock .what we generally use to do with that block stock? Whether we again transfer it to quality stock (Movement 349)? Or move directly to unrestricted (movement: 343).
I tried to move the blocked stock in u201Cquality stocku201D in transaction MB1B with movement 349 but it had given error u201CChange the inspection stock of material 9112223334A in QM onlyu201D. In QM how to transfer the blocked stock in quality stock?
Regards,
PKDear Prashanth,
Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
Since quantity of 3 is rejected and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
Hope this will help you better.
Best Regards,
Shekhar -
Query about multiple connection pools under one database
Hi,
I have s query about connection pool, now we have a requirement,
we have two schemas in one db, some data store in one schema, some in another schema,
all tables are the same, but data is different, we want to retrive all data under two schemas,
so we need two connection pools under one database,
I have set two system DSN, and each connection pool was mapping to one DSN,
but after I importing tables into RPD, when I view data, there is a dialog let me select connection pool. so If this, when we drag columns in answer, it will definitely get wrong.
so how to realize this function about multiple connection pools under one database and we can get data normally.Hi,
Try this step
1)Better to create two different DSN for the same database with different user id and password
2)now create multiple connection pool in the same database in u r RPD physical layer .
also refer this link : for imporving performance
http://obiee101.blogspot.com/2009/01/obiee-multiple-connection-pools.html
http://gerardnico.com/wiki/dat/obiee/connection_pool
Thanks
Deva -
i want a query about account hierarchy
like if i have asset 1000
fixed asset 1100
land 1110
i want the result from query:
asset 1000
fixed asset 1100 1000
land 1110 1100
the last column is parentTry this
SELECT ffv.flex_value, maptl.parval
FROM apps.fnd_flex_values ffv,
(SELECT ffvc.flex_value chval, ffvh.parent_flex_value parval
FROM apps.fnd_flex_values ffvr1,
apps.fnd_flex_values ffvr2,
apps.fnd_flex_values ffvc,
apps.fnd_flex_value_hier_all ffvh
WHERE ffvh.child_flex_value_low = ffvr1.flex_value
AND ffvh.child_flex_value_high = ffvr2.flex_value
AND ffvc.flex_value_id BETWEEN ffvr1.flex_value_id
AND ffvr2.flex_value_id
AND ffvr1.flex_value_set_id = :val_set_id
AND ffvr2.flex_value_set_id = :val_set_id
AND ffvc.flex_value_set_id = :val_set_id
AND ffvh.flex_value_set_id = :val_set_id) maptl
WHERE ffv.flex_value = maptl.chval(+)
AND ffv.flex_value_set_id = :val_set_id
ORDER BY ffv.flex_valueThis takes value set id as an input parameter.
HTH -
Another query about XAResource
Hi All,
I have another query about the start/end behavior of the XAResource and its effect on a JMS transaction when the JMS server acts as a resource manager.
Suppose I start an XAResource supplied by a JMS server using an XID and pop some messages from a Queue in this transaction. Now before I end this transaction my client application dies or is disconnected from the server.
First off this transaction has not been committed or rollbacked so the transaction or the XID would still be registered on the server.
In this case what should be the steps for joining this transaction and doing the needful (say commit or rollback).
What flag should be used to re-start this resource?
Is there any specs defined for the above or as many other things in XA for JMS servers are, is this also vendor specific?
Thanks in advance for your answers.
cheers
AdolfHi Adolf,
XAResource is used to provide a two phase commit.
1 prepare
2 commit
now say a client fails before prepare, then the server detects that the client has gone down and so closes the connection which causes the whole transaction to roll back. Next time the clients has to begin it afresh.
if the transaction has been prepared, the prepared transaction can be actually commited by the TM. this stage is for all the components of the dustributed system to say that they are ready for commiting.
Maybe you are looking for
-
InfoPath form won't open in browser
I've been searching for hours for a solution but I can't get it right.. I've a form library with InfoPath 2010 forms. The forms are browser enabled. Library settings -> display form as webpage. But when users click on the form, Internet Explorer asks
-
How to get the Actual Query of View Object
Hi all, I have a standard. I need to modify the query of the VO attached to a picklist based on responsibility. I am able to achieve my requirement but it is getting reflected for all the responsibilities even though i extended the controller for a p
-
Verifying Server Connection in Configuration Manager
I am trying to deploy ES3 on Weblogic 10.3.6 and am having a problem with Configuration Manager. When I Verify Server Connection, the CM spins for a bit then comes back with a ALC-LCM-100-011 error, Cannot Connect to Application Server. In the CM log
-
DRAM Clock Settings and SDram Cas latency
: 8o Just got my KT3 ULTRA 2 Socket A Motherboard. When I turn on the computer, in the POST test it says: DRAM Clock = 266MHz SDRAM Cas Latency = 2 I checked the cmos and the latency is set at 2 , but what about the DRAM Clock? Please help for I am
-
Internet connection very slow - ISP blames my computer...
Greetings, I have DSL connection that has been running very very slow... dialup slow... I use airport, so I unplugged it and connected the ethernet cable directly to the comp - with no results. I called my ISP, they tested the modem speed, reset the