DBTABLOG table changes functionality
Hi guys,
when I change my Z* table via SM30, DBTABLOG contains information that Z* table was changed.
But when someone runs a program where command "Update Z* table..." is used, DBTABLOG has no record about it.
Is there any reason for it? How can I trace changes done with ABAP code insert/update...?
Thanks a lot.
Hi,
thanks for answer. But I don't understand it because I have no change pointers for my table.
The only setting I have is "Log data changes" in SE11 and rec/client parameter is set up in system.
Generally DBTABLOG is working correctly. Only ABAP commands are not traced.
Please could you explain in detail your idea?
Thanks a lot.
Regards,
Petr
Similar Messages
-
Table for Function modules - Changed date & Changed by.
Hi Experts,
Help me to get Function module changed date & changed by.
For programs we can get the mentained information in TABLE : TADIR.Function Modules change history can be retrieved from table TRDIR.
Function Module stores a program Include in table TRDIR.
The details of the Function Module can be found in Attributes-->general data tab in the Function Module.
You need to pass the Include which correponds the FM.
Hence you can find the Log changes.
Hope this helps.
Regards
Vinayak -
How to change function group in table maintenance
Hello experts,
I am having a problem transporting a custom table. Now, what I want to do is to just create a new function group under the table maintenance option in se11. Now, I can't seem to change my custom table's function group. How do I do that? thanks a lot and have a nice day guys!Hai
You have to re-generate the table maintenance, when new fields are added, system doesn't automatically insert them in it.
So go to MAINTENANCE TABLE GENERATOR for your table and press icon for updating.
Here choose NEW FIELD options and press ENTER.
Anyway I prefer to set somes parameters of EXPERT MODE as REFRESH OVERVIEW SCREEN
goto ur table> utilities> table maintenance generator> change>press enter> reason give additional fields>expert mode--> enter...
Thanks & Regards
Sreenu -
Problem with dg4msql and table-valued functions
Have configured dg4msql to connect from my oracle db to ms sql server.
Am able to do simple SELECTs from ms sql tables like:
select * from "sys"."procedures"@dg4msql;
or
select * from "dbo"."SomeTable"@dg4msql;
But am unable to do a SELECT from a table-valued function:
select * from "dbo"."GetData"@dg4msql('param1value');
or
select * from "dbo"."GetData"('param1value')@dg4msql;
In both cases I get:
ORA-00933: SQL command not properly ended
It does not like the parameters portion of the query ("('param1value')")
initdg4msql.ora:
HS_FDS_CONNECT_INFO=[svr1]//mydb
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_PROC_IS_FUNCT=TRUE
HS_FDS_RESULTSET_SUPPORT=TRUE
Have tried the other set of params:
HS_FDS_PROC_IS_FUNCT=FALSE
HS_FDS_RESULTSET_SUPPORT=TRUE
Same story. After changing the init*** file have bounced both Listeners (DB and Gateway), reconnected, and re-run the query.
Have I missed something?
Any help is greatly appreciated!Sorry, but for me it looks you did not get the problem.
Oracle® Database Gateway for SQL Server User's Guide,:
11g Release 2 (11.2)
Part Number E12069-02
*2 SQL Server Gateway Features and Restriction*
Result Sets and Stored Procedures
The Oracle Database Gateway for SQL Server provides support for stored procedures which return result sets.
By default, all stored procedures and functions do not return a result set to the user. To enable result sets, set the HS_FDS_RESULTSET_SUPPORT parameter value to TRUE.
PL/SQL Program Fetching from Result Sets in Sequential Mode
-- Execute procedure
out_arg := null;
refcurproc@MSQL('Hello World', out_arg, rc1);
Somewhere in this forum I've seen a message that the syntax "SELECT ... FROM sp@db(param1, param2)" works.
Anyway, even with the PL/SQL block the error message is the same - ORA-00933 "SQL command not properly ended"
and the cursor (* in SQL*PLUS) is put just at the first bracket.
Edited by: user636213 on Aug 10, 2012 5:17 AM -
SQL: Issue with running out of storage on server when running table-valued function
SQL Version: 2008 (not r2)
Problem: I'm getting the following error message when running a table-valued function:
Msg 1105, Level 17, State 2, Line 1
Could not allocate space for object 'dbo.SORT temporary run storage: 141072001204224' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files
to the filegroup, or setting autogrowth on for existing files in the filegroup.
Request: Could anyone tell me if there are modifications that I could make to my SQL code to avoid this storage issues?
Thanks,
....bob sutor
Code Facts:
The JCCD table is a large table 2MM records
The other tables in the JOINS are very small 15 records or less
SQL Function Code:
ALTER FUNCTION [dbo].[xcft_XAWP_GLBalance_JCCD_Detail]()
RETURNS @JCGLDetail TABLE
JCCo tinyint
, Job varchar(10)
, PostingSource varchar(10)
, CostToDate numeric(12,2)
, Phase varchar(20)
, EarnType smallint
, LiabilityType smallint
, CostType tinyint
, ControllingSetting varchar(30)
, GLAccountCharged varchar(20)
, DeptNum varchar(10)
, DeptDesc varchar(30)
, JCDC_CostType tinyint
, CostTypeGL_Open varchar(20)
, CostTypeGL_Closed varchar(20)
, JCDO_ExcludePR varchar(1)
, JCDO_Phase varchar(20)
, PhaseGL_Open varchar(20)
, PhaseGL_Closed varchar(20)
, JCDL_LiabType smallint
, LiabTypeGL_Open varchar(20)
, LiabTypeGL_Closed varchar(20)
, JCDE_EarnType smallint
, EarnTypeGL_Open varchar(20)
, EarnTypeGL_Closed varchar(20)
AS
BEGIN
DECLARE
@WIPMonthCurrent date
SET @WIPMonthCurrent = (Select TOP 1 WIPMonth FROM udxcWIPMonths WHERE ActiveWIPPeriod = 'Y')
INSERT INTO @JCGLDetail
JCCo
, Job
, PostingSource
, CostToDate
, Phase
, EarnType
, LiabilityType
, CostType
, DeptNum
, DeptDesc
, JCDC_CostType
, CostTypeGL_Open
, CostTypeGL_Closed
, JCDO_ExcludePR
, JCDO_Phase
, PhaseGL_Open
, PhaseGL_Closed
, JCDL_LiabType
, LiabTypeGL_Open
, LiabTypeGL_Closed
, JCDE_EarnType
, EarnTypeGL_Open
, EarnTypeGL_Closed
SELECT
JCCD.JCCo, JCCD.Job, JCCD.Source, sum(JCCD.ActualCost) AS CostToDate, JCCD.Phase, JCCD.EarnType, JCCD.LiabilityType, JCCD.CostType
, JCDM.Department, JCDM.Description
, JCDC.CostType AS JCDC_CostType, JCDC.OpenWIPAcct AS CostTypeGL_Open, JCDC.ClosedExpAcct AS CostTypeGL_Closed
, JCDO.ExcludePR AS JCDO_ExcludePR, JCDO.Phase AS JCDO_Phase, JCDO.OpenWIPAcct AS PhaseGL_Open, JCDO.ClosedExpAcct AS PhaseGL_Closed
, JCDL.LiabType AS JCDL_LiabType, JCDL.OpenBurdenAcct AS LiabTypeGL_Open, JCDL.ClosedBurdenAcct AS LiabTypeGL_Closed
, JCDE.EarnType AS JCDE_EarnType, JCDE.OpenLaborAcct AS EarnTypeGL_Open, JCDE.ClosedLaborAcct AS EarnTypeGL_Closed
FROM JCCD
LEFT JOIN JCJP ON JCCD.JCCo = JCJP.JCCo AND JCCD.Job = JCJP.Job
LEFT JOIN JCCM ON JCJP.JCCo = JCCM.JCCo AND JCJP.Contract = JCCM.Contract
LEFT JOIN JCDM ON JCCM.JCCo = JCDM.JCCo AND JCCM.Department = JCDM.Department
LEFT JOIN JCDC ON JCDM.JCCo = JCDC.JCCo AND JCDM.Department = JCDC.Department AND JCCD.CostType = JCDC.CostType
LEFT JOIN JCDE ON JCDM.JCCo = JCDE.JCCo AND JCDM.Department = JCDE.Department AND JCCD.EarnType = JCDE.EarnType
LEFT JOIN JCDO ON JCDM.JCCo = JCDO.JCCo AND JCDM.Department = JCDO.Department AND JCCD.Phase = JCDO.Phase
LEFT JOIN JCDL ON JCDM.JCCo = JCDL.JCCo AND JCDM.Department = JCDL.Department AND JCCD.LiabilityType = JCDL.LiabType
LEFT JOIN xcft_XAWP_FiscalPeriodCutoffs_ForWIPMonth() AS cutoffs ON JCCD.JCCo = cutoffs.GLCo
WHERE
JCCD.Mth <= cutoffs.FiscalYear_LastMonth
AND JCCD.Job IN(SELECT JobNum FROM budxcWIPData_SQL WHERE WIPMonth = @WIPMonthCurrent)
AND JCCD.JCCo IN(SELECT JCCo FROM JCCO WHERE udExcludeFromWIP <> 'Y' or udExcludeFromWIP IS NULL)
--AND LTRIM(RTRIM(JCCD.Job)) = '71-'
GROUP BY
JCCD.JCCo, JCCD.Job, JCCD.Source, JCCD.Phase, JCCD.EarnType, JCCD.LiabilityType, JCCD.CostType
, JCDM.Department, JCDM.Description
, JCDC.CostType, JCDC.OpenWIPAcct, JCDC.ClosedExpAcct
, JCDO.ExcludePR, JCDO.Phase, JCDO.OpenWIPAcct, JCDO.ClosedExpAcct
, JCDL.LiabType, JCDL.OpenBurdenAcct, JCDL.ClosedBurdenAcct
, JCDE.EarnType, JCDE.OpenLaborAcct, JCDE.ClosedLaborAcct
UPDATE @JCGLDetail
SET
ControllingSetting =
CASE WHEN Phase = JCDO_Phase AND JCDO_ExcludePR = 'N' THEN 'PhaseOverride-PR Excluded'
WHEN Phase = JCDO_Phase AND JCDO_ExcludePR = 'Y'
AND EarnType NOT IN(Select EarnType FROM JCDE WHERE JCDE.JCCo = JCCo AND JCDE.Department = DeptNum)
AND LiabilityType NOT IN(Select LiabType FROM JCDL WHERE JCDL.JCCo = JCCo AND JCDL.Department = DeptNum)
THEN 'PhaseOverride-PR Not Excluded'
WHEN EarnType = JCDE_EarnType THEN 'Earn Type Override'
WHEN LiabilityType = JCDL_LiabType THEN 'Liability Type Override'
ELSE 'Cost Type' END
UPDATE @JCGLDetail
SET
GLAccountCharged =
CASE WHEN ControllingSetting = 'PhaseOverride-PR Excluded' OR ControllingSetting = 'PhaseOverride-PR Not Excluded'
THEN PhaseGL_Open
WHEN ControllingSetting = 'Earn Type Override' THEN EarnTypeGL_Open
WHEN ControllingSetting = 'Liability Type Override' THEN LiabTypeGL_Open
ELSE CostTypeGL_Open END
RETURN
END
Bob Sutorwell, did you either restart the instance or add another tempdb file (no restart required) to let other transactions continue on the server.
or check if autogrowth was limited, change that to unlimnited , to the transactions conintue..
the function may be dumping the data on to tempdb, how much data are you excepting back...what are indexes on the tables
Hope it Helps!! -
Table changes to TBSL...
How do I find table changes ? I want to find the table changes done to table TBSL.
Regards,
Rajesh.Check the table DBTABLOG:
Pass the name of your table TBSL to the field: TABNAME to get the log of changes done to your table.
Regards,
Ravi -
I have a table that has a TIMESTAMP column that stores the last time the record was changed. I have to create a dbms_scheduler job (repeats at on 15 min interval) that will give me a list of all the table changes that happened during the timeframe. So I created a job that calls a stored procedure and executes every 15 minutes:
table:
emp
last_name varchar2,
last_change_date timestamp
job:
dbms_scheduler.create_job
(job_name => 'CHECK_TABLE_DATA_JOB',
job_type => 'PLSQL_BLOCK',
job_action =>
'begin
CHECK_TABLE_DATA;
end;',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=15'
enabled=>true,
auto_drop=>false);
I'm a little unsure of the best way to query the changes in my procedure. I need to make sure that I catch all changes only 1 time, so I need to be precise on querying the 'last_change_date' timestamp column with time when job runs. Any ideas?>
Thanks. Sorry, should have used ename (see below). I will read up on the MV log INCLUDING NEW VALUES.
I understand your reason why the record would get skipped based on 'versions_startime' or 'versions_endtime', but isn't the
'FROM emp versions BETWEEN TIMESTAMP SYSTIMESTAMP - INTERVAL '15' MINUTE AND SYSTIMESTAMP' statement using the internal (committted) timestamp to bring back the records?
SELECT ename, versions_starttime,versions_operation
FROM emp versions BETWEEN TIMESTAMP SYSTIMESTAMP - INTERVAL '15' MINUTE AND SYSTIMESTAMP
ORDER BY ename, versions_endtime asc;
>
Well now you risk confusing the heck out of anyone reading this thread since you have abandoned the original question and have moved on to a new one.,
The original question was how to use YOUR column in YOUR table to query data changes that occur to your table. That has been answered as far as I can tell.
Now you are asking about FLASHBACK QUERY options and that is a new question. Many people that might be able to help you may not read the thread because your thread title is about something else altogether.
I suggest that you open a new thread with a subject including FLASHBACK QUERY. Post a link to this thread so people have the context.
Yes - you can use FLASHBACK QUERY functionality to identify changes to your table.
See the Advanced App Dev Guide for details
http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_flashback.htm#i1019938
The 'Using Oracle Flashback Version Query' section discusses the topic you mentioned.
>
Use Oracle Flashback Version Query to retrieve the different versions of specific rows that existed during a given time interval. A row version is created whenever a COMMIT statement is executed.
Specify Oracle Flashback Version Query using the VERSIONS BETWEEN clause of the SELECT statement. The syntax is:
VERSIONS {BETWEEN {SCN | TIMESTAMP} start AND end}
where start and end are expressions representing the start and end, respectively, of the time interval to be queried. The time interval includes (start and end).
Oracle Flashback Version Query returns a table with a row for each version of the row that existed at any time during the specified time interval. Each row in the table includes pseudocolumns of metadata about the row version, described in Table 12-1. This information can reveal when and how a particular change (perhaps erroneous) occurred to your database.
>
There are several examples in that section. -
BCALV_EDIT_03 - Need the table update function
I am fairly new to OO programming and have worked through the various sample programs. I am currently using BCALV_EDIT_03 and _04 to write a table maintenance program.
I kind of have figured out how the delete and insert function works but unfortunately in sample program _03 the final table update function is missing.
What I am after is that I get all the changed records from the grid and update the external table just with those records.
Could somebody post some sample update code that I could check out?
Thanks in advance.
GerdTable update as in, database table update or ALV table update ?
ALV Table update will be done automatically, in case you have used the method : set_table_for_first_display
As you also quote that you are checking out BCALV_<b>EDIT</b>_03, I will just clarify this point, all changes made to the table are triggered by the EVENT DATA_CHANGED and this event has the necessary fields, from which you can come to know which rows and what values have changed. You need to use this DATA_CHANGED event and update your internal table. This is then shown in SET_TABLE_FOR_FIRST_DISPLAY in PBO.
In case you are talking about database update and if it is a custom table, then you have to use the direct update.
In case it is a SAP table, you might let us know which table it is, and probably some of the experts here can let you know the Function Module, BAPI or any method of a class to use.
In case you need a good tutorial help, you can find it in Serdar Simsekler's
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
Let me know if I am way tangent here or I could be of help to you.
Regards,
Subramanian V. -
Creating \ Changing Functional Location With Contact Person.
Hello.
I'm looking for BAPI / Function for creating/changing "Functional Location" with Adding, deleteing OR changing "Contact Person"
I Have found the BAPI's : BAPI_FUNCLOC_CHANGE
BAPI_FUNCLOC_CREATE
but thier is no option to handle with "contact person" .
(SAP Table "IHPA").
Best Regards'
Haim B.Hello,
Instead of searching for any FM or anything. Go and create a flow thorugh LSMW and change the desired contact person through it..
I assure you this is the best and most efficient way.
first run LSMW and create a flow by changing the contact person of any one functional location and then assign the flow of that lSWM through external notepad file.
Get in the notepad all the desired FL you want to change run that within minutes your job will be done. -
Derive found flag in SQL with where clause using TABLE(CAST function
Dear All,
Stored procedure listEmployees
==========================
CREATE OR REPLACE TYPE STRING_ARRAY AS VARRAY(8000) OF VARCHAR2(15);
empIdList STRING_ARRAY
countriesList STRING_ARRAY
SELECT EMP_ID, EMP_COUNTRY, EMP_NAME, FOUND_FLAG_
FROM EMPLOYEE WHERE
EMP_ID IN
(SELECT * FROM TABLE(CAST(empIdList AS STRING_ARRAY))
AND EMP_COUNTRY IN
(SELECT * FROM TABLE(CAST(countriesList AS STRING_ARRAY))
=================
I have a stored procedure which lists the employees using above simple query.
Here I am using table CAST function to find the list of employees in one go
instead of looping through each and every employee
Everything fine until requirements forced me to get the FOUND_FLAG as well.
Now I wanted derive the FOUND_FLAG by using rownum, rowid, decode functions
but I was not successful
Can you please suggest if there is any intelligent way to say weather the
row is found for given parameters in the where clause?
If not I may have to loop through each set of empIdList, countriesList
and find the values individually just to set a flag. In this approach I can’t use
the TABLE CAST function which is efficient I suppose.
Note that query STRING_ARRAY is an VARRAY. It is very big in size and this procedure
suppose to handle large sets of data.
Thanks In advance
Regards
Charan
Edited by: kmcharan on 03-Dec-2009 09:55
Edited by: kmcharan on 03-Dec-2009 09:55If your query returns results, you have found them... so your "FOUND" flag might be a constant,...
-
Right way to fire table changes
suppose i have a class that extends AbstractTableModel and i used a List to store data, like
public class MyTableModel extends AbstractTableModel
List dataList = Collections.synchronizedList(new LinkedList());
public void insertMyData(String data)
synchronized(dataList)
// ... do something
##Line A##
##Line B##
If i want to fire table changes, say like using
this.fireTableDataChanged();
where should i place it?
at ##Line A## or ##Line B## ???
or should I use
SwingUtilities.invokeLater(new Runnable(){public void run(){
this.fireTableDataChanged();
Moreover, i would like to ask, if I implement my own TableCellRender and overriding the getTableCellRendererComponent method, all the calls like setText, setBackground, setForeground,...
should i use SwingUtilities.invokeLater to do that? or just call it as usual ?
Thanks alotSince you mention synchronized several times, I assume your model will be accessed from different threads
(although you didn't write this.) Client code will have to be careful: getRowCount may return 10, but by the
time the client gets to row 7 it may no longer exist! What does your model do when getValueAt is based
indices that are out of bounds?
As far as synchronization goes, I think you are going overboard with:
List dataList = Collections.synchronizedList(new LinkedList());...since you are using synchronization blocks elsewhere. In general, I find little use for those synchronizedXXX
factory methods -- usually the class having a collection member provides the thread safety.
As far as the listeners go, model listeners assume their event handlers are executing in the EDT, so
you will have to call the fire*** methods from the EDT. This means you have to use invokeLater or invokeAndWait.
Using invokeAndWait defeats the multithreading you are building, so I think you
should call invokeLater, and since this is an asynchronous-style call it makes no sense doing it
from within a synchronized block. Just be aware that your JTable class may quety the model
out of bounds.
Also, if your model's data is written or changed seldom but read often, I would use the serial immutable
pattern. Have the List reference dataList point to list whose state is immutable. If you want to change
the data, you make a copy, change that and then have dataList refer to the updated copy. -
Data in the table changes when multiple users try to submit data
I have a dynamic table. The table is created in the wdDoModifyView. The user can load data into the table from an excel file. So I have a "Load" button that loads the data from the selected excel file to the table. I also have a "Submit" button. This "Submit" button converts the data to an xml file and make a call to an oracle stored procedure for validation check. If there's an error it will be returned and displayed to the user. If none, a summary of data for posting will be displayed to the user. If the data is correct and the user hit the ok button, the same data will be return to oracle sp for loading in the table.
The problem we encountered is when multiple users are loading and submitting at the same time, the data displayed in the dynamic tables changes after clicking the ok button. It is as if, the table displays the data being loaded by other user.
This is an error that is difficult to recreate. This doesn't happen all the time. I hope you somebody could enlighten me why this is happening. I'm not sure if it has something to do with multithreading or session.
Edited by: Marlyn Agco on Apr 14, 2009 3:57 PMHi Armin,
Did you mean storing view instances in static references and accessing them outside the wdDoModifyView is not a good idea? In wdDoInit the nodes are dynamically created according to the xml file being returned by the database. This node is stored in a static variable which is also used in wdDoModifyView to create the dynamic table.
What do you suggest? We're still encountering same issue when multiple users are uploading data. -
Table or Function module to get Internal order planning and Cost element pl
Dear All,
Table or Function module to get Internal order planning and Cost element planning.
Internal order planning from T-code KO13.
Thanks in advance.
Regards,
Ravi
Edited by: Ravi Chandra on Sep 13, 2011 8:08 AMBPEJ, BPEG, BPEP
-
Initial Balances for some of the G/L Accounts in GLPCT table changed
Sub : G/L Account Balance( T code FAGLB03 ) and EC-PCA: Totals Table (Table GLPCT) initial balances are not same for some of the G/L accounts ( Initial Balances for some of the G/L Accounts and profit centers in GLPCT table changed )
Dear Friends
We are in SAP ECC 5.0. We are using New G/L Accounting
G/L Account Balance(Initial Balance)( T code FAGLB03 ) and EC-PCA: Totals Table (Table GLPCT) initial balances are not same for some of the G/L accounts ( Initial Balances for some of the G/L Accounts and Profit centers in GLPCT table changed )
G/L Account : 1110001 AR Trade - Recon
G/L Account Initial Balance( T code FAGLB03 ) 36,789,209.26 USD
EC-PCA: Totals initial balance (GLPCT table) 14,178,848.14 USD
I found in GLPCT table initial balances for G/L 1110001 and some of the profit centers are changed. The initial balances are not supposed to change for the entire financial year
I have checked none of documents for this G/L and these Profit centers of last financial year have been posted or reversed in current financial year.
Please try to help me what has caused to changed the initial balances and how to correct it
Please let me know if you guys need more details
Thanks in advance
Thanks
MVSHi Vinay,
If I understood correctly you are trying to balance Accumulated Depreciation accounts (from the AA module) with the Cost Depreciation Accounts.
If they don`t balance zero, it mostly likely means, that some user has posted manually deprecian in your GL, not using the depreciation program.
Hope this helps.
KR
Severina Koleva -
I am using TABLE(CAST()) operation in PL/SQL and it is returning me no data.
Here is what I have done:
1. Created Record type
CREATE OR REPLACE TYPE target_rec AS OBJECT
target__id NUMBER(10),
target_entity_id NUMBER(10),
dd CHAR(3),
fd CHAR(3),
code NUMBER(10),
target_pct NUMBER,
template_nm VARCHAR2(50),
p_symbol VARCHAR2(10),
pm_init VARCHAR2(3),
target_name VARCHAR2(20),
targe_type VARCHAR2(30),
target_caption VARCHAR2(30),
sort_order NUMBER (4)
2. Created Table type
CREATE OR REPLACE TYPE target_arr AS TABLE OF target_rec
3. Created Stored procedure which accepts parameter of type target_arr and runs the Table(Cast()) function on it.
Following is the simplified form of my procedure.
PROCEDURE get_target_weights
p_in_template_target IN target_arr,
p_out_count OUT NUMBER,
IS
BEGIN
SELECT count(*) into p_out_count
FROM TABLE(CAST(p_in_template_target AS target_arr)) arr;
END;
I am calling get_target_weights from my java code and passing p_in_template_target with 10140 records.
Scenario 1: If target_pct in the last record is 0, p_out_count returned from the procedure is 0.
Scenario 2: If target_pct in the last record is any other value(say 0.01), p_out_count returned from the procedure is 10140.
Please help me understand why the Table(Cast()) is not returning the correct results in Scenario 1. Also adding or deleting any record from the test data returns the correct results (i.e. if keep target_pct in the last record as 0 but add or delete any record).
Let me know how can I attach the test data I am using to help you debugging as I don’t see any Attach file button on Post Message screen on the forum.I am not able to reproduce this problem with a small data set. I can only reproduce with the data having 10140 records.
I am not sure if this is the memory issue as adding a new record also solves the problem.
This should not be the error because of wrong way of filling the records in java as for testing purpose I just saved the records which I am sending from java in a table. I updated the stored procedure as well to read the data from the table and then perform TABLE(CAST()) operation. I am still getting 0 as the output for scenario 1 mentioned in my last mail.
Here is what I have updated:
1. Created the table target_table
CREATE Table target_table
target_id NUMBER(10),
target_entity_id NUMBER(10),
dd CHAR(3),
fd CHAR(3),
code NUMBER(10),
target_pct NUMBER,
template_nm VARCHAR2(50),
p_symbol VARCHAR2(10),
pm_init VARCHAR2(3),
target_name VARCHAR2(20),
target_type VARCHAR2(30),
target_caption VARCHAR2(30),
sort_order NUMBER (4)
2. Inserted data into the table : The script has around 10140 rows. Pls let me know how can I send it to you
3. Updated procedure to read data from table and stored into variable of type target_arr. Run Table(cast()) operation on target_arr and get the count
PROCEDURE test_target_weights
IS
v_target_rec target_table%ROWTYPE;
CURSOR wt_cursor IS
Select * from target_table;
v_count NUMBER := 1;
v_target_arr cws_target_arr:= target_arr ();
v_target_arr_rec target_rec;
v_rec_count NUMBER;
BEGIN
OPEN wt_cursor;
loop
fetch wt_cursor into v_target_rec; -- fetch data from table into local record.
exit when wt_cursor%notfound;
--move data into target_arr
v_target_arr_rec := cws_curr_pair_entity_wt_rec(v_target_rec target_id,v_target_rec. target_entity_id,
v_target_rec.dd,v_target_rec.fd,v_target_rec.code,v_target_rec.target_pct,
v_target_rec.template_nm,v_target_rec.p_symbol,v_target_rec.pm_init,v_target_rec.template_name,
v_target_rec.template_type,v_target_rec.template_caption,v_target_rec.sort_order);
v_target_arr.extend();
v_target_arr(v_count) := v_target_arr_rec;
v_count := v_count + 1;
end loop;
close wt_cursor;
-- run table cast on target_arr
SELECT count(*) into v_rec_count
FROM TABLE(CAST(v_target_arr AS target_arr)) arr;
DBMS_OUTPUT.enable;
DBMS_OUTPUT.PUT_LINE('p_out_count ' || v_rec_count);
DBMS_OUTPUT.PUT_LINE('v_count ' || v_count);
END;
Output is
p_out_count 0
v_count 10140
Expected output
p_out_count 10140
v_count 10140
Maybe you are looking for
-
Hi, Got N81 but can't find where to get rid of horizontal line options which are under the active standby shortcuts. The horizontal line defaults are: search internet and my content calendar entries wlan scanning
-
Count number of records in a internal table
hi i want to count number of records in internal table pls let me know how to count the number of records in a internal table. regards Arora
-
Delivery Block being Removed in Sales Order
Hello, While Creating a Sales Order, the moment we enter the Sales Order Entry initial Screen, the Delivery block is being set to a Default Value. However, when I enter the Sold-To,Ship-To, Material, Quantity & Plant and press enter, it disa
-
I'm having a bit of trouble with random access files. When I write the long values 9 or 11, everything below works fine. But with the value 10, I get an end of file exception. Anyone know what I might be doing wrong? It's so strange to me I'm wonderi
-
JAVA Initially our Java servlet used ojdbc4.jar to connect to oracle database . After migrating to Oracle 11g database, we are facing difficulties to read clob data returned from a oracle function. This was working fine in the previous DB versions. W