Need to associate two record types
Hi,
I am trying to associate custom object 14 record to Custom Object 2 record as Custom Object 2's related record. I tried it with the help of integration. Everytime, it created a new custom object 14 record instead of associating the existing record. Following was the request XML sent to CRMOD
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/ecbs/customobject2/10/2004" xmlns:data="urn:/crmondemand/xml/CustomObject2/Data">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";>
<wsse:UsernameToken>
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ns:CustomObject2Insert_Input>
<data:ListOfCustomObject2>
<data:CustomObject2 operation="Update">
<data:Id>AMTA-NHHR4</data:Id>
<data:Name>496126-39447326</data:Name>
<data:ListOfCustomObject14>
<data:CustomObject14 operation="Update">
<data:Id>AMTA-NHG67</data:Id>
<data:Name>CO14_1</data:Name>
</data:CustomObject14>
</data:ListOfCustomObject14>
</data:CustomObject2>
</data:ListOfCustomObject2>
</ns:CustomObject2Insert_Input>
</soapenv:Body>
</soapenv:Envelope>
Can someone please help me associate these 2 records, without creating a new record in related object
Thanks and regards,
Hi vinoth,
yes this p.o workflow based on release strategy. i was copied the standard workflow template added activities
one is for changed and another is rejection.
once functional guy rejected the purchase order rejection activity not working properly
also same problem faced for changed step also while change the p.o value at item level.
i am using business object BUS2012 adding attributes for work item.
please guide me how to achieve above functionality also how to do binding for changing and rejection activities?
Similar Messages
-
Pass a record type vaiable in out parameter of a function in a package
Hi All,
1.I have created a ecod inside a package.
2.Then created a function which has a out parameter of the above record.
3.Now package body i'm creating a dynamic cursor .
4.My equirement is to fetch this dynamic cursor's value into the out parameter of the function.
I have created the below code for 1,2 and 3 but not getting how to achive the point 4.
create package pkg
type t_rec is recod (id number,id_name varchar2(10));
type t_data is table of t_rec index by binary_integer;
act_data t_data;
funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean;
end pkg;
create package body pkg
funcion return_data is (dept in number,region in number,o_rec out t_data) return boolean is
p_cur sys_refcursor;
l_text varchar2(100);
begin
-- As per my requirement i have built a dynamic l_text which contains where clause by taking dept and region values.In actual i have nearly 10 in paramaters with >which i'm building a dynamic where clause in l_text. So i'm using a ref cursor.
open p_cur for 'select id,id_name from tab1'||l_text';
fetch p_cur bulk collect into act_data;
exception ....
end pkg;Now as per the code snippet i could fetch all the rows returned by p_cur into act_data.
But how i will pass it though out parameter in the function which i will use somewhere in front end to show data.
Please help me in this.
Thanks in advance.bp wrote:
i need to create the where clause one the basis of the values of IN parameters.Sometimes i need to take count of the data on the basis of the IN parameters and if one of the conditions return value i will build where clause with those parameters.Please google and read up on the importance of creating shareable SQL - which needs to be done using bind variables.
The ref cursor interface in PL/SQL only support a static/fixed number of bind variables. So if you want to create cursors with variable number of bind values, you need to use conditional processing. E.g.
SQL> create or replace procedure EmpFilter( c OUT sys_refcursor, nameFilter varchar2, jobFilter varchar2 ) is
2 sqlSelect varchar2(32767);
3 begin
4 --// we pretend to built a dynamic SQL statement - so the table
5 --// name and so on is "unknown"
6 sqlSelect := 'select * from emp ';
7 case
8 when nameFilter is null and jobFilter is null then
9 open c for sqlSelect;
10
11 when nameFilter is null and jobFilter is not null then
12 sqlSelect := sqlSelect||'where job like :filter';
13 open c for sqlSelect using jobFilter;
14
15 when nameFilter is not null and jobFilter is null then
16 sqlSelect := sqlSelect||'where ename like :filter';
17 open c for sqlSelect using nameFilter;
18
19 when nameFilter is not null and jobFilter is not null then
20 sqlSelect := sqlSelect||'where ename like :filter1 and job like :filter2';
21 open c for sqlSelect using nameFilter, jobFilter;
22
23 end case;
24
25 DBMS_OUTPUT.put_line( 'Dynamic SQL: '||sqlSelect );
26 end;
27 /
Procedure created.
SQL>
SQL>
SQL> var c refcursor
SQL> begin
2 EmpFilter( :c, 'A%', null );
3 end;
4 /
Dynamic SQL: select * from emp where ename like :filter
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 ALLEN SALESMAN 7698 1981/02/20 00:00:00 1600 300 30
7876 ADAMS CLERK 7788 1987/05/23 00:00:00 1100 20
SQL>
SQL> begin
2 EmpFilter( :c, null, 'ANALYST' );
3 end;
4 /
Dynamic SQL: select * from emp where job like :filter
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7788 SCOTT ANALYST 7566 1987/04/19 00:00:00 3000 20
7902 FORD ANALYST 7566 1981/12/03 00:00:00 3000 20
SQL>And this approach is for external clients - where a Visual Basic or Java client program calls the database, executes the stored procedure, and receives a cursor handle in turn. And the client then fetches the output of this cursor and process it.
There is no need to return a record type of any sorts. The client wants the cursor handle as that is the optimal and best interface for the client to receive database data.
If the caller is not an external client, but another PL/SQL procedure, then this approach does not make much sense.
It is important that you understand basic Oracle concepts and fundamentals. What a cursor is. What the best way is to process Oracle data. How to best use the basic features of Oracle. Without that basic understanding, you as good as a low hour Cessna pilot getting into an Airbus A400M - where the Cessna pilot would not even be able to start a single engine, never mind get the plane in the air.
Likewise, without a basic understanding of Oracle cursors and fundamentals, you will be unable to code even a single line of sensible code. Not because you are a bad programmer. Even the best programmer in the world will be unable to write decent code, if the programmer has no idea how the environment works, what the concepts and fundamentals are. But it is fair to expect that a good programmer will no write such code, understand that there is a lack of knowledge, and address that accordingly. -
Need to setup Premiere CS6 sequence for two file types with different field orders
I have a client who has shot video for me using two cameras, one camera was set to progressive, and the other to interlaced upper field first. I need to use both file types in the edit and have been struggling to set up the sequence to get the best look for the end product, a DVD. I have several videos to do for her that were all shot in the same way, so I need a solution!
I would appreciate help figuring out how to set up this work flow from beginning to end.
Should I convert one of the files from the beginning so they match field orders before going into a sequence? Or do I just need to do some adjusting of the files once they are in the sequence? Is it just as simple as changing the transcode settings to favor the upper field first? I'm definitely having issues once the video is transcoded in Encore and you can see a lot of jagged edges and lines especially during movement. My client isn't happy and I've tried several workarounds, but to no avail.
Here are the two file types I have:
File extension: .MOV
H.264, 1920x1080, Linear PCM, 16 bit little-endian signed integer, 48000 Hz, stereo
FPS 29.97
No Fields: Progressive Scan
File extension: .MTS (my Mac finder can't read these files, but they are read in Premiere)
Image Size: 1920 x 1080
Frame Rate: 29.97
Source Audio Format: 48000 Hz - compressed - 6 channels
Pixel Aspect Ratio: 1.0
Upper Field First
I am using Adobe Premiere CS 6.0.2
Encore 6.0.1
Media Encoder 6.0.2.81
I am running it on an iMac 27-inch, Mid 2011
with Mac OS X Lion 10.7.5
Processor 3.4 GHz Intel Core i7
Graphics AMD Radeon HD 6970M 1024 MB
I've just been setting the sequence to match the .MOV files since they look much better than the .MTS files. I've done the opposite as well, setting the sequence to match the .MTS files and it doesn't seem to help. I've also changed the field order of the files once they are in the sequence by changing the field options and have tried converting the .MTS files in the Media Encoder, but nothing I've done has worked.
Any help would be so appreciated! The client I have is a photographer, so she wasn't aware of this issue when she first shot these videos. So I have 10 videos with these issues I need to get back to her, hopefully issue free! I'm struggling as an editor because my last job I was using FCP and was working with videographers who knew what they were doing, so I've never faced such problems before. Plus I'm new to the Adobe software. Not a good combination. Please forgive me if I didn't give all the information you need. I will happily respond with whatever more information you may need to help me out!
~KTrouperI wonder if you could do your edit ignoring any visual issues of the interlaced footage but keeping the different sources separate ( checkerboard edit Vid 1/ Vid 2 )
Lock it down then export the interlaced part of the edit as a Digital Intermediate.
Maybe Export the other source as well to the same codec. DI
Bring them back together in a New Sequence. You wold have to deal with the black spacing. -
DB proc - do you need to create a table to pass a ref cursor record type?
I want to pass a limited selection of columns from a large table through a DB procedure using a REF CURSOR, returning a table rowtype:
CREATE OR REPLACE package XXVDF_XPOS_DS021_ITEMS AS
TYPE XXVDF_XPOS_DS021_ITEM_ARRAY
IS REF CURSOR
return XXVDF_XPOS_DS021_ITEM_TABLE%ROWTYPE;
Do I need to create this dummy table?
I can't get a TYPE to work, where the type is an OBJECT with the desired columns in it.
So a dummy empty table will sit in the database...
Is there another way?
thanks!You can use RECORD type declaration:
SQL> declare
2 type rec_type is record (
3 ename emp.ename%type,
4 sal emp.sal%type
5 );
6 type rc is ref cursor return rec_type;
7 rc1 rc;
8 rec1 rec_type;
9 begin
10 open rc1 for select ename, sal from emp;
11 loop
12 fetch rc1 into rec1;
13 exit when rc1%notfound;
14 dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
15 end loop;
16 close rc1;
17 end;
18 /
SMITH 800
ALLEN 1600
WARD 1250
JONES 2975
MARTIN 1250
BLAKE 2850
CLARK 2450
SCOTT 3000
KING 5000
TURNER 1500
ADAMS 1100
JAMES 950
FORD 3000
MILLER 1300or use, for example, VIEW to declare rowtype:
SQL> create view dummy_view as select ename, sal from emp;
View created.
SQL> declare
2 type rc is ref cursor return dummy_view%rowtype;
3 rc1 rc;
4 rec1 dummy_view%rowtype;
5 begin
6 open rc1 for select ename, sal from emp;
7 loop
8 fetch rc1 into rec1;
9 exit when rc1%notfound;
10 dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
11 end loop;
12 close rc1;
13 end;
14 /
SMITH 800
ALLEN 1600
WARD 1250
JONES 2975
MARTIN 1250
BLAKE 2850
CLARK 2450
SCOTT 3000
KING 5000
TURNER 1500
ADAMS 1100
JAMES 950
FORD 3000
MILLER 1300 Rgds. -
Needs Advice on Record Type and Views!!!
Hello all,
I have a package that returns a record type based on some arguments. I have a view that wants use a column from that record type. Obviously, I cannot call the package from the view.
I started looking into objects type, maybe use it instead of record type so that I can create a table on the object type and then use my object type table in my view. The problem is, I still have to call my package and passed the arguments to get the right data.
Could any of you help me direct me on how to deal with this kind of issues? I have also looked into member funtion but not sure. I am aware that I can write a function by itself and use the function in my view. But I was thinking in more of lines of completeness of my code that can serve all my needs, if possible.
A reply will be appreciated. Thank you.I read about Panasonic AG-DVX 100 Cam that shoot in 24f and before its print in FCP, the pull down takes it to 29f.
And the Sony i believe shoot near enough the same as the Panasonic.
So if that's the case would the conversion of FCP for the pull down come out alright, there is no point really in jumping to another Forum when the integration is with FCP!
Just need to get a cam that integrates well with FCP for a budget of under $4,000.00 and in the range of 29.97f,
Fr.BlayZay. -
Powerbook G4 10.4.11 won't start from hard drive . Tried repair, " Invalid sibling link,invalid B tree header, invalid map node,invalid record type,the volume needs to be repaired.Powerbook G4 10.4.11 won't start from hard drive . Tried repair, " The underlying task reported failure on exit (-9972).Invalid sibling link,invalid B tree header, invalid map node,invalid record type,the volume needs to be repaired.
The underlying task reported failure on exit (-9972).kauribill wrote:
" The underlying task reported failure on exit (-9972).Invalid sibling link,invalid B tree header, invalid map node,invalid record type,the volume needs to be repaired.
The underlying task reported failure on exit (-9972).
This is a directory issue that Disk Utility cannot fix. Although it manifests itself as a software issue sometimes it may be hardware based. See DiskUtility reports "Underlying task reported failure" when repairing avolume http://support.apple.com/kb/TS1901?viewlocale=en_US". You can try using a utility like TechTool Pro, Drive Genius or Disk Warrior to repair and replace the directory. Another option would be to use the Archive and Install feature to reinstall. If the problem returns after correction you may have a failing or failed HDD.
cornelius -
Need to join the two xml type output in plsql function
Hi,
I need to join the two xml type output in plsql function. Could you help me out?
Sample function:
function func_ret_stk return xmtype
xmloutput_stk xmtype;
xmloutput_desp xmtype;
begin
xmloutput_stk := --------;
xmloutput_desp :=---------;
return xmloutput_stk + xmloutput_desp;
end ;
Thanks in Advance,Hello,
this is the forum for the tool {forum:id=260}.
Please ask your question in {forum:id=157} or {forum:id=34}
Regards
Marcus -
Inventory Issue: Movement type 905 creating two records in BI.
Hello Experts,
We have a problem in Inventory scenario implemented in our system.After the month load completion in Snap shot Cube,we are getting quantity mismatch between BI and ECC values.I found out that there are records exist with movement type 905 creating problem.
we have only one record in ECC while there are two records exist in BI with one have reversal indicator on it and other does not have reversal indicator.Qty is same in both of the case ,also the record which have reversal indicator have Process key 100 while the record with out reversal indicator doesn't have any process key.And in further update from ODs ZMMDS104 to ICSNAP1 ,in update rule we are adding or subtracting on the basis of process key as per standard Inventory scenario implementation.
So am i right that this Movement type is creating problem ..?
Does any one faces this issue earlier...?
and if this is issue then how to resolve this ?
Please advice as soon as possible as it becomes a high priority issue in client space.
Thanks in Advance
Regards,
Yash Raj.Hi Aduri,
Thanks for the quick reply.
I ma new to inventory field,can you please guide me how to check your advice details in the system like you
said "Recheck the Reversal Indicated Qty because if it has reverse indicator it should come from ECC or from ODS Check the Same at Change Log Table to trace the Changes."
What do you mean by "or from ODS" do you mean that ODS could create this entry ..? also this ODs ZMMDS104 is got daily loaded by delta from 2lis_03_bf . but this record is related to period 12/2008.and now we are in period 1/2009 (as i am trying to reconciling the data for last period) so i Guess there is no chance to find out this entry in change log.
Also "Try to see at DS field for the Process Key/Movement type with Reverse Indicator At ECC. "
How to check the same in data source?
Also "If you don't have the Reverse postings at ECC without process Key then you can report on the same to the Functional Team/Client. But before that make sure that you have reverse postings without process key assigned to it."
I checked in the ECC system(RSA3) There is only one record exist in for that material document it has positive quantity and material movement type 905 with movement indicator L.
Waiting for your response.
Thanks once again
Regards,
Yash Raj -
PL/SQL Passing record type between two procedures
I have a package and package body as following
My problem is I forgot the syntax to pass the record type between the two procedure.?????
CREATE OR REPLACE PACKAGE Standby_Schedules_Disp
AS
PROCEDURE Get_schedule (test1 OUT VARCHAR2);
PROCEDURE get_test (my_test REF my_sched); DOESN'T WORK?????
END Standby_Schedules_Disp;
CREATE OR REPLACE PACKAGE BODY Standby_Schedules_Disp
AS
PROCEDURE Get_schedule (test1 OUT VARCHAR2)
AS
temp NUMBER;
TYPE my_sched IS RECORD ( my_name VARCHAR2(30) := NULL,
my_age NUMBER := 0);
who_I_am my_sched;
Get_test(my_sched);
BEGIN
test1 := 'aaaaa';
who_i_am.my_name := 'Matthew';
END get_schedule;
PROCEDURE get_test (my_test REF my_sched) DOESN'T WORK?????
AS
BEGIN
END;
END Standby_Schedules_Disp;
/Youv'e declared the my_sched type within the scope of the Get_schedule procedure - it's not visible to the get_test procedure. You have declare the type in the package body if it's only used internally within the package or in the package spec if it can be referenced outside the package:
CREATE OR REPLACE PACKAGE [BODY] Standby_Schedules_Disp
AS
TYPE my_sched IS RECORD (
my_name VARCHAR2(30) := NULL,
my_age NUMBER := 0);I don't understand what you are trying to do with the REF keyword in this context. Having declared the type, you can use it as normal in a parameter spec:
PROCEDURE get_test (my_test IN [OUT] my_sched);You're also trying to call get_test within the declaration section of a program, which you can't do, and get_test also contains no executable code, which is not allowed in PL/SQL. -
Handling two record strucutre in incoming file adapter
I have a flat file (fixedlength type), which needs to be converted into the XMLPayload I tried multiple option but didn't work. Here is the file strucutre
P CONTRLT00010 01SCNCTCFSCR 001548340 12 130*
P CONTRLT00020 5 006
P CONTRLT00010 01SCNCTCFSCR 001548340 12 400 *
P CONTRLT00020 011
P CONTRLT00010 01SCNCTCFSCR 001548340 12 800 *
P CONTRLT00020 030
P CONTRLT00010 01SCNCTCFSCR 001548340 12 3200 *
P CONTRLT00020 350
P CONTRLT00010 01NCGRTCFSCR 004824269 12 176*
P CONTRLT00020 7 006
So this file has two record strucutre, I created the Datatypes with following strucutre
DT_TYPE
RECORD_SET1
FIELD1
FIELD2
RECORD_SET2
FIELD1
FIELD2
In the file adapter, I marked the recordsetignore true. and defined the following parameters
RECORD_SET1.fieldFixedLengths 1,8,6,1,1,6,6,1,1,10,15,2,6,7,1,4,7
RECORD_SET1.endSeparator 'nl'
RECORD_SET1.fieldNames KEY,PRGOGRAM_LITERAL,TASK_NUMBER,FILLER,COMM_CANCEL,COMPANY_NUMBER,PROGRAM_FIELD,CODE1,CODE2,KEY_FIELD,ADDITIONAL_KEY,CARD_CODE12,REGULAR_HOURS12,REGULAR_RATE12,OT_CODE12,OT_HOURS12,CONTINUATION_IND
RECORD_SET2.fieldFixedLengths 1,8,6,1,4,6,4,4,4,4,10,3,1,6,2,5,1,1,7
RECORD_SET2.endSeparator 'nl'
RECORD_SET2.fieldNames KEY,PRGOGRAM_LITERAL,TASK_NUMBER,FILLER,OT_HOURS12,OT_RATE12,CONTROL12_3,CONTROL12_4,CONTROL12_5,CONTROL12_6,FUNCTION12,HED_NBR_12,TAX_TYPE12,LOCAL_CODE12,STATE_CODE12,PERIOD_DATE12,SHIFT12,DEDUCTION_CYCLE12,ENDO_OF_FORM_IND
ignoreRecordSetName true
RECORD_SET1.keyFieldValue 1
RECORD_SET2.keyFieldValue 2
RECORD_SET1.keyFieldInStructure ignore
RECORD_SET2.keyFieldInStructure ignore
RECORD_SET2.missingLastfields
RECORD_SET1.missingLastfields
On the adapter end its not reading the message and thrwoing the warning
Channel CC_TCFSCR_SENDER: Converted complete file content to XML format.
2009-07-30 13:21:26 Warning Channel CC_TCFSCR_SENDER: Empty document found - proceed without sending message.
Any pointer will be helpful.
Thanks,
SamirHi,
You are mentioning the wrong keyfield values i beleive.
RECORD_SET1.keyFieldValue 1 --- > on place of 1 enter the exactvalue which you want to use as key field.
RECORD_SET2.keyFieldValue 2 --- > same apply here.
As adapter is unable to find 1 or 2 in as keyfield in record its sending the empty document.
Try :
RECORD_SET1.keyFieldValue = P CONTRLT00010
RECORD_SET1.keyFieldValue = P CONTRLT00020
I hope his might help u.
Thanks. -
How does a record type and table type works
Hi,
How a record type and table type work for the ref cursor,
below i m giving an example but its giving me errors
can any one help me for this?
declare
type empcurtyp is ref cursor;
type rectype is record (veid t.emp_id%type, vename t.ename%type);
TYPE tabtype IS TABLE OF rectype;
empcv empcurtyp;
vtab tabtype;
begin
open empcv for select emp_id,ename from t;
loop
fetch empcv into vtab;
exit when empcv%notfound;
dbms_output.put_line(vtab.vename||vtab.veid);
end loop;
close empcv;
end;
here we hav table t and i m taking only two fields of the table t which r emp_id and ename.Hi,
What errors are you getting with this? From experience you don't need a loop to put the records into the ref cursor its usually done on block.
HTHS
L :-) -
Hi! I need to work with a Record Type in one of my functions.
I have two questions:
1) In my error handler, how do I return an empty record type
and
2) In the calling procedure, how do I evaluate whether or not my record type contains values.
Any help is greatly appreciated.
Thanks!
~ChristineHi! I need to work with a Record Type in one of my
functions.
I have two questions:
1) In my error handler, how do I return an empty
record type
and
2) In the calling procedure, how do I evaluate
whether or not my record type contains values.
Any help is greatly appreciated.
Thanks!
~ChristineHi,
You can't test if a record is "atomically" NULL. You have two choices:
1- if one of the fields has a not null constraint then you can test using this field.
2- Otherwise, you can use an indicator out parameter that tells you if there is a value or nothing in the record.
Michel -
Two Leave type update in same date
Dear All.
Company has given 0.5 day special leave for all saff employees on 30th April 2010. This can be done via updating Special leave type for 0.5 day but if employee not attend to work on the particular date (30.04.2010) he will get half day loss of pay. to avoid this problem, i need to update 2 leave types to cover the full day. now system will not accept to enter 2 leave types.
pls. let me know if it is possible to enter 2 leave types for same date through configuration.
Thanks,
Dinesh.Hi Dinesh,
This can be done after doing necessary changes in configuration.
You need to change the "Time Constraint Class". Time Constraint Classes are stored in Table "T_554Y_B".
There you have to change the "Reaction Indicators" for the particular Infotype - Leave Grouping - 02, which you have entered in "Determine Entry Screens and Time Constraint Classes" node configuration.
Select "W". It allows you to create two records on the same day, with warning message. You can see old record & current record.
Then your issue will be resolved.
Regards
Venu -
Pl/Sql for creating Multiple record type file
Hi all,
I have a scenario where I need to create a flat file that contains two different record types in the same file. Basically, a way of getting both the header record and the corresponding detail records. Following are the details:
Table A (Header Records)
"REC_TYPE" "M_ID" "DATE" "*C_ID*"
1 123 090807 *222*
1 345 090907 *333*
Table B (Detail Records)
"REC_TYPE" "A_NO" "LINE_NO" "*C_ID*"
2 7564 1 *222*
2 4535 2 *222*
2 4656 1 *333*
2 6576 2 *333*
In the output file, the resultset should be as:
222, 123, 090807 (Header Record)
*222, 7564, 1* (Detail Record)
*222, 4535, 2* (Detail Record)
333, 345, 090907 (Header Record)
*333, 4656, 1 (Detail Record)*
*333, 6576, 2 (Detail Record)*
Any input is greatly appreciated.
Thank you!NOT TESTED ! Don't remember when I used loops for the last time. I won't have database access until september (on vacation).
declare
type header_t is record
c_id ... ,
type detail_t is record
c_id ... ,
header_r header_t;
detail_r detail_t;
cursor c_h is select c_id, ...
from ...
order by 1; -- header cursor
cursor c_d is select c_id, ...
from ...
order by 1; -- detail cursor
end_line varchar2(2) := chr(13) || chr(10); -- chr(10) to be used for non Windows
a_separator varchar2(1) := ',';
a_buffer varchar2(32767);
l_buffer constant number := 32767;
f_handle utl_file.file_type;
procedure buffer_put(p_line in varchar2) is
begin
if length(a_buffer) + length(p_line) < l_buffer then
a_buffer := a_buffer || p_line;
else
utl_file.put(f_handle,a_buffer);
a_buffer := p_line;
end if;
end;
function build_header_record(p_record in header_t) return varchar2 is
retval varchar2(4000) := '';
begin
retval := retval || to_char(p_record.c_id) || a_separator;
retval := retval || ... || a_separator;
retval := retval || ... || end_line;
return retval;
end;
function build_detail_record(p_record in detail_t) return varchar2 is
retval varchar2(4000) := '';
begin
retval := retval || to_char(p_record.c_id) || a_separator;
retval := retval || ... || a_separator;
retval := retval || ... || end_line;
return retval;
end;
begin
f_handle := utl_file.fopen ('THE_DIRECTORY','the_file.ext','w',l_buffer);
open c_h;
open c_d;
loop
fetch c_h into header_r;
exit when c_h%notfound;
buffer_put(build_header_record(header_r));
if c_h%rowcount > 1 and (header_r.c_id = detail_r.c_id) then
buffer_put(build_detail_record(detail_r));
end if;
loop
fetch c_d into detail_r;
exit when c_d%notfound or (detail_r.c_id != header_r.c_id);
buffer_put(build_detail_record(detail_r));
end loop;
end loop;
if length(a_buffer) > 0 then
utl_file.put(f_handle,a_buffer);
end if;
utl_file.fflush(f_handle);
utl_file.fclose(f_handle);
end;Regards
Etbin
utl_file.fclose(f_handle); instead of utl_file.fclose;
Edited by: Etbin on 11.8.2009 8:54 -
Passing record type into function [error: identifier must be declared]
Hi,
I have a record type defined in my procedure
type chk_tab is record(
effect date,
count number(9)
type chk_typ is table of chk_tab index by binary integer;
chk_typ_rec chk_typ;
I have to pass the effect and count into another function, i tried doin as below:
function name: func_chk_typ
func_chk_typ(effect, count);
this returns an saying "identifier effect needs to be declared"
I am required to pass these values from the record type into the function, How can i over come this??
Any help is very much appreciated.Hi Hemz,
Find below code.
Function Code:
CREATE OR REPLACE FUNCTION fetch_band(eff in date,ineff in date)
return number
is
lu_cb_sysid NUMBER;
BEGIN
select fk_cb_sysid
into lu_cb_sysid
from ia_for_icon
where cr_ans_date >= eff
and cr_ans_date < ineff;
RETURN lu_cb_sysid;
END fetch_band;Procedure code. Here I have embedded the function.
CREATE OR REPLACE procedure abc(a varchar, b number) is
type cns_tab_record is record(
eff date,
ineff date);
type cns_tab_typ is table of cns_tab_record index by binary_integer;
cns_tab cns_tab_typ;
v_lu_cb_sysid NUMBER;
BEGIN
-- Here you have to assign the values to your table type record.
-- For example I am passing two values SYSDATE and SYSDATE - 10
cns_tab(1).eff := SYSDATE;
cns_tab(1).ineff := SYSDATE - 10;
v_lu_cb_sysid:= fetch_band(cns_tab(1).eff, cns_tab(1).ineff);
END abc;But I am just wondering why you are using table type datatype here.
Hope above code will help you.
Thanks,
Suri
Maybe you are looking for
-
Windows 8.1 version on HP Stream 7
Hello, there is Windows RT for mobile devices, not RTM and the Stream 7 definitely has Windows 8.1 with Bing not RT. Some Stream tablet owners have gotten the Windows 10 upgrade icon to appear and some haven't, there is a known problem with it and a
-
Is it possible to display an Alert when user clicks on the X on the browser
Hi Is it possible to display an Alert when user clicks on the X on the browser.I saw some threads regarding this mentioning about js.I want to do this ins the iProcurement module and dont wnat to make changes to each and every page. isn't there any g
-
How to get checkbox checked when sum equals a certain number
I have created a spreadsheet with 25 rows that will have numerical entries. How do I put in a checkbox that becomes checked once the sum of the numbers Un that row equals a certain number? Thanks in advance.
-
Can you create a template that has a header and footer to forms?
Can you create a template that has a header and footer to forms?
-
Anyone testing Leopard in a Lab environment? If so, see any support for mounting shared drive with DFS paths after AD authentication? Thanks.