Differnce between two types of declaration
Hi all,
TYPE number_x_x is table of number;
number_x number_x_x;
TYPE number_y_y is table of number index by binary_integer;
number_y number_y_y;
Can i know what is the difference between these two, and in what scenario's can i use each of them.
Thanks
There's a useful chart at SQL Snippets: PL/SQL Collections - Choosing the Right Collection Type which highlights the differences between nested tables and associative arrays and can help you decide which one is best for your needs. There's also some sample code for both types of collections in other pages under the "PL/SQL Collections" section.
HTH.
Joe Fuda
SQL Snippets
Similar Messages
-
Propagation between two type raw queues
Good day.
I want to enable propagation between two type raw queues -
according to documentation:
http://www.stanford.edu/dept/itss/docs/oracle/10gR2/server.102/b14257/aq_intro.htm#CHDCEFBD -
"+Propagation of Messages with LOBs+
+Large Objects can be propagated using Oracle Streams AQ using two methods:+
+* Propagation from RAW queues+
+* Propagation from object queues with LOB attributes+"
My example:
begin
DBMS_AQADM.create_queue_table(queue_table => 'SRC1_QT',queue_payload_type => 'RAW',multiple_consumers => true);
end;
begin
DBMS_AQADM.create_queue(queue_name => 'SRC1_Q',queue_table => 'SRC1_QT');
end;
begin
DBMS_AQADM.create_queue(queue_name => 'DST1_Q',queue_table => 'SRC1_QT');
end;
begin
DBMS_AQADM.start_queue(queue_name => 'SRC1_Q');
end;
begin
DBMS_AQADM.start_queue(queue_name => 'DST1_Q');
end;
declare
c number;
begin
dbms_aqadm.verify_queue_types(src_queue_name => 'SRC1_Q',dest_queue_name => 'DST1_Q',rc => c);
dbms_output.put_line(c);
end;
Last PL/SQL block returns
VQT: new style queue
+0+
Does it means that queues incompatible?Yes, it works - and I think dbms_aqadm.verify_queue_types shows wrong answer:
DECLARE
subscriber sys.aq$_agent;
BEGIN
subscriber := sys.aq$_agent('SRC1_SUBS', 'DST1_Q', NULL);
DBMS_AQADM.ADD_SUBSCRIBER(queue_name => 'SRC1_Q',
subscriber => subscriber);
END;
begin
dbms_aqadm.schedule_propagation(queue_name => 'SRC1_Q');
end;
DECLARE
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
message RAW(10000);
BEGIN
for i in 1..100 loop
message := utl_raw.cast_to_raw(to_char(i));
dbms_aq.enqueue(queue_name => 'SRC1_Q',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle);
end loop;
COMMIT;
END;
select QUEUE,MSG_STATE,COUNT(*) from AQ$SRC1_QT T group by QUEUE,MSG_STATE
QUEUE MSG_STATE COUNT(*)
DST1_Q READY 100
SRC1_Q PROCESSED 100
Edited by: i.k. on 10.05.2011 10:49
Edited by: i.k. on 10.05.2011 10:50 -
Payment Method split between two types (cash & credit)
I am looking for a way of splitting a customers payment between two methods in one sales order. For example, a customer purchases an item valued at $100. He wants to pay with $50 cash and put $50 on a credit card. Currently the payment method resides in the header of the sales order and only one can be selected. Is it possible to create a multi selection option, or to apply the payment method at the line item level?
Technically it should be possible to maintain a different payment term on the line item level in the sales documents. The field is stored in VBKD table and is also available at the line item level (although it's grayed out).
Such items would be split into 2 invoices though because it's not possible to have one invoice with two different payment terms.
Also if the payment method does not change the payment due date and other condition, then I wouldn't really bother at all. It's possible to post 2 partial payments against one invoice in FI, so why should SD side be even concerned about the methods? Unless, of course, there's something you're not telling... -
Hi All,
I want function module to get difference between two days. (billing date and delivery date).
So,can you help me out.
Regards,
Priya.Hi
HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
Also go through the link given below :
http://www.saptechies.com/abap-function-modules/
With Regards
Nikunj shah -
STO DIFFERNCE BETWEEN UB AND NB
HI all
can someone plz tell me the differnces between po type NB and UB
and y do we use UB for Intra Company and NB for Intercompany
where exactly is the contrl\ol
olz clarifyhi
UB: If the supplying plant and Receiving Plant belong to the same company code. then we use UB document type.
If you use own document type you should ensure transport control field.
NB : If the Supplying plant and Receiving plant belong to different company code then use document type NB.
difference : IF the company need billing document for stock transfer use NB document.
else use UB document for the stock transfer .
regards
murali -
Differnce between type f and type p?
Hi All,
What is the Differnce between type f and type p?
Regard,
MikeHi Mike
Differnce bw type F and type P:-
Packed numbers - type P
Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
You can use type P data for such values as distances, weights, amounts of money, and so on.
Floating point numbers - type F
The value range of type F numbers is 1x10*-307 to 1x10*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.
You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields are very similar to the actual machine code operations, while P fields require more support from the software. Nevertheless, you have to use type P data to meet accuracy or value range requirements.
C ---> character
D ---> date
P ---> packed
T ---> time
X ---> hexadecimal
I ---> integer.
N ---> Muneric.
Reward pts if help.
Regards
Deepanker -
As to the data type of the data type of the difference between two date type of datas
Hi,
I have a question about the data type of the difference between two date type of datas.
There are two date type of datas as:
SSHIPMENTS.RECEIVEDATETIME
SSHIPMENTS.PROMISEDATETIME
I try to use the following SQL Script in Oracle SQL*Plus as:
SELECT CASE
WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:00:00.000' THEN 'OnTime'
WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:30:00.000' THEN '60-89 Minutes'
ELSE '3+ Hours'
END
FROM SSHIPMENTS;
The error message of "Invalid Number" for the '000 01:30:00.000' happens.
I don't know if the data type of the interval is wrong.
Many Thanks,
CathySELECT CASE
WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss')) < '010000' THEN 'OnTime'
WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss'))< '000 01:30:00.000' THEN '60-89 Minutes'
ELSE '3+ Hours'
END
FROM SSHIPMENTS;
just try it out.. -
Inspection lot for Mvt type 311 between two storage location only
Hello all,
I want to create an inspection lot only whenever my material transfer between two particulars storage locations. e.g if i have multiple storage locations, then i need an inspection lot to be created whenever my material transferred from say X S.Loc to Y S.loc only. For other transfers i don't need to create an inspection lot even from Y to X.
For more clarity, suppose i have ten storage locations. i have also created one storage location for my Lab. So I want an inspection lot to be created only when my material transfer to my Lab storage location from any other storage location, not when i transfer from my LAB to any other S.Loc or between two S.Loc other than LAB.
I have activated inspection type 08 but it does not have a restricition on S.Loc.
So please suggest some solution for the same.Dear Amit
In this case what you can do is make a copy of 311 movement type, say Z11. Deactivate QM for 311 and activate QM for Z11
So whenever you want inspection lot to be created use Z11.
You can activate and deactivate QM in QCCO > Quality inspection > Inspection lot creation > inspection for goods movement
Regards
Gajesh -
I've been spending some time on 're-tuning' some of my OOP understanding, and I've come up against a concept that is confusing me.
Lets say I have two objects. A user object
and an account object.
Back to basics here, but each object has state, behaviour and identity (often referred to as an entity object).
The user object
manages behaviour purely associated with a user, for example we could have a login(credentials) method
that returns if successfully logged in or throws exception if not.
The account object
manages behaviour purely associated with a users account. For example we could have a method checkActive() that checks if the account is active. The account object checks if the account has an up-to-date subscription, checks if there are any admin flags added
which would make it inactive. It returns if checks pass, or throws exception if not.
Now here lies my problem. There is clearly a relationship between user and account,
but I feel that there are actually two TYPES of association to consider. One that is data driven (exists only in the data/state of the objects and the database) and one that is behaviour driven (represents an object call to methods of the associated object).
Data Driven Association
In the example I have presented, there is clearly a data association between user and account.
In a database schema we could have the following table:
USER_ACCOUNTS
id
user_id
When we instantiate the account and
load the database data into it, there will be a class variable containing user_id.
In essence, the account object
holds an integer representation of user through user_id
Behaviour Driven Association
Behaviour driven associations are really the dependencies of an object. If object A calls methods on object B there is an association going from A to B. A holds an object representation of B.
In my example case, neither the user object
nor the account object
depend on each other to perform their tasks i.e. neither object calls methods on the other object. There is therefore no behaviour driven association between the two and neither object holds an object reference to the other.
Question
Is the case I presented purely a case of entity representation? The association between user and account is
always present, but its being represented in different ways?
ie. the user entity
has an identity that can be represented in different forms. It can be represented as an object (the instantiated user object)
or as a unique integer from the users table in the databases.
Is this a formalised way of recognising different implementations of associations or have I completely lost my mind?
One thing that bugs me is how would I describe the differences in UML or similar? Or is it just an implementation detail?It s a bit hard to fully understand what is problem actually in :). I think you are a bit mixing some concepts.
Entities representation
At first, all models we are implementing is just a simplification of some real-world objects and environment. Your conceptual entity user corresponds to some real user and contains some attributes we are intresteing in according to application needs. Thus there
are some models we have to implement.
Thus, all user defined by DB schema, user defined by class, and probably user defined by some presentation logic is normally present some real-world user. It is only about implementation purposes, we have to store, view and manipulate with user.
On the other hand let's take a look on Single Responsibility Principle. It tells us to use every class or program unit just for certain needs. Using single user (class or program unit) for storage and presentation needs violates this principles.
the user entity has an identity that can be represented in different forms. It can be represented as an object (the instantiated user object) or as a unique integer from the users table in the
databases.
So, the answer is yes.
Associations and dependencies
I think it is more about terminology than about nature of problem. But in general you are right - there are different types of object realtions (especially, I will use other terms to list it). For example "referencing", "creation", "using",
"coordinating", "storing", "inheriting" (!) ....
According to this, user instance references account instance. And A instance uses B instance.
For most cases it is good enough to distinguish just "referencing" and "using". It is what you've just written. It's enough common and abstract to be understood by other person when talking about domain, e.g.
But sometimes, to emphasize some aspects you should describe relations in a way like "A dispatches ensemble of Bs" or "R stores X to database". It's more applicable for specification and modelling.
Is this a formalised way of recognising different implementations of associations or have I completely lost my mind?
To call something formalized I suggest to look at UML.
UML and other modelling instruments
One thing that bugs me is how would I describe the differences in UML or similar? Or is it just an implementation detail?
There are a lot of UML models (diagrams). Let's take a look at most well-known - Classes and Objects Diagram.
It's interesting that UML allows to present all type of object relations, and moreover allows to decide "is it just an implementation detail".
Martin Fowler describes 3 levels (or point of views) of understanding of Classes Diagram.
Conceptual. Diagram is considered as high-level domain model, independent from implementation.
Specification. Diagram is considered as high-level realization model containing of interfaces.
Implementation. Diagram is considered as low-level technical paper containing interfaces, classes, references, other types of relations.
Is this a formalised way of recognising different implementations of associations or have I completely lost my mind?
Yes, you have to fix some point of view and choose appropriate relations set.
For example, let's take a look at Classes Diagram and consider it from an implementation point of view. UML defines 3 type of relations (and propose corresponding means to its designation):
Association
Association corresponds "referencing" between instances.
Dependency
Dependency combines all types of relations such as "using", "creating", "storing", etc.
Inheritance.
Inheritances as a fundamental OOP instrument is presented by UML in a distinct way. It's more about classes than about instances, but also one can say that A instance inherit attributes of B instance. So, that's ok.
First and second points of view on Class Diagram, as I remember uses only one type of relation unifying both associations and dependencies and is designated like association (no inheritance, of course).
Also, UML proposes Objects Diagram which is same to Classes Diagram, but fits better for runtime modelling needs.
Finally, a choice of a set of relations taken into consideration depends on a context and point of view. UML provides some ones. -
Spacing between two line types in smartform
I have data in two different line types as below
line type1
linetype2
but what my requirement is
line item1
line item2
i had tried by changing the smart style but it dint work. Please help me out in reducing the space between the datas of the line types.Hi
Go to your smartstyle.
Go to your paragran format.
Click on tab Indents and Spacing.There you will see a field named LINE SPACING.In that you can adjust the spacing between two lines.
Regards
Khushboo -
Unable to find line break between two lines in attachment file.
Dear all I will be very great full if someone help me out,
I am trying to send mail through SMTP server with an attachment of oracle report, but I am unable to find line break between two lines, when I down load the attachment from mail and open attach.txt file by double click on it. Next line starts right after previous line ends, it should starts with new line.
In order to send an attachment file, I am reading source file line by line and put MIME protocol’s attachment instance, contain of source file is being properly written into target file if I open that attachment on cmd prompt.
Following code may help you to understand the case.
Thanks in advance.
My code is as follows:-
create or replace procedure bec_file_test
v_subject varchar2, -- Subject of the email
v_body varchar2, -- Body of the email
v_from VARCHAR2 default 'XYZ.com', -- sender mail id
v_to varchar2 default 'XYZ.com', -- Field To of the email
v_cc varchar2 default 'XYZ.com' -- cc address
) is
-- variable to hold the smtp server connection
v_smtp_connection utl_smtp.connection;
-- variable to hold the smtp host name
v_smtp_host varchar2(100) default 'mail.bec-group.com';
-- variable to hold the smtp port
v_smtp_port number default 25;
-- composite of {CR}{LF} caridge return and line feed.
CRLF varchar2(2):=CHR(13)||CHR(10);
cursor pr_rec is
select requisition_no,line_no,release_no,a.contract,
a.project_id,substr(a.activity_seq,1,11)ACT_SEQ,
substr(a.part_no,1,12)PART_NO,
substr(a.description,1,32)DESCRIPTION,
substr(a.Bal_qty,1,8) BAL_QTY,
substr(a.unit_meas,1,5)UOM,
a.wanted_receipt_date WAN_REC_DT,
a.latest_order_date LAT_ORD_DT
from bec_pr_line_rep a
where a.Bal_qty>0 and a.header_state not in 'Closed'
and upper(a.state1) like 'RELEASED' and a.contract not in ('U1ENG','ULENG','U1FND','U2FND')
and a.buyer_code='70306'
order by a.part_no;
begin
declare
fHandle UTL_FILE.FILE_TYPE;
v_msg_line varchar2(2000);
-- v_buffer varchar2(20000);
--ALTER SYSTEM SET utl_file_dir = 'D:\Database\temp'
--COMMENT='Temporary change on Dec 14'
--SCOPE=SPFILE;
SELECT name, value
FROM gv$parameter
WHERE name = 'utl_file_dir';
--drop directory my_directory
--CREATE or replace DIRECTORY my_directory AS 'D:\database\temp';
--GRANT read,write ON DIRECTORY my_directory TO PUBLIC;
begin ---writing data into a file.
fHandle := UTL_FILE.FOPEN('MY_DIRECTORY', 'pending_pr_summry.txt', 'w');
UTL_FILE.put_line(fHandle, ' Pending PR to process (detail report)');
UTL_FILE.put_line(fHandle,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, 'Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt' );
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
for pr_temp in pr_rec loop
begin
v_msg_line:=to_char(rpad(pr_temp.requisition_no,12,' ')||'|'||
lpad(pr_temp.line_no,3,' ')||'|'||
lpad(pr_temp.release_no,3,' ')||'|'||
rpad(pr_temp.contract,7,' ')||'|'||
lpad(nvl(pr_temp.project_id,' '),7,' ')||'|'||
lpad(nvl(pr_temp.act_seq,' '),12,' ')||'|'||
lpad(pr_temp.part_no,12,' ')||'|'||
rpad(pr_temp.description,35,' ')||'|'||
lpad(pr_temp.bal_qty,10,' ')||'|'||
rpad(pr_temp.uom,6,' ')||'|'||
lpad(pr_temp.wan_rec_dt,14,' ')||'|'||
lpad(pr_temp.lat_ord_dt,14,' '));
UTL_FILE.put_line(fHandle,v_msg_line);
end;
end loop;
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, ' Regards : IFSAPP ( Application owner ) ');
UTL_FILE.FCLOSE(fHandle); ------------writing into file is successfuly done here!
--Reading of file starts here containt will be added in attchment file
fHandle :=UTL_FILE.FOPEN('MY_DIRECTORY','pending_pr_summry.txt','R' );
-- establish the connection to the smtp server
v_smtp_connection := utl_smtp.open_connection(v_smtp_host, v_smtp_port); /** OPEN CONNECTION ON THE SERVER **/
-- perform a handshake with the smtp server
utl_smtp.helo(v_smtp_connection, v_smtp_host); /** DO THE INITIAL HAND SHAKE **/
-- set the 'from' address of the message
utl_smtp.mail(v_smtp_connection, v_from);
-- add the recipient to the message
utl_smtp.rcpt(v_smtp_connection, v_to);
-- send the email
utl_smtp.open_data(v_smtp_connection);
v_msg_line:='Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || CRLF ||
'From: ' || v_from || CRLF ||
'Subject: ' || v_subject || CRLF ||
'To: ' || v_to || CRLF ||
'Cc: ' || v_cc || CRLF ||
'MIME-Version: 1.0'|| CRLF || -- Use MIME mail standard
'Content-Type: multipart/mixed;'||CRLF ||
' boundary="-----SECBOUND"'||CRLF||
CRLF ||'-------SECBOUND'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'Content-Transfer_Encoding: 7bit'|| CRLF ||
CRLF ||v_body|| CRLF; -- Message body
utl_smtp.write_data(v_smtp_connection,v_msg_line);
v_msg_line:='-------SECBOUND'|| CRLF ||
'Content-Type: application/octet-stream;'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'name="pending_pr_summry.txt"'|| CRLF ||
'Content-Transfer_Encoding: 8bit'|| CRLF ||
'Content-Disposition: attachment;'|| CRLF ||
' filename="pending_pr_summry.txt"'|| CRLF || CRLF; -- Content of attachment
utl_smtp.write_data(v_smtp_connection,v_msg_line);
-- check file is opened
IF utl_file.is_open(fHandle) THEN
-- loop lines in the file
LOOP
BEGIN -- Content of attachment
utl_file.get_line(fHandle,v_msg_line);
v_msg_line:=concat(v_msg_line,CRLF);
utl_smtp.write_data(v_smtp_connection,v_msg_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
END LOOP;
END IF;
--end of attachment containt
utl_smtp.write_data(v_smtp_connection,v_msg_line);
UTL_FILE.FCLOSE(fHandle);
utl_smtp.close_data(v_smtp_connection);
utl_smtp.quit(v_smtp_connection);
exception
when utl_smtp.invalid_operation then
dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
when utl_smtp.transient_error then
dbms_output.put_line(' Temporary e-mail issue - try again');
when utl_smtp.permanent_error then
dbms_output.put_line(' Permanent Error Encountered.');
when others then
dbms_output.put_line('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
RAISE;
end;
end bec_file_test;Pending PR to process (detail report)01-17-13 12:43:19 PM--------------------------------------------------------------------------------------------------------------------------------------------------Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt--------------------------------------------------------------------------------------------------------------------------------------------------MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade |500|kg |30-NOV-2012| 20-nov-2012MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012MAT/250606 | 2| |NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | |1|NMDCJ|6001|100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1|pkt | 25-DEC-2013| 14-dec-2013--------------------------------------------------------------------------------------------------------------------------------------------------
where as source file is like that:-
Pending PR to process (detail report)
01-17-13 12:43:19 PM
Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt
MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade | 5500|kg | 30-NOV-2012| 20-nov-2012
MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012
MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012
MAT/250606 | 2| 1|NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012
MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1 |pkt | 25-DEC-2013| 14-dec-2013
Ignore alignment. It is well formatted in source file. -
Create relation between two blocks which are based on different procedure
Hiii
How to create relation between two blocks which are based on different stored procedures in Oracle form??
Pradhyumn Sharmahiii,
I selected the common key deptno in both procedure.
I created a relation between both procedure. but when i compile the form it give an error in ON-CHECK-DELETE-MASTER. My procedure are
==================================
PACKAGE emp_pkg AS
TYPE emprec IS RECORD(
empno asg_emp.empno%type,
ename asg_emp.ename%type,
job asg_emp.job%type,
sal asg_emp.sal%type,
deptno asg_emp.deptno%type);
TYPE emptab IS TABLE OF emprec INDEX BY BINARY_INTEGER;
PROCEDURE empquery(block_data IN OUT emptab, p_deptno IN NUMBER);
end;
====================================
PACKAGE dept_rec IS
type rec is record(dname asg_dept.dname%type,
loc asg_dept.loc%type,
deptno asg_dept.deptno%type);
type deptrec is table of rec index by binary_integer;
PROCEDURE dept_rec1(block1 in out deptrec);
END;
===================================
In ON-CHECK-DELETE-MASTER
CURSOR BLOCK9_cur IS
SELECT 1 FROM dept_rec.dept_rec1 d
WHERE d.DEPTNO = :BLOCK6.DEPTNO;
identifier dept_rec.dept_rec1 must be declared.
Regards
Pradhyumn -
Differnce between AT NEW AND ON CHANGE OF
Hi,
Differnce between AT NEW AND ON CHANGE OF
Iam waiting foryour reply
Thanks & Regards
Raja Sekhar.THai Raja
check the following Documents
1. AT NEW f.
2. AT END OF f.
3. AT FIRST.
4. AT LAST.
5. AT fg.
Effect
In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs.
You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset.
The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted .
At the end of a control group ( AT END OF , AT LAST ), there are two types of control level information between AT and ENDAT :
If the sort key of the extract dataset contains a non-numeric field h (particularly in the field group HEADER ), the field CNT(h) contains the number of control breaks in the (subordinate) control level h .
For extracted number fields g (see also ABAP/4 number types ), the fields SUM(g) contain the relevant control totals.
Notes
The fields CNT(h) and SUM(g) can only be addressed after they have been sorted. Otherwise, a runtime error may occur.
The fields CNT(h) and SUM(g) are filled with the relevant values for a control level at the end of each control group ( AT END OF , AT LAST ), not at the beginning ( AT FIRST , AT NEW ).
When calculating totals with SUM(g) , the system automatically chooses the maximum field sizes so that an overflow occurs only if the absolute value area limits are exceeded.
You can also use special control break control structures with LOOP s on internal tables.
Variant 1
AT NEW f.
Variant 2
AT END OF f.
Effect
f is a field from the field group HEADER . The enclosed sequence of statements is executed if
the field f occurs in the sort key of the extract dataset (and thus also in the field group HEADER ) and
the field f or a superior sort criterion has a different value in the current LOOP line than in the prceding ( AT NEW ) or subsequent ( AT END OF ) record of the extract dataset.
Example
DATA: NAME(30),
SALES TYPE I.
FIELD-GROUPS: HEADER, INFOS.
INSERT: NAME INTO HEADER,
SALES INTO INFOS.
LOOP.
AT NEW NAME.
NEW-PAGE.
ENDAT.
AT END OF NAME.
WRITE: / NAME, SUM(SALES).
ENDAT.
ENDLOOP.
Notes
If the extract dataset is not sorted before processing with LOOP , no control level structure is defined and the statements following AT NEW or AT END OF are not executed.
Fields which stand at hex zero are ignored by the control break check with AT NEW or AT END OF . This corresponds to the behavior of the SORT statement, which always places unoccupied fields (i.e. fields which stand at hex zero) before all occupied fields when sorting extract datasets, regardless of whether the sort sequence is in ascending or descending order.
Variant 3
AT FIRST.
Variant 4
AT LAST.
Effect
Executes the relevant series of statements just once - either on the first loop pass (with AT FIRST ) or on the last loop pass (with AT LAST ).
Variant 5
AT fg.
Addition
... WITH fg1
Effect
This statement makes single record processing dependent on the type of extracted record.
The sequence of statements following AT fg are executed whenever the current LOOP record is created with EXTRACT fg (in other words: when the current record is a fg record).
Addition
... WITH fg1
Effect
Executes the sequence of statements belonging to AT fg WITH fg1 only if the record of the field group fg in the dataset is immediately followed by a record of the field group fg1 .
Basic form
ON CHANGE OF f.
Addition
... OR f1
Effect
Executes the processing block enclosed by the " ON CHANGE OF f " and " ENDON " statements whenever the contents of the field f change (control break processing).
Normally, you use the statement to manipulate database fields during GET events or SELECT / ENDSELECT processing.
Note
There are special control structures for processing control breaks in LOOP s on internal tables or extract datasets AT ).
ON CHANGE OF is unsuitable for recognizing control levels in loops of this type because it always creates a global auxiliary field which is used to check for changes. This global auxiliary field can only be changed in the relevant ON CHANGE OF statement. It is not reset when the processing goes into loops or subroutines, so unwanted effects can occur if the loop or subroutine is executed again. Also, since it is set to its initial value when created (like any other field), any ON CHANGE OF processing will be executed after the first test, unless the contents of the field concerned happen to be identical to the initial value.
Example
TABLES T100.
SELECT * FROM T100 WHERE SPRSL = SY-LANGU AND
MSGNR < '010'
ORDER BY PRIMARY KEY.
ON CHANGE OF T100-ARBGB.
ULINE.
WRITE: / '**', T100-ARBGB, '**'.
ENDON.
WRITE: / T100-MSGNR, T100-TEXT.
ENDSELECT.
Displays all messages with their numbers in the logon language, provided the number is less than '010'.
Each time the message class changes, it is output.
Addition
... OR f1
Effect
Also executes the code whenever the contents of the field f1 changes.
You can use this addition several times.
Example
Logical database F1S
TABLES: SPFLI, SFLIGHT, SBOOK.
GET SBOOK.
ON CHANGE OF SPFLI-CARRID OR
SPFLI-CONNID OR
SFLIGHT-FLDATE.
ULINE.
WRITE: /5 SPFLI-CARRID, SPFLI-CONNID,
5 SFLIGHT-FLDATE, SPFLI-FLTIME,
5 SFLIGHT-SEATSMAX, SFLIGHT-SEATSOCC.
ENDON.
WRITE: / SBOOK-CUSTOMID.
The code between ON CHANGE OF and ENDON is executed only if at least one of the fields SPFLI-CARRID , SPFLI-CONNID or SFLIGHT-FLDATE has changed, i.e. there is a different flight connection (which also has bookings).
Notes
Thanks & regards
Sreenivasulu P -
Date/hour diff between two date/timestamps - however dataype in DB is curr varchar
Hi All
Could someone please help me?
I would like the T-SQL statement for hours passed between two date/timestamps within a table
e.g
Login_Time
22/02/2014 11:03:12.925297 AM (Data type in DB is varchar(50))
Logout_Time
22/02/2014 11:19:01.701073 AM (Data type in DB is varchar(50))
Thank you KindlyDECLARE @dt AS VARCHAR(50)='22/02/2014 11:03:12.925297 AM'
DECLARE @dt1 AS VARCHAR(50)='22/02/2014 11:19:01.701073 AM'
SELECT DATEDIFF(hour,dt_from,dt_to) FROM
SELECT CAST(SUBSTRING(@dt,7,4)+ SUBSTRING(@dt,4,2)+SUBSTRING(@dt,1,2)+
SUBSTRING (@dt,11,17) AS DATETIME2) dt_from,
CAST(SUBSTRING(@dt1,7,4)+ SUBSTRING(@dt1,4,2)+SUBSTRING(@dt1,1,2)+
SUBSTRING (@dt1,11,17) AS DATETIME2) dt_to
) AS Der
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Differnce between exception_init and init_exception
I have declared an usernamed exception and wanted to call...
I came to know that these can be called by using two of the below -
Pragma Exception_init
Pragma Init_Exception
What is the differnce between[b] exception_init and init_exception ? And where they can be used ?
awating for your rresponse ..!Oracle Database 10g Enterprise Edition Release 10.2.0.3.0:
SQL>declare
2 my_exception exception;
3 pragma exception_init(my_exception, -20101);
4 begin
5 raise my_exception;
6 exception
7 when my_exception then
8 dbms_output.put_line(sqlerrm);
9 end;
10 /
ORA-20101:
PL/SQL procedure successfully completed.
SQL>declare
2 my_exception exception;
3 pragma init_exception(my_exception, -20101);
4 begin
5 raise my_exception;
6 exception
7 when my_exception then
8 dbms_output.put_line(sqlerrm);
9 end;
10 /
pragma init_exception(my_exception, -20101);
ERROR at line 3:
ORA-06550: line 3, column 11:
PLS-00127: Pragma INIT_EXCEPTION is not a supported pragma
Maybe you are looking for
-
Mute button doesn't work to put phone in standby mode, help??
I have a blackberry curve and the mute button will not work to put my phone in standby. It does work to mute a phone call, however. It has done this a couple of times, where it will work for awhile, and then stop working for awhile. I'm not sure i
-
So I ordered an Iphone 6 on back-order with a ship date October 17. My question is while there is a guarantee ship date, is there a real possibility that it could ship before that date?
-
Quicktime pro registration key fails to work
I tried to reinstall quicktime. I tried to ask apple support for a new key, or to find the defect in the key they gave me. After 48 hours I'm still waiting for a reply. The only thing I received until now was a confirmation of my order from my local
-
i went to Adobe Reader to download flash player for my Android phone and they are nolonger supporting android phones . what can i do? so that i can watch my email videos?
-
How do I programmatically find Program Files directory?
Do I need to use the Windows Registry? If so, where is it in the registry? I'm ultimately trying to find the Wordpad.exe file. I've been able to find where it's location is stored in the registry, but the location listed is relative to the Program Fi