Record vs object vs globle table in pipelined function
i want to make pipeline function , i show it can be made in following ways
please suggest which one is better in performance and maintenance.
1)
create type my_tab_type is object
(prodid number, a varchar2(1), b varchar2(1),
c varchar2(1), d varchar2(1), e varchar2(1))
create type my_tab_type_coll is table of my_tab_type;
create or replace function get_some_data (p_val in number)
return my_tab_type_coll pipelined is
begin
FOR i in (select * from my_table where prodid=p_val) loop
pipe row(my_tab_type(i.prodid,i.a,i.b,i.c,i.d,i.e));
end loop;
return;
end;
SELECT * FROM table(get_Some_Data(3));
2)
one can create globle tem table "Tlb_3". then can make a package like fllowing
create or replace
PACKAGE pk1
AS
TYPE T_type IS TABLE OF Tlb_3%ROWTYPE;
END;
and rest of the thing will be same like first one.
3)
TYPE outrec_typ IS RECORD (
var_num NUMBER(6),
var_char1 VARCHAR2(30),
var_char2 VARCHAR2(30)
TYPE outrecset IS TABLE OF outrec_typ;
and rest of the thing will be same like first one
so main question is relating to declaretion of TABLE which is returned.
yours sincerely
Edited by: 944768 on Jan 2, 2013 4:23 AM
DUPLICATE THREAD!
How many times do you intend to ask this question?
This is the same question that you ask, and got answered, six months ago in this thread?
how to write Function returing table or set of rows.
And you ask it again a week ago in this thread
object vs record in pipelined function.
Have you forgotten those answers already? Why didn't you take the advice given there and perform some tests?
And you don't seem to acknowledge any of the help you get to your questions by marking them ANSWERED when they have been.
Please revisit this 32 questions and mark them ANSWERED as appropriate - Total Questions: 73 (32 unresolved)
>
i want to make pipeline function , i show it can be made in following ways
please suggest which one is better in performance and maintenance.
>
Why didn't you take the advice given there and perform some tests?
Option #1, using SQL types is better, especially for maintenance. Also SQL types are required if the function is going to be called from SQL. You can define PL/SQL or %ROWTYPE package variables and use them but Oracle will silently create 'hidden' (in 11g) SQL types and use those.
See Solomon's explanation and sample code in this recent thread
Re: Pipe line function
There certainly isn't any need to create a global temp table just so you can create the %ROWTYPE variable; you can create one of those based on a CURSOR.
Similar Messages
-
PipeLine Function Taking time to return Table record
Hi,
I want to use a function in join clause. so i go for pipelined function(using for loop to get record & 1 more loop to fetch in table type variable). i achieved what i required. but problem is it takes much time to fetch data. is there any other approach which returns table records without pipelined function.
please suggest me a better approach as soon as possible.Hi,
Thanks all for the quick response.
I am using oracle 10g
this is the table details & the entire function.
Create object & table type to use in the function
CREATE OR REPLACE TYPE SYSADM.STR_TYPE AS OBJECT(COLUMNVALUE VARCHAR2(8),FromNo Int,ToNo Int)
CREATE OR REPLACE TYPE SYSADM.STR_ARRAY AS TABLE OF STR_TYPE
table involved
View : VesselType
column : Code varchar2(5)
Table : T065_SHIP
column : SKIPS_KODE varchar2(4)
CODE_SHIPTYPE varchar2(5)
Table : SelsKap
column : SELSKAPSKODE varchar2(4)
Table : t041_shiptypeusers
column : Code_ShipType varchar2(5)
USERID varchar2(8)
View : PositionBook
column : VesselCode varchar2(8)
VoyageNo integer
Company varchar2(4)
Table : T62_BRUKER_SELSKAP
column : SELSKAPSKODE varchar2(4)
BRUKER varchar2(8)
Pipelined function
CREATE OR REPLACE FUNCTION SYSADM.TF_ShiporShipTypeByUser
In_UserName IN VARCHAR2,
In_Type IN VARCHAR2,
In_VesselCode IN VARCHAR2,
In_CompanyHistory IN NUMBER DEFAULT 0
RETURN str_array PIPELINED AS
l_ShipTypeUser NUMBER(10,0);
l_CompanyUser NUMBER(10,0);
l_UseCompanyHistory NUMBER(1,0);
l_Snicsacct NUMBER(1,0);
BEGIN
BEGIN
SELECT shiptype_user,
company_user
INTO l_ShipTypeUser,
l_CompanyUser
FROM User_Segregation;
EXCEPTION
WHEN OTHERS THEN
l_ShipTypeUser := NULL;
l_CompanyUser := NULL;
END;
BEGIN
SELECT 1 INTO l_Snicsacct
FROM DUAL
WHERE NOT EXISTS ( SELECT 1 FROM sn_user_cfg WHERE UserID='SNICS' and CfgID='ACCTSYS');
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
IF In_CompanyHistory = 1
THEN
BEGIN
SELECT CfgData
INTO l_UseCompanyHistory
FROM SN_User_Cfg
WHERE CfgID = 'USE COMPANY HISTORY'
AND UserID = 'SNICS';
EXCEPTION
WHEN OTHERS THEN
l_UseCompanyHistory := 0;
END;
END IF;
IF In_UserName = 'SYSADM' OR (l_CompanyUser = 0 AND l_ShipTypeUser = 0)
OR (l_CompanyUser = 1 and l_Snicsacct =1 ) or (In_CompanyHistory = 0 and l_CompanyUser = 1 and In_Type ='ShipType')
OR (l_ShipTypeUser = 1 and In_Type = 'Company')
THEN
BEGIN
IF In_Type = 'ShipType'
THEN
BEGIN
FOR cur IN (SELECT Code ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM VesselType )
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
ELSIF In_Type = 'Ship'
THEN
BEGIN
FOR cur IN (SELECT SKIPS_KODE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP
WHERE SKIPS_KODE = NVL(In_VesselCode,SKIPS_KODE ))
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
ELSIF In_Type = 'Company'
THEN
BEGIN
FOR cur IN (SELECT SELSKAPSKODE ShipCode
, NULL VoyageFrom
, NULL VoyageTo
FROM SelsKap)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
END IF;
END;
ELSE
IF In_Type = 'Ship'
THEN
BEGIN
IF l_ShipTypeUser =1
THEN
BEGIN
FOR cur IN (SELECT S.SKIPS_KODE ShipCode
, 1 FromVoyage
, 999999999 ToVoyage
FROM T065_SHIP S
JOIN t041_shiptypeusers U
ON S.CODE_SHIPTYPE = U.Code_ShipType
AND USERID = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
GROUP BY S.SKIPS_KODE)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.FromVoyage,cur.ToVoyage));
END LOOP;
RETURN;
END;
ELSIF l_CompanyUser = 1
THEN
BEGIN
IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
THEN
FOR cur IN (SELECT a.VesselCode ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
JOIN T62_BRUKER_SELSKAP b
ON a.Company = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
UNION
SELECT a.VesselCode ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.VesselCode,
a.VoyageNo,
a.VoyageNo)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
ELSE
FOR cur IN (SELECT a.SKIPS_KODE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP a
JOIN T62_BRUKER_SELSKAP b
ON a.Company = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
AND NVL(l_UseCompanyHistory,0) = 0
UNION
SELECT a.SKIPS_KODE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.SKIPS_KODE)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END IF;
END;
END IF;
END;
ELSIF In_Type = 'ShipType'
THEN
IF l_ShipTypeUser = 1
THEN
BEGIN
FOR cur IN (SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
JOIN t041_shiptypeusers U
ON S.CODE_SHIPTYPE = U.Code_ShipType
AND USERID = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
GROUP BY S.CODE_SHIPTYPE)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
ELSIF l_CompanyUser = 1
THEN
IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
THEN
BEGIN
FOR cur IN (SELECT a.VesselType ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
JOIN T62_BRUKER_SELSKAP b
ON a.COMPANY = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.VesselCode = NVL(In_VesselCode,a.VesselCode)
UNION
SELECT a.VesselType ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.VesselType,
a.VoyageNo,
a.VoyageNo)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
ELSE
BEGIN
FOR cur IN (SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
JOIN T62_BRUKER_SELSKAP b
ON S.company = b.SELSKAPSKODE
AND B.BRUKER = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
AND NVL(l_UseCompanyHistory,0) = 0
UNION
SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
LEFT JOIN T62_BRUKER_SELSKAP b
ON S.company = b.SELSKAPSKODE
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
AND b.SELSKAPSKODE IS NULL)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
END IF;
END IF;
ELSIF In_Type = 'Company'
THEN
BEGIN
FOR cur IN (SELECT a.SELSKAPSKODE ShipCode
, NULL VoyageFrom
, NULL VoyageTo
FROM Selskap a
JOIN T62_BRUKER_SELSKAP b
ON a.SELSKAPSKODE = b.SELSKAPSKODE
WHERE b.BRUKER = In_UserName
Union All
Select a.SELSKAPSKODE ShipCode
, NULL VoyageFrom
, NULL VoyageTo
From Selskap a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.SELSKAPSKODE = b.SELSKAPSKODE
Where b.SELSKAPSKODE IS NULL
GROUP BY a.SELSKAPSKODE)
LOOP
PIPE ROW(str_type(cur.ShipCode,cur.VoyageFrom,cur.VoyageTo));
END LOOP;
RETURN;
END;
END IF;
END IF;
END;
select statement which i call the function it takes minimum 6 seconds to execute. It gives 8339 records
WITH deftbl AS ( SELECT /*+ CACHE(deftbl) */
/*+ result_cache */
a.VesselCode,
a.VoyageNo,
CASE a.BallastLeg When 0
THEN MIN(a.ArrivalDate)
ELSE NVL(( SELECT MAX(DepartureDate)
FROM PositionBook b
WHERE b.VesselCode = a.VesselCode
AND b.VoyageNo = (Select MAX(VoyageNo) From PositionBook c Where c.VesselCode = a.VesselCode and c.VoyageNo<a.VoyageNo)
),MIN(a.ArrivalDate))
END AS StartOfVoyage,
MAX(DepartureDate) EndOfVoyage
FROM PositionBook a
JOIN TABLE(*TF_ShiporShipTypeByUser*('BKA', 'Ship', NULL, 1)) D /*Calling the function*/
ON D.ColumnValue = a.VesselCode
AND a.VoyageNo BETWEEN D.FromVoyageNo AND D.ToVoyageNo
GROUP BY VesselCode,VoyageNo,a.BallastLeg )
SELECT /*+ result_cache */
ROW_NUMBER() OVER(PARTITION BY a.VesselCode ORDER BY a.VoyageNo DESC) as "Row"
,a.VesselCode
,v.Name AS VesselName
,a.VoyageNo
,c.StartOfVoyage AS FromPort
,c.EndOfVoyage AS ToPort
/*,a.FROMPORT
,a.TOPORT*/
, CASE
WHEN ( SELECT PortName
FROM PositionBook b
WHERE b.VesselCode = a.VesselCode
AND b.VoyageNo = a.VoyageNo
AND SYSDATE BETWEEN ArrivalDate AND DepartureDate ) IS NOT NULL
THEN ( SELECT FIRST_VALUE(PortName) OVER(PARTITION BY b.vesselcode,b.VoyageNo ORDER BY b.vesselcode,b.VoyageNo,b.ArrivalDate,b.secondarytime)
FROM PositionBook b
WHERE b.VesselCode = a.VesselCode
AND b.VoyageNo = a.VoyageNo
AND SYSDATE BETWEEN ArrivalDate AND DepartureDate
AND ROWNUM=1
WHEN SYSDATE BETWEEN c.StartOfVoyage AND c.EndOfVoyage
THEN ( SELECT 'Steam From '||FIRST_VALUE(UPPER(PortName)) OVER(PARTITION BY b.vesselcode,b.VoyageNo ORDER BY b.vesselcode,b.VoyageNo,b.ArrivalDate desc,b.secondarytime desc)
FROM POSITIONBOOK b
WHERE b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
AND b.ArrivalDate<SYSDATE
AND ROWNUM=1
WHEN (c.StartOfVoyage-SYSDATE)>0
THEN 'Voyage Not Started'
WHEN (c.EndOfVoyage-SYSDATE)<0
THEN 'Voyage Completed'
ELSE Null
END "Location"
,( SELECT MIN(b.PortName) KEEP(DENSE_RANK FIRST ORDER BY b.ArrivalDate,b.secondarytime) OVER(PARTITION BY b.VesselCode,b.VoyageNo)
FROM POSITIONBOOK b
WHERE b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
AND b.ArrivalDate>SYSDATE
AND ROWNUM=1
) AS NextPort
, ( SELECT MIN(b.ArrivalDate) KEEP(DENSE_RANK FIRST ORDER BY b.ArrivalDate,b.secondarytime) OVER(PARTITION BY b.VesselCode,b.VoyageNo)
FROM POSITIONBOOK b
where b.VesselCode = a.VesselCode AND b.VoyageNo = a.VoyageNo
AND b.ArrivalDate>SYSDATE
AND ROWNUM=1
) AS NextETA
,a.STATUS VoyageStatus
,a.Trade
,UFN_MyVoyConcatinate_Values('FIXNOTE', a.VesselCode, a.VoyageNo) FixNote
,UFN_MyVoyConcatinate_Values('CHARTERER', a.VesselCode, a.VoyageNo) Charterer
,CASE WHEN st.CurrentStatus=0
THEN 1
WHEN st.CurrentStatus=1
THEN 0
ELSE st.CurrentStatus
END AS CurrentStatus
FROM Positionbook a
JOIN deftbl c
ON a.VesselCode = c.VesselCode
AND a.VoyageNo = c.VoyageNo
JOIN Vessel v
ON v.Code = c.VesselCode
LEFT JOIN GTT_VOYAGESTATUS st
ON st.VesselCode = c.Vesselcode
AND st.VoyageNo = c.VoyageNo
GROUP BY a.VesselCode
, v.Name
, a.VoyageNo
, c.StartOfVoyage
, c.EndOfVoyage
/*, a.FROMPORT
, a.TOPORT*/
, a.Status
, a.Trade
, st.CurrentStatus;
Note:
i changed the function without pipelined also. but it doesnt show much difference
non pipelined function
CREATE OR REPLACE FUNCTION TF_ShiporShipTypeByUser_nonp
In_UserName IN VARCHAR2,
In_Type IN VARCHAR2,
In_VesselCode IN VARCHAR2,
In_CompanyHistory IN NUMBER DEFAULT 0
RETURN str_array AS
l_ShipTypeUser NUMBER(10,0);
l_CompanyUser NUMBER(10,0);
l_UseCompanyHistory NUMBER(1,0);
l_Snicsacct NUMBER(1,0);
l_str_array str_array:=str_array();
BEGIN
BEGIN
SELECT shiptype_user,
company_user
INTO l_ShipTypeUser,
l_CompanyUser
FROM User_Segregation;
EXCEPTION
WHEN OTHERS THEN
l_ShipTypeUser := NULL;
l_CompanyUser := NULL;
END;
BEGIN
SELECT 1 INTO l_Snicsacct
FROM DUAL
WHERE NOT EXISTS ( SELECT 1 FROM sn_user_cfg WHERE UserID='SNICS' and CfgID='ACCTSYS');
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
IF In_CompanyHistory = 1
THEN
BEGIN
SELECT CfgData
INTO l_UseCompanyHistory
FROM SN_User_Cfg
WHERE CfgID = 'USE COMPANY HISTORY'
AND UserID = 'SNICS';
EXCEPTION
WHEN OTHERS THEN
l_UseCompanyHistory := 0;
END;
END IF;
IF In_UserName = 'SYSADM' OR (l_CompanyUser = 0 AND l_ShipTypeUser = 0)
OR (l_CompanyUser = 1 and l_Snicsacct =1 ) or (In_CompanyHistory = 0 and l_CompanyUser = 1 and In_Type ='ShipType')
OR (l_ShipTypeUser = 1 and In_Type = 'Company')
THEN
BEGIN
IF In_Type = 'ShipType'
THEN
BEGIN
SELECT STR_TYPE(Code,1,999999999)
BULK COLLECT INTO l_str_array
FROM VesselType;
RETURN l_str_array;
END;
ELSIF In_Type = 'Ship'
THEN
BEGIN
SELECT STR_TYPE(SKIPS_KODE,1,999999999)
BULK COLLECT INTO l_str_array
FROM T065_SHIP
WHERE SKIPS_KODE = NVL(In_VesselCode,SKIPS_KODE);
RETURN l_str_array;
END;
ELSIF In_Type = 'Company'
THEN
BEGIN
SELECT STR_TYPE(SELSKAPSKODE,NULL,NULL)
BULK COLLECT INTO l_str_array
FROM SelsKap;
RETURN l_str_array;
END;
END IF;
END;
ELSE
IF In_Type = 'Ship'
THEN
BEGIN
IF l_ShipTypeUser =1
THEN
BEGIN
SELECT STR_TYPE(S.SKIPS_KODE,1,999999999)
BULK COLLECT INTO l_str_array
FROM T065_SHIP S
JOIN t041_shiptypeusers U
ON S.CODE_SHIPTYPE = U.Code_ShipType
AND USERID = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
GROUP BY S.SKIPS_KODE;
RETURN l_str_array;
END;
ELSIF l_CompanyUser = 1
THEN
BEGIN
IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
THEN
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM ( SELECT a.VesselCode ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
JOIN T62_BRUKER_SELSKAP b
ON a.Company = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
UNION
SELECT a.VesselCode ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.VesselCode,
a.VoyageNo,
a.VoyageNo);
RETURN l_str_array;
ELSE
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM (SELECT a.SKIPS_KODE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP a
JOIN T62_BRUKER_SELSKAP b
ON a.Company = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
AND NVL(l_UseCompanyHistory,0) = 0
UNION
SELECT a.SKIPS_KODE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.SKIPS_KODE = NVL(In_VesselCode, a.SKIPS_KODE)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.SKIPS_KODE);
RETURN l_str_array;
END IF;
END;
END IF;
END;
ELSIF In_Type = 'ShipType'
THEN
IF l_ShipTypeUser = 1
THEN
BEGIN
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM (SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
JOIN t041_shiptypeusers U
ON S.CODE_SHIPTYPE = U.Code_ShipType
AND USERID = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
GROUP BY S.CODE_SHIPTYPE);
RETURN l_str_array;
END;
ELSIF l_CompanyUser = 1
THEN
IF l_UseCompanyHistory = 1 AND In_CompanyHistory = 1
THEN
BEGIN
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM ( SELECT a.VesselType ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
JOIN T62_BRUKER_SELSKAP b
ON a.COMPANY = b.SELSKAPSKODE
AND b.BRUKER = In_UserName
WHERE a.VesselCode = NVL(In_VesselCode,a.VesselCode)
UNION
SELECT a.VesselType ShipCode
, a.VoyageNo VoyageFrom
, a.VoyageNo VoyageTo
FROM PositionBook a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.company = b.SELSKAPSKODE
WHERE a.VesselCode = NVL(In_VesselCode, a.VesselCode)
AND b.SELSKAPSKODE IS NULL
GROUP BY a.VesselType,
a.VoyageNo,
a.VoyageNo);
RETURN l_str_array;
END;
ELSE
BEGIN
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM ( SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
JOIN T62_BRUKER_SELSKAP b
ON S.company = b.SELSKAPSKODE
AND B.BRUKER = In_UserName
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
AND NVL(l_UseCompanyHistory,0) = 0
UNION
SELECT S.CODE_SHIPTYPE ShipCode
, 1 VoyageFrom
, 999999999 VoyageTo
FROM T065_SHIP S
LEFT JOIN T62_BRUKER_SELSKAP b
ON S.company = b.SELSKAPSKODE
WHERE S.SKIPS_KODE = NVL(In_VesselCode, S.SKIPS_KODE)
AND b.SELSKAPSKODE IS NULL);
RETURN l_str_array;
END;
END IF;
END IF;
ELSIF In_Type = 'Company'
THEN
BEGIN
SELECT STR_TYPE(ShipCode,VoyageFrom,VoyageTo)
BULK COLLECT INTO l_str_array
FROM ( SELECT a.SELSKAPSKODE ShipCode
, NULL VoyageFrom
, NULL VoyageTo
FROM Selskap a
JOIN T62_BRUKER_SELSKAP b
ON a.SELSKAPSKODE = b.SELSKAPSKODE
WHERE b.BRUKER = In_UserName
Union All
Select a.SELSKAPSKODE ShipCode
, NULL VoyageFrom
, NULL VoyageTo
From Selskap a
LEFT JOIN T62_BRUKER_SELSKAP b
ON a.SELSKAPSKODE = b.SELSKAPSKODE
Where b.SELSKAPSKODE IS NULL
GROUP BY a.SELSKAPSKODE);
RETURN l_str_array;
END;
END IF;
END IF;
END;please kindly provide me your valuable suggestions
Edited by: ganex27lin on Mar 16, 2011 1:54 AM -
How to cast RECORD of nested tables into OBJECT of nested tables
Right, we have an existing massive pl/sql package where some of the processing is taking too long so they want to try multithreading it.
The data in this package is stored in an array of records which contains nested tables, which themselves contain nested tables.
So, we want to split this table into 10, and submit them to 10 dbms_jobs to run concurrently, write the modified arrays to the database so they can be picked up again by the original process.
I'm stuck on converting the associative array of data (containing tables of records) into objects which can be stored in the DB.
My database objects:
CREATE OR REPLACE
TYPE ktest_claims_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10));
CREATE OR REPLACE
TYPE ktest_claims_tt IS TABLE OF ktest_claims_rt;
CREATE OR REPLACE
TYPE ktest_driver_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10)
,claims_nt ktest_claims_tt);
CREATE OR REPLACE
TYPE ktest_driver_tt IS TABLE OF ktest_driver_rt;
CREATE OR REPLACE
TYPE ktest_policy_rt IS OBJECT
col1 varchar2(10)
,col2 varchar2(10)
,driver_nt ktest_driver_tt);
CREATE OR REPLACE
TYPE ktest_policy_tt IS TABLE OF ktest_policy_rt;
CREATE TABLE ktest_job_table
(job_no NUMBER
,tab_type VARCHAR2(3)
,policy_nt ktest_policy_tt
NESTED TABLE policy_nt STORE AS policy_nested_tab
(NESTED TABLE driver_nt STORE AS driver_nested_tab
(NESTED TABLE claims_nt STORE AS claims_nested_tab))
/ And my local package versions:
TYPE claims_rt IS RECORD
col1 varchar2(10)
,col2 varchar2(10));
TYPE claims_tt IS TABLE OF claims_rt INDEX BY PLS_INTEGER;
TYPE driver_rt IS RECORD
col1 varchar2(10)
,col2 varchar2(10)
,claims_nt claims_tt);
TYPE driver_tt IS TABLE OF driver_rt INDEX BY VARCHAR2(20);
TYPE policy_rt IS RECORD
policy_no policy.policy_no%TYPE
,driver_tab driver_tt
,other_col VARCHAR2(20));
TYPE policy_tt IS TABLE OF policy_rt
INDEX BY pls_integer;
main_table policy_tt;What I can't get through my pea sized brain is how to turn "main_table" into an array based on ktest_policy_tt.
I got as far as:
FUNCTION convert (p_table IN policy_tt) RETURN ktest_policy_tt
IS
db_vers ktest_policy_tt := ktest_policy_tt();
db_rec ktest_policy_rt;
BEGIN
FOR i IN p_table.FIRST..p_table.LAST
LOOP
db_rec := ktest_policy_rt(p_table(i).policy_no
,p_table(i).other_col
,ktest_driver_tt(p_table(i).driver_tab(i).col1
,p_table(i).driver_tab(i).col2
,ktest_claims_tt(p_table(i).driver_tab(i).claims_nt(i).col1
,p_table(i).driver_tab(i).claims_nt(i).col1
db_vers(i) := db_rec;
END LOOP;
END;but, apart from the fact that it only coverts the first row of each table, it doesn't compile:
LINE/COL ERROR
139/10 PL/SQL: Statement ignored
143/52 PLS-00306: wrong number or types of arguments in call to
'KTEST_CLAIMS_TT'
143/52 PLS-00306: wrong number or types of arguments in call to
'KTEST_CLAIMS_TT'I'd appreciate any help as this is getting urgent.
Thanks!I would recommend writing your function in a more stepwise, explicit fashion rather than trying to write the conversion as basically one big constructor.
Firstly, you will require nested loops in your pl/sql code for the different levels of nested tables. This is not a choice, you need to do this.
Within each level of looping, explicitly create the object of the desired type before adding it to the table / record as need be.
cheers,
Anthony -
I can't save the record in a new/empy table of sqlserver in the entity Framework 5.0
Hi guys ,
I have tried to become a database expert in Entity Framework but I can't. because I am not able to save the record in a fresh/ empty table of sql server 2008 r2 database. for that I have watched the video tutorials step by steps that how to save the record.
I followed the tutorials step by step and at the end the result is negative.
I tried a simple way given below. please some one help me that where and what I missing the.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EmployeesLib;
namespace EmpApplication
public partial class Form1 : Form
private EMPEntities _dbContext;
public Form1()
InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
_dbContext = new EMPEntities();
var sql = _dbContext.Employees;
this.employeeBindingSource.DataSource = sql.ToList();
private void employeeBindingNavigatorSaveItem_Click(object sender, EventArgs e)
this.Validate();
_dbContext.SaveChanges();
I have used datagrid addid a row by Click Add button on the NavigationBindingsource entered an employee name
and clicking the save button on the NavigationBindingSource. When I am restarting the application I nothing founding on the Datagrid I am saving before.
below is the Connection String in the App.config file both in the project.
APP.CONFIG connection string
<add name="EMPEntities" connectionString="metadata=res://*/EmpModal.csdl|res://*/EmpModal.ssdl|res://*/EmpModal.msl;provider=System.Data.SqlClient;provider connection string="data source=(local);initial catalog=Inventory;integrated
security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />humm, I falling the ball to the batsman(sqlserver) but it getting "NOBALL" in response(not saving). Ok it my be problem in visual studio I am struggling to remove my operating System, VS2013 and sql server, by reinstalling it might works.
because i havent any other computer where these application are installed for the test.
If you create and send me a small project that contain minimum of two columns of table( in sql server ) which can saving new data from datagrid so i will thankfull of you.
it is just for confirmation that either the problem is in OS or VS.
I doubt that any of it has anything to do with the issue. If you think it does, then you can post to the forums.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vssetup
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
I think you are riding a bad horse (that tutorial) you are using, and you need to change horses. I think the 'modified' state is not being rasied on the entity bound to the grid when it has changed, and EF is not going save any entity that's not in a modified
state. -
To find locks on the objects for the table-- urgent
hi all..
how to find which lock object is used for the table T001b...
i want to lock a record of the table t001b before righting the select query and then do some mofification and the unlock it again..
plz can any one tell me how to do this...
thnx
Message was edited by:
neha guptaHi Neha,
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
check this link for example.
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
tables:vbak.
call function 'ENQUEUE_EZLOCK3'
exporting
mode_vbak = 'E'
mandt = sy-mandt
vbeln = vbak-vbeln
X_VBELN = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = ' '
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Thanks,
Reward If helpful. -
BC4J view objects on pipeline functions
Hello,
I just wanted to find out if we can place a BC4J view object on the new Oracle 9i Pipeline functions.
Thanks
RamnaIf it still looks on the outside like a database view to the JDBC client (BC4J in this case), then sure.
If you're making updates, then your underlying entity object will have to:
[list]
[*]Be mapped to an appropriate, updateable table, or
[*]Write INSTEAD OF triggers for your view
[list]
Let us know if you hit any problems. -
Records and Objects, Cast for PL/SQL Type RECORD and SQL Type OBJECT
Hi seniors:
In my job, we have Oracle 10g, programming with Packages, the parameters are PL/SQL Types,
Example:
PACKAGE BODY NP_CONTROL_EQUIPMENT_PKG
IS
TYPE TR_EQUIPMENT_OPERATION IS RECORD(
wn_npequipmentoperid CONTROL_EQUIPMENT.NP_EQUIPMENT_OPERATIONS.npequipmentoperid%TYPE,
wv_npactiveservicenumber CONTROL_EQUIPMENT.NP_EQUIPMENT_OPERATIONS.npactiveservicenumber%TYPE,
wv_npspecification ORDERS.NP_SPECIFICATION.npspecification%TYPE,
wv_nptype ORDERS.NP_SPECIFICATION.nptype%TYPE,
wn_nporderid CONTROL_EQUIPMENT.NP_EQUIPMENT_OPERATIONS.nporderid%TYPE,
wn_npguidenumber CONTROL_EQUIPMENT.NP_EQUIPMENT_OPERATIONS.npguidenumber%TYPE,
wd_npdevolutionprogramdate CONTROL_EQUIPMENT.NP_EQUIPMENT_STATUS.npdevolutionprogramdate%TYPE
TYPE TT_TR_EQUIPMENT_OPERATION_LST IS TABLE OF TR_EQUIPMENT_OPERATION INDEX BY BINARY_INTEGER;
PROCEDURE SP_GET_EQUIPMENT_OPERATION_LST(
an_npequipstatid IN CONTROL_EQUIPMENT.NP_EQUIPMENT_STATUS.npequipstatid%TYPE,
at_equipment_operation_list OUT TT_TR_EQUIPMENT_OPERATION_LST,
av_message OUT VARCHAR2
IS
BEGIN
SELECT EO.npequipmentoperid,
EO.npactiveservicenumber,
S.npspecification,
S.nptype,
EO.nporderid,
EO.npguidenumber,
ES.npdevolutionprogramdate
BULK COLLECT INTO at_equipment_operation_list
FROM NP_EQUIPMENT_OPERATIONS EO,
NP_EQUIPMENT_STATUS ES,
ORDERS.NP_ORDER O,
ORDERS.NP_SPECIFICATION S
WHERE EO.npequipstatid = ES.npequipstatid
AND EO.nporderid = O.nporderid
AND O.npspecificationid = S.npspecificationid
AND EO.npequipstatid = an_npequipstatid;
EXCEPTION
WHEN OTHERS THEN
av_message := 'NP_CONTROL_EQUIPMENT_PKG.SP_GET_EQUIPMENT_OPERATION_LST: '||SQLERRM;
END SP_GET_EQUIPMENT_OPERATION_LST;
END;
Procedures calls other procedures and passing parameters IN OUT defined that PL/SQL Types. The problem appears when the access is through Java. Java can't read PL/SQL Types because only read SQL Types (Types defined in SCHEMA):
CREATE OR REPLACE
TYPE TO_EQUIPMENT_OPERATION AS OBJECT (
wn_npequipmentoperid NUMBER,
wv_npactiveservicenumber VARCHAR2(15),
wv_npspecification VARCHAR2(8),
wv_nptype VARCHAR2(2),
wn_nporderid NUMBER,
wn_npguidenumber NUMBER,
wd_npdevolutionprogramdate DATE
CREATE OR REPLACE
TYPE TT_EQUIPMENT_OPERATION_LST
AS TABLE OF "CONTROL_EQUIPMENT"."TO_EQUIPMENT_OPERATION"
Java can read this SQL Types. The problem is how cast OBJECT to RECORD, because I can't execute that:
DECLARE
wt_operation_lst TT_EQUIPMENT_OPERATION_LST;
BEGIN
SELECT EO.npequipmentoperid,
EO.npactiveservicenumber,
S.npspecification,
S.nptype,
EO.nporderid,
EO.npguidenumber,
ES.npdevolutionprogramdate
BULK COLLECT INTO wt_operation_lst
FROM NP_EQUIPMENT_OPERATIONS EO,
NP_EQUIPMENT_STATUS ES,
ORDERS.NP_ORDER O,
ORDERS.NP_SPECIFICATION S
WHERE EO.npequipstatid = ES.npequipstatid
AND EO.nporderid = O.nporderid
AND O.npspecificationid = S.npspecificationid
AND EO.npequipstatid = an_npequipstatid;
END;
and throws NOT ENOUGH VALUES, and I modified to:
DECLARE
wt_operation_lst TT_EQUIPMENT_OPERATION_LST;
BEGIN
SELECT TO_EQUIPMENT_OPERATION(EO.npequipmentoperid,
EO.npactiveservicenumber,
S.npspecification,
S.nptype,
EO.nporderid,
EO.npguidenumber,
ES.npdevolutionprogramdate)
BULK COLLECT INTO wt_operation_lst
FROM NP_EQUIPMENT_OPERATIONS EO,
NP_EQUIPMENT_STATUS ES,
ORDERS.NP_ORDER O,
ORDERS.NP_SPECIFICATION S
WHERE EO.npequipstatid = ES.npequipstatid
AND EO.nporderid = O.nporderid
AND O.npspecificationid = S.npspecificationid
AND EO.npequipstatid = an_npequipstatid;
END;
Worst is that I can't modify this procedure and PL/SQL Types will survive.
I have create a copy that CAST RECORD to OBJECT and OBJECT to RECORD too.
PROCEDURE SP_COPY_PLSQL_TO_SQL(
an_npequipstatid IN NUMBER,
at_dominio_lst OUT ORDERS.TT_EQUIPMENT_OPERATION_LST, --SQL Type
av_message OUT VARCHAR2
IS
wt_dominio_lst CONTROL_EQUIPMENT.NP_CONTROL_EQUIPMENT_PKG.TT_TR_EQUIPMENT_OPERATION_LST; --PL/SQL Type
BEGIN
SP_GET_EQUIPMENT_OPERATION_LST(an_npequipstatid, wt_dominio_lst, av_message);
IF av_message IS NULL THEN
at_dominio_lst := ORDERS.TT_EQUIPMENT_OPERATION_LST(ORDERS.TO_EQUIPMENT_OPERATION('','','','','','',''));
at_dominio_lst.EXTEND(wt_dominio_lst.COUNT - 1);
FOR i IN 1..wt_dominio_lst.COUNT LOOP
at_dominio_lst(i) := ORDERS.TO_EQUIPMENT_OPERATION(wt_dominio_lst(i).wn_npequipmentoperid,
wt_dominio_lst(i).wv_npactiveservicenumber,
wt_dominio_lst(i).wv_npspecification,
wt_dominio_lst(i).wv_nptype,
wt_dominio_lst(i).wn_nporderid,
wt_dominio_lst(i).wn_npguidenumber,
wt_dominio_lst(i).wd_npdevolutionprogramdate
END LOOP;
END IF;
END;
I would like that the CAST is direct. Somebody can help me?. Thank you so much!I am facing the same problem as u had...may I know how u solved ur probkem...
thanks,
kishore -
Find SAP table records given a list of tables
Dear all,
I have been given a list of table names that I require to provide a report a total record counts for these table.
given such codes I have can't proceed further as the field symbol that I use is invalid. Please advice how to complete this. Or perhaps any standard system reports to find the total record counts given a specified tables.
here's the code:
types : begin of w_dd02l,
TABNAME type TABNAME,
totalrec like sy-dbcnt,
END OF w_dd02l.
data : wa_dd02l type STANDARD TABLE OF w_dd02l with HEADER LINE.
data : wr_dd02l type w_dd02l.
data : totalrecord like sy-dbcnt.
field-SYMBOLS : <f1> type ANY.
p_tab is a selection field.
select tabname from dd02l into CORRESPONDING FIELDS OF TABLE wa_dd02l where tabname in p_tab.
loop at wa_dd02l into wr_dd02l.
assign wr_dd02l-tabname to <f1>.
select count(*) from <f1> into totalrecord.
wr_dd02l-totalrec = totalrecord.
write : wr_dd02l-tabname, wr_dd02l-totalrec.
ENDLOOP.
<f1> being a field symbol is not recognize as in ABAP dictionary. Here's where I can't proceed.. dear gurus please help.
Thanks and Regards,
AndrewPl. check, it's working
types : begin of w_dd02l,
TABNAME type TABNAME,
totalrec like sy-dbcnt,
END OF w_dd02l.
data : wa_dd02l type STANDARD TABLE OF w_dd02l with HEADER LINE.
data : wr_dd02l type w_dd02l.
data : totalrecord like sy-dbcnt.
field-SYMBOLS : <f1> type ANY.
PARAMETERS: p_tab like dd02l-tabname.
* p_tab is a selection field.
select tabname from dd02l
into CORRESPONDING FIELDS OF TABLE wa_dd02l
where tabname = p_tab.
loop at wa_dd02l into wr_dd02l.
assign wr_dd02l-tabname to <f1>.
select count(*) from (<f1>) into totalrecord. " use like (<f1>)
wr_dd02l-totalrec = totalrecord.
write : wr_dd02l-tabname, wr_dd02l-totalrec, <f1>.
endloop. -
How to identify missing records in a single-column table?
How to identify missing records in a single-column table ?
Column consists of numbers in a ordered manner but the some numbers are deleted from the table in random manner and need to identify those rows.Something like:
WITH t AS (
SELECT 1 ID FROM DUAL UNION ALL
SELECT 2 ID FROM DUAL UNION ALL
SELECT 3 ID FROM DUAL UNION ALL
SELECT 5 ID FROM DUAL UNION ALL
SELECT 8 ID FROM DUAL UNION ALL
SELECT 10 ID FROM DUAL UNION ALL
SELECT 11 ID FROM DUAL
-- end of on-the-fly data sample
SELECT '[' || (id + 1) || ' - ' || (next_id - 1) || ']' gap
FROM (
SELECT id,
lead(id,1,id + 1) over(order by id) next_id
FROM t
where id != next_id - 1
GAP
[4 - 4]
[6 - 7]
[9 - 9]
SQL> SY.
P.S. I assume sequence lower and upper limits are always present, otherwise query needs a little adjustment. -
How to upload a image or flash file as blob object in a table.
How to upload a image or flash file as blob object in a table.
What are all the possible ways we can do it.Searching the forum (or google) would be my first choice, as this question pops up every now and then.
Next without knowledge of your environment (jdev version and technology stack) it's hard to give a profound answer.
All I can say is that it's possible.
Timo -
How to upload records in two different interface tables through WebADI.
We have created custom integrator with two different interfaces to insert records in AP_INVOICES_INTERFACES and AP_INVOICE_LINES_INTERFACE. Also defined the custom layout in which we mention the header and lines column info to be displayed in the spreadsheet. When I tried to create document to upload the records into the interface tables, could find two different interface for header and lines , when we select the header and upload records into the AP_INVOICES_INTERFACES table it was successfull. But couldn't upload records inserted in Lines interfaces tables. How do we upload records in both the table do we have constraint with Web ADI can insert records to only one interface tables. Any recommendation highly appreciated.
Raghu,
Thanks for the reply,
I have a concern, But if you are connecting a another database you have to create one more subreport and each time am creating connections across databases we have to create subreport and go for the design to show the record. Is it any way to have a common field or union records approach in crystal report 2008.
For Example :
Approach 1 :
Emp name Emp salary (Common Header)
Variable Field1 Variable field2 ( Iterations to be done here for records)
Variable field 1 contains ---> emptbl(employee name), b.emptbl(employee name) (A database, b database, c database or any .db)
Variable field2 contains ---> emptbl (salary info between databases)
Approach 2:
getting all the records and union all the records
Thanks
Murali Sri -
Change in selected fileds of records in SAP R/3 Table
Hi Folks
I want to change the value in some fields of a few records in an R/3 table. Is it possible? If yes, HOW?
For example,
Table Name - TFACD and Fields - AKTVJAHR and AKTBJAHR
At present, AKTVJAHR value = 1990 and AKTBJAHR value = 1999.
I want them to be like... AKTVJAHR value = 2000 and AKTBJAHR value = 2009.
How can we accomplish it? Please let me know the steps.
Most Thanks......
Rajvathi,
You can not change the contents of the table directly as those related to configuration . The table data you are referring can be changed using configuration. You can refer transaction scal for changing those values.
regards,
Veeresh -
Error in multiple operation with change document object for custom table
hi all,
I have developed a change document object for a custom table ZTEST and developed a report program for insertion, updation & deletion..everything works fine if I do only once ie. if I created only 1 entries. If I created 2 new entries , I am getting an Error "DUPREC:POS&Z3RL_TAB&Z3RL_TAB" and EXIT the transaction.
why I am getting this error??? is it not possible to do multiple operation with the change document???
kindly help.
Edited by: JaiKarthik on Apr 7, 2010 6:20 AMLOOP AT ts_mod INTO wa_mod.
READ TABLE <i_itab> INTO <wa_tab> INDEX wa_mod-row.
* Select the existing entries in table Z3RL for change history
SELECT SINGLE * FROM z3rl
INTO wa_z3rl
WHERE vkorg = <wa_tab>+3(4)
AND zzkunnr = <wa_tab>+7(10).
* Move the old entries
IF sy-subrc = 0.
CLEAR ls_z3rl.
ls_z3rl = wa_z3rl.
ENDIF.
* Update the table
MODIFY (viewname) FROM <wa_tab>.
CLEAR wa_z3rl.
wa_z3rl-mandt = <wa_tab>+0(3).
wa_z3rl-vkorg = <wa_tab>+3(4).
wa_z3rl-zzkunnr = <wa_tab>+7(10).
* Populate change tables
CLEAR wa_change.
wa_change-teilobjid = 'Z3RL'.
wa_change-textart = 'TEST_2'.
wa_change-textspr = 'EN'.
wa_change-updkz = 'U'.
APPEND wa_change TO ts_change.
*call the fM to log the values in CDHDR table.
CALL FUNCTION 'Z3RL_WRITE_DOCUMENT'
EXPORTING
objectid = 'Z3RL'
tcode = sy-tcode
utime = sy-uzeit
udate = sy-datum
username = sy-uname
planned_change_number = ' '
object_change_indicator = 'U'
planned_or_real_changes = 'U'
no_change_pointers = 'U'
upd_icdtxt_z3rl= 'U'
n_z3rl= wa_z3rl
o_z3rl = ls_z3rl
upd_z3rl= 'U'
lv_opt = ' '
TABLES
icdtxt_z3rl= ts_change.
CLEAR : wa_mod, <wa_tab>.
ENDLOOP.
Edited by: JaiKarthik on Apr 7, 2010 6:49 AM -
SEQUENCE Object for Small Tables Only?
QUOTE from a recent thread: "Long term solution should be to use SEQUENCE with NO CACHE for small tables instead of identity and benefit from performance improvement for large tables."
Thread:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cf63d145-7084-4371-bde0-eb3b917c7163/identity-big-jump-100010000-a-feature?forum=transactsql
How about using SEQUENCE objects for large tables? Thanks.
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012Well Erland, either you calm down your manager (with a martini?) or use NO CACHE.
QUOTE: "This could cause a sequence to run out of numbers much more quickly than an IDENTITY value. It could also cause managers to become upset that values are missing, in which case they’ll need to simply get over it and accept that
there will be numbers missing.
If you need SQL Server to use every possible value, configure a cache setting of NO CACHE. This will cause the sequence to work much like the IDENTITY property. However, it will impact the sequence performance due to the additional metadata writes."
LINK: Microsoft SQL Server: The Sequencing Solution
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
SQL Loader Constraints with Column Objects and Nested Tables
I am working on loading a Table that (god forbid) contains columns, column objects, and nested tables (which contains several depth of column objects). My question is does SQL Loader have a hidding undocumented feature where it states how the column objects must be grouped in refereneced to the nested tables within the loader file? I can load the various column objects, and nested tables fine right now, however, I am loading them all in strange and insane order. Can anyone answer this question? Thanks.
PeterI just noticed that my email is wrong. If you can help, plese send email to [email protected]
thanks.
Maybe you are looking for
-
Why can't I open a PHP file as a web page in FF7? I could until I upgraded to 7 today.
I am a web designer and test sites on my local machine (3.06GHz 24" iMac with Mac OS 10.6.8). I open and preview all pages before uploading to my server. I have been doing this with Firefox for YEARS. Today I foolishly "upgraded" to version 7 and now
-
Can CC applications be downloaded, then installed in different location?
My home computer has a slow internet connection. I have access to other computers (work, parents' home, etc.) that have much faster Internet connections. For most applications, I will download the installation package from on a faster connection, c
-
Photos downloaded but not copied into iphoto
I downloaded 92 photos from my camera to iphoto 7.1.5, the download finished, I deleted the original photos on the camera at the prompt to keep or delete originals, and iphoto then crashed. When I restarted iphoto, the photos I'd just downloaded did
-
hi...! plz tell me how to upgrade oracle database 9.2.0 to 10.2.0 in oracle applications 11.5.10.2 I am following the metalink doc-id:359483.1. I did ths steps mentioned in the note. under DATABASE INSTALLATION step 3 I am getting following error....
-
Change mis-spelled email address
I was setting up my daughters iPhone and mis-spelled her email address. Anyone know how to change the address? I feel like I'm now caught in a loop where I'm prompted to verify the account but can't do so because I entered an invalid email address