Please help me in understanding relationships in SQL
This is according to
*"One-to-one relationships occur when there is exactly one record in the first table that corresponds to exactly one record in the related table."*
One-to-one relationships are single-valued in both directions.
My understanding with the above is that
Consider a Zip Table
ZipNo Studentname
12 Harry
13 Kiran
A Student Table
ID Name ZipNo
101 Harry 12
and there should not be any more student with zipno 12 . Then this will be a One to One
Am i right ?
Edited by: Jai7881 on Apr 20, 2009 5:12 AM
Hi,
what you have given is table design. as per your design is one to one table design. where is SQL is there.
thanks
Settu Gopal
Similar Messages
-
SQL*PLUS using START command - please help me to understand
Hello dear friends,
I met one issue that i can't understand. Could you please explain me what is wrong in my logic.
I have created sql file called DUMMY.sql
the file context is:
SELECT dummy
FROM dummy_tbl
WHERE dummy_col=&dummy_var;
I go to SQL*Plus DB version (10.2.0.4.0).
I promt command: START DUMMY 1
and expecting *&dummy_var* to be replaced with *1* and query be executed as it is described in Oracle SQL*PLUS reference ([http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch6.htm#sthref1058|http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch6.htm#sthref1058] ).
But instead i'm getting Enter value for dummy_var:
please help me to understand
thanks in advance.You need to use &1 instead of &dummy_var.
The number references the position of the parameter to use;&1 is the first parameter, &2 would be a second parameter and so on.
SELECT dummy
FROM dummy_tbl
WHERE dummy_col=&1; -
Please help me to understand Transaction option in SSIS container
Hi experts,
I am confused about Transaction option in SSIS container,
1. Required - Start the transaction. What is mean that start transaction?
2.Supported- join the transaction ..
can you please help me to understand.
ThanksI think Vaibhav already answered your question but here's more from my end.
1.
Package - Transaction Option - Supported
SEQC - Transaction Option - Supported
3 Execute SQL Tasks - Transaction Option - Supported
So, package / SEQC / SQL 1 / SQL 2 / SQL 3 doesn't involve in a transaction i.e. think of those tasks are not included in
BEGIN TRANSACTION / COMMIT TRANSACTION
Sequence Container
--Execute SQL Task 1
INSERT INTO dbo.t1 (a)
SELECT 10
--Execute SQL Task 2
INSERT INTO dbo.t1 (a)
SELECT 11
--Execute SQL Task 3
INSERT INTO dbo.t1 (a)
SELECT 'aa'
When we execute package, it will insert 10, 11 values into table dbo.t1 and since there's an error in the 3rd statement, it'll fail
2.
Package - Transaction Option - Required
SEQC - Transaction Option - Supported
3 Execute SQL Tasks - Transaction Option - Supported
Now, package will Start a transaction since it's Transaction Option is "Required" , so now the SEQC (3 Execute SQL tasks) will
be inside transaction / join the transaction because their transaction option is "Supported".
Package - Information: Starting distributed transaction for this container. --BEGIN TRANSACTION
(You'll see this statement in Processing / Execution Results tab)
SEQC
--Execute SQL Task 1
INSERT INTO dbo.t1 (a)
SELECT 21
--Execute SQL Task 2
INSERT INTO dbo.t1 (a)
SELECT 22
--Execute SQL Task 3
INSERT INTO dbo.t1 (a)
SELECT 23
Package - Information: Committing distributed transaction started by this container. -- COMMIT TRANSACTION
(You'll see this statement in Processing / Execution Results tab)
When we execute package, it will insert 21, 22, 23 values into table dbo.t1 and also you can see the START TRANSACTION /
COMMIT TRANSACTION in the Exection Results tab are at the Package Level and not at the Sequence Container level.
Without any change, if you change the value from 23 to 'aa' in the 3rd Execute SQL task then you'll see
Information: Aborting the current distributed transaction. statement in the 3rd Executed SQL Task in Execute Results tab
which is at the Sequence container / Execute SQL task 3 level and it's because their Transaction option is Supported and so they
joined the transaction
Please see the screenshot below that under Package, the START TRANSACTION but ABORT TRANSACTION is at Execute SQL task
level
3.
Package - Transaction Option - Supported
SEQC - Transaction Option - Required
3 Execute SQL Tasks - Transaction Option - Supported
Please see the screenshot below that under Sequence Container, the TRANSACTION has started. Since the the Sequence container's
parent (which is package) has not started any transaction and so the it started it's own transaction.
4.
Package - Transaction Option - Required
SEQC - Transaction Option - Required
3 Execute SQL Tasks - Transaction Option - Supported
See the screenshot below which is same as first screenshot.
Since Package's transaction property is set to "Required" and it's Parent to Sequence Container
and so package started the started the transaction, and though Sequence container's transaction option is "Required",
it will not start a new transaction rather it "joins" the transaction that was already opened by it's Parent (Package).
Now, if we see the definitions what Supported and Required means -
Supported - Specifies that this container will not start a transaction.
However, it will participate in a transaction if the parent container started one. This is the default. (4th Example)
Required - Specifies that this container will cause a new transaction to be started unless the parent container already has a transaction,
in which case, the parent’s transaction will be joined. (2nd and 3rd Examples)
Narsimha -
Please help me formulate this in PL/SQL - Thanks.
Hi ALL,
Please help me formulate this in PL/SQL. I really appreciate your help in advance. Below is the Specification.
Read Previous records
Check if this is a New Customer.
If New
Than check for New site
If New Site than Insert Site
End If
Insert Practice
Insert Customer
Check for Previous Months Balance for that Customer.
If there than (formula)
Else
set balance = 0
End if
Insert balance.
Thanks Much in adavance.Hi ALL,
Please help me formulate this in PL/SQL. I really appreciate your help in advance. Below is the Specification.
Read Previous records
Check if this is a New Customer.
If New
Than check for New site
If New Site than Insert Site
End If
Insert Practice
Insert Customer
Check for Previous Months Balance for that Customer.
If there than (formula)
Else
set balance = 0
End if
Insert balance.
Thanks Much in adavance. -
I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website
Here's two popup test sites.
http://www.kephyr.com/popupkillertest/test/index.html
http://www.popuptest.com/ -
Please help me in understanding hashcode()
I have some doubt with hashcode(), please help me in understanding.
As it is always advised that whenever you override equals() method, override even hashcode(). As equals() returns the equality of two objects i.e it returns whether two objects are equal or not. The hashcode(), returns int value, i.e if two objects are equal than both hashcode will be same.
Now my question is:
1. When equals() method is comparing 2 objects and returning whethere both are equal or not. Then why we need this hashcode().
2. When this hashcode(), is going to be call?
Please tell me Whatever I understood is right or not....rajalakshmi wrote:
2. When this hashcode(), is going to be call?
equals() method will implicitly call hashCode() method to compare objects.No it won't. Where did you get that?
Here is the actual code to Strings equals method
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
if (anObject instanceof String) {
String anotherString = (String)anObject;
int n = count;
if (n == anotherString.count) {
char v1[] = value;
char v2[] = anotherString.value;
int i = offset;
int j = anotherString.offset;
while (n-- != 0) {
if (v1[i++] != v2[j++])
return false;
return true;
return false;
}Now, where is hashCode called there? -
Please help me to understand what is the meaning of Acess point Channel utilization?
please help me to understand what is the meaning of Acess point Channel utilization? If i want to mange the capacity of my Office Wi-Fi network what are the factor i need to monitor.
Hi Ankit,
Channel Utilization
The 802.11, 802.11b, and 802.11g standards use the same 2.4 GHz band. All must interoperate with each other, which introduces additional overhead reducing channel throughput. Many sites already have products using the Wi-Fi 2.4 GHz band. Additionally, there are many other products that use the same 2.4 GHz frequencies as used by Wi-Fi. Other products include Bluetooth, cordless phones, video game controllers, surveillance cameras, and microwave ovens.
Before the installation of the Cisco Unified Wireless Network, a site can be tested for channel interference and utilization with tools from AirMagnet, Wild Packets, Cognio, and others. The Wireless Control System (WCS) AP On-Demand Statistics Display report provides a spectrum review of the following:
•Noise by channel
•Interference by channel
•Client count versus RSSI
•Client count versus SNR
•Channel radar detection versus time
You can further refer the following links,
https://supportforums.cisco.com/thread/2212228
https://supportforums.cisco.com/thread/334981
For design guide following link might help,
http://www.cisco.com/en/US/docs/solutions/Enterprise/Education/SchoolsSRA_DG/SchoolsSRA_chap5.html -
Please Help me to understand something : |
Subject:please Help me to understand something : |
hi there ,
so i know to create apps in flash cs5 , i downloaded the adobe air 2.6 and installed . i downloaded Flash Professional CS5 Update 11.0.2 and Flash Professional CS5 Update for iOS
10/11/2010.
i read in adobe air 2.6 that it possible to make multitasking .
2 questions :
1.
it possible to make multitasking in flash cs5 ( open apps on iphone , click on home button and when you come back , apps not restat ) ?
i mean play sound in my apps , and when you click on the home button the sound stay played.
2.
adobe air , when i installed it , it work on flash cs5 auto? i need to change somthing?
in bigger , how i make multitasking in flash cs5?
please help me
thank youNot sure what you mean by the second question, but the answer your first; yes, air 2.6 allows for multitasking. You don't have to do anything to get this to work, it is setup by default.
-
Please help me to tune this PL/SQL...
Hi everyone,
I have a SQL query which runs ok when i run it individually but the same query if
i use it in a procedure.The procedure is hanging up.Could someone please help to tune this
SQL query and please check my procedure why is it hanging up.
SQL Query
=========
SELECT active_members.member_nbr,
active_members.name_last,
active_members.name_first,
active_members.name_middle,
active_members.dob,
active_members.sex,
active_members.subsciber_nbr,
active_members.ssn,
active_members.name_suffix,
active_members.class_x,
active_members.aff_nbr,
CASE
WHEN TRIM(active_members.class_x) = 'SE' THEN
(SELECT DISTINCT(mssp.member_nbr)
FROM member_span mssp
WHERE SUBSTR(mssp.member_nbr, 1, 9) = SUBSTR(active_members.member_nbr, 1, 9)
AND mssp.class_x = 'SP'
AND rownum = 1)
WHEN TRIM(active_members.class_x) = 'SP' THEN
(SELECT DISTINCT(mssp.member_nbr)
FROM member_span mssp
WHERE SUBSTR(mssp.member_nbr, 1, 9) = SUBSTR(active_members.member_nbr, 1, 9)
AND mssp.class_x = 'SE'
AND rownum = 1)
ELSE
NULL
END)
spouse_member_nbr,
active_members.division_nbr,
active_members.ymdeff,
active_members.ymdend,
active_members.actual_ymd_enddt,
active_members.email_id,
active_members.network_id,
active_members.insurance_company_code,
active_members.cob_flag,
active_members.vip_flag,
active_members.pre_x_flag,
active_members.region,
active_contracts.language_x,
active_contracts.corp_nbr,
active_members.group_nbr,
active_members.non_erisa_status
FROM
(SELECT mb_active.member_nbr,
mb_active.contract_nbr,
mb_active.name_last,
mb_active.name_first,
mb_active.name_middle,
ms_active.ymdeff,
ms_active.ymdend,
to_char(to_date(
CASE
WHEN LENGTH(mb_active.ymdbirth) = 8 THEN mb_active.ymdbirth
ELSE NULL
END, 'YYYYMMDD'), 'MM/DD/YYYY') dob,
mb_active.sex,
to_char(to_date(ms_active.ymdeff, 'YYYYMMDD'), 'MM/DD/YYYY') ymdeff_formatted,
to_char(to_date(ms_active.ymdend, 'YYYYMMDD'), 'MM/DD/YYYY') ymdend_formatted,
ms_active.void,
CASE
WHEN SUBSTR(mb_active.member_nbr, 10, 2) = '00' THEN mb_active.member_nbr
ELSE SUBSTR(mb_active.member_nbr, 1, 9) || '00'
END) subsciber_nbr,
mb_active.ssn,
mb_active.name_suffix,
ms_active.class_x,
ms_active.aff_nbr,
ms_active.division_nbr,
CASE
WHEN TRIM(ms_active.ymdend) = '99991231' THEN NULL
ELSE to_char(to_date(ms_active.ymdend, 'YYYYMMDD'), 'MM/DD/YYYY')
END) actual_ymd_enddt,
CASE
WHEN TRIM(ms_active.business_unit) = '01' THEN ms_active.business_unit || '-' || ms_active.prog_nbr
WHEN TRIM(ms_active.business_unit) = '03' THEN ms_active.business_unit || '-' || ms_active.prog_nbr || '-' || ms_active.carrier
ELSE NULL
END) network_id,
ms_active.business_unit || '-' || ms_active.prog_nbr || '-' || ms_active.carrier insurance_company_code,
(SELECT DISTINCT(email)
FROM dbo.av_mem_email
WHERE dbo.av_mem_email.member_nbr = mb_active.member_nbr
AND rownum = 1)
email_id,
mb_active.lr_response cob_flag,
mb_active.record_nbr vip_flag,
ms_active.pre_exist pre_x_flag,
ms_active.region region,
ms_active.group_nbr,
CASE
WHEN
(SELECT TRIM(div.div_status)
FROM division div
WHERE TRIM(div.division_nbr) = TRIM(ms_active.division_nbr)) = 'NULL' THEN
'Y'
ELSE
'N'
END)
non_erisa_status
FROM member mb_active,
member_span ms_active
WHERE mb_active.member_nbr = ms_active.member_nbr
AND(20090707 BETWEEN ms_active.ymdeff
AND ms_active.ymdend
AND TRIM(ms_active.void) IS NULL
active_members,
(SELECT DISTINCT(contract.contract_nbr),
contract.language_x,
contract_span.corp_nbr
FROM contract,
contract_span
WHERE contract.contract_nbr = contract_span.contract_nbr
AND(20090707 BETWEEN contract_span.ymdeff
AND contract_span.ymdend)
AND TRIM(contract_span.void) IS
NULL)
active_contracts
WHERE TRIM(active_members.contract_nbr) = TRIM(active_contracts.contract_nbr);
Taking around 6 minute to run and it returns """"268267"""" records
Explain Plan for the above SQL:
===============================
"PLAN_TABLE_OUTPUT"
"Plan hash value: 379550299"
"| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |"
"| 0 | SELECT STATEMENT | | 2609K| 659M| | 91679 (3)| 00:18:21 |"
"| 1 | HASH UNIQUE | | 1 | 16 | | 54461 (2)| 00:10:54 |"
"|* 2 | COUNT STOPKEY | | | | | | |"
"|* 3 | TABLE ACCESS FULL | MEMBER_SPAN | 12891 | 201K| | 54459 (2)| 00:10:54 |"
"| 4 | HASH UNIQUE | | 1 | 16 | 2424K| 54736 (2)| 00:10:57 |"
"|* 5 | COUNT STOPKEY | | | | | | |"
"|* 6 | TABLE ACCESS FULL | MEMBER_SPAN | 51541 | 805K| | 54459 (2)| 00:10:54 |"
"| 7 | HASH UNIQUE | | 1 | 50 | | 64 (4)| 00:00:01 |"
"|* 8 | COUNT STOPKEY | | | | | | |"
"|* 9 | TABLE ACCESS FULL | AV_MEM_EMAIL | 1 | 50 | | 63 (2)| 00:00:01 |"
"|* 10 | TABLE ACCESS FULL | DIVISION | 1 | 14 | | 3 (0)| 00:00:01 |"
"|* 11 | HASH JOIN | | 2609K| 659M| | 91679 (3)| 00:18:21 |"
"| 12 | VIEW | | 581 | 12782 | | 8184 (4)| 00:01:39 |"
"| 13 | HASH UNIQUE | | 581 | 26145 | | 8184 (4)| 00:01:39 |"
"| 14 | TABLE ACCESS BY INDEX ROWID| CONTRACT | 1 | 14 | | 2 (0)| 00:00:01 |"
"| 15 | NESTED LOOPS | | 581 | 26145 | | 8183 (4)| 00:01:39 |"
"|* 16 | TABLE ACCESS FULL | CONTRACT_SPAN | 581 | 18011 | | 7019 (5)| 00:01:25 |"
"|* 17 | INDEX RANGE SCAN | CONTRACT_IX1 | 1 | | | 1 (0)| 00:00:01 |"
"|* 18 | HASH JOIN | | 449K| 104M| 39M| 83466 (2)| 00:16:42 |"
"|* 19 | TABLE ACCESS FULL | MEMBER_SPAN | 449K| 34M| | 54964 (3)| 00:11:00 |"
"| 20 | TABLE ACCESS FULL | MEMBER | 1436K| 221M| | 14664 (2)| 00:02:56 |"
"Predicate Information (identified by operation id):"
" 2 - filter(ROWNUM=1)"
" 3 - filter(SUBSTR("MSSP"."MEMBER_NBR",1,9)=SUBSTR(:B1,1,9) AND "MSSP"."CLASS_X"='SP')"
" 5 - filter(ROWNUM=1)"
" 6 - filter(SUBSTR("MSSP"."MEMBER_NBR",1,9)=SUBSTR(:B1,1,9) AND "MSSP"."CLASS_X"='SE')"
" 8 - filter(ROWNUM=1)"
" 9 - filter("AV_MEM_EMAIL"."MEMBER_NBR"=:B1)"
" 10 - filter(TRIM("DIV"."DIVISION_NBR")=TRIM(:B1))"
" 11 - access(TRIM("MB_ACTIVE"."CONTRACT_NBR")=TRIM("ACTIVE_CONTRACTS"."CONTRACT_NBR"))"
" 16 - filter("CONTRACT_SPAN"."YMDEFF"<=20090707 AND TRIM("CONTRACT_SPAN"."VOID") IS NULL AND "
" "CONTRACT_SPAN"."YMDEND">=20090707)"
" 17 - access("CONTRACT"."CONTRACT_NBR"="CONTRACT_SPAN"."CONTRACT_NBR")"
" 18 - access("MB_ACTIVE"."MEMBER_NBR"="MS_ACTIVE"."MEMBER_NBR")"
" 19 - filter(TRIM("MS_ACTIVE"."VOID") IS NULL AND "MS_ACTIVE"."YMDEFF"<=20090707 AND "
" "MS_ACTIVE"."YMDEND">=20090707)"
SAME SQL IN A PROCEDURE..IT IS HANGING UP
========================================
create or replace PROCEDURE TEST_CURRENT_PCP_SPAN is
EXTRACTED_STRING VARCHAR2(32767);
FILEHANDLER UTL_FILE.FILE_TYPE;
test_str varchar2(100);
pcp_eff_date number(10);
file_name varchar2(50);
CURSOR MEMBERS
IS
SELECT active_members.member_nbr,
active_members.name_last,
active_members.name_first,
active_members.name_middle,
active_members.dob,
active_members.sex,
active_members.subsciber_nbr,
active_members.ssn,
active_members.name_suffix,
active_members.class_x,
active_members.aff_nbr,
CASE
WHEN TRIM(active_members.class_x) = 'SE' THEN
(SELECT DISTINCT(mssp.member_nbr)
FROM member_span mssp
WHERE SUBSTR(mssp.member_nbr, 1, 9) = SUBSTR(active_members.member_nbr, 1, 9)
AND mssp.class_x = 'SP'
AND rownum = 1)
WHEN TRIM(active_members.class_x) = 'SP' THEN
(SELECT DISTINCT(mssp.member_nbr)
FROM member_span mssp
WHERE SUBSTR(mssp.member_nbr, 1, 9) = SUBSTR(active_members.member_nbr, 1, 9)
AND mssp.class_x = 'SE'
AND rownum = 1)
ELSE
NULL
END)
spouse_member_nbr,
active_members.division_nbr,
active_members.ymdeff,
active_members.ymdend,
active_members.actual_ymd_enddt,
active_members.email_id,
active_members.network_id,
active_members.insurance_company_code,
active_members.cob_flag,
active_members.vip_flag,
active_members.pre_x_flag,
active_members.region,
active_contracts.language_x,
active_contracts.corp_nbr,
active_members.group_nbr,
active_members.non_erisa_status
FROM
(SELECT mb_active.member_nbr,
mb_active.contract_nbr,
mb_active.name_last,
mb_active.name_first,
mb_active.name_middle,
ms_active.ymdeff,
ms_active.ymdend,
to_char(to_date(
CASE
WHEN LENGTH(mb_active.ymdbirth) = 8 THEN mb_active.ymdbirth
ELSE NULL
END, 'YYYYMMDD'), 'MM/DD/YYYY') dob,
mb_active.sex,
to_char(to_date(ms_active.ymdeff, 'YYYYMMDD'), 'MM/DD/YYYY') ymdeff_formatted,
to_char(to_date(ms_active.ymdend, 'YYYYMMDD'), 'MM/DD/YYYY') ymdend_formatted,
ms_active.void,
CASE
WHEN SUBSTR(mb_active.member_nbr, 10, 2) = '00' THEN mb_active.member_nbr
ELSE SUBSTR(mb_active.member_nbr, 1, 9) || '00'
END) subsciber_nbr,
mb_active.ssn,
mb_active.name_suffix,
ms_active.class_x,
ms_active.aff_nbr,
ms_active.division_nbr,
CASE
WHEN TRIM(ms_active.ymdend) = '99991231' THEN NULL
ELSE to_char(to_date(ms_active.ymdend, 'YYYYMMDD'), 'MM/DD/YYYY')
END) actual_ymd_enddt,
CASE
WHEN TRIM(ms_active.business_unit) = '01' THEN ms_active.business_unit || '-' || ms_active.prog_nbr
WHEN TRIM(ms_active.business_unit) = '03' THEN ms_active.business_unit || '-' || ms_active.prog_nbr || '-' || ms_active.carrier
ELSE NULL
END) network_id,
ms_active.business_unit || '-' || ms_active.prog_nbr || '-' || ms_active.carrier insurance_company_code,
(SELECT DISTINCT(email)
FROM dbo.av_mem_email
WHERE dbo.av_mem_email.member_nbr = mb_active.member_nbr
AND rownum = 1)
email_id,
mb_active.lr_response cob_flag,
mb_active.record_nbr vip_flag,
ms_active.pre_exist pre_x_flag,
ms_active.region region,
ms_active.group_nbr,
CASE
WHEN
(SELECT TRIM(div.div_status)
FROM division div
WHERE TRIM(div.division_nbr) = TRIM(ms_active.division_nbr)) = 'NULL' THEN
'Y'
ELSE
'N'
END)
non_erisa_status
FROM member mb_active,
member_span ms_active
WHERE mb_active.member_nbr = ms_active.member_nbr
AND(20090707 BETWEEN ms_active.ymdeff
AND ms_active.ymdend
AND TRIM(ms_active.void) IS NULL
active_members,
(SELECT DISTINCT(contract.contract_nbr),
contract.language_x,
contract_span.corp_nbr
FROM contract,
contract_span
WHERE contract.contract_nbr = contract_span.contract_nbr
AND(20090707 BETWEEN contract_span.ymdeff
AND contract_span.ymdend)
AND TRIM(contract_span.void) IS
NULL)
active_contracts
WHERE TRIM(active_members.contract_nbr) = TRIM(active_contracts.contract_nbr);
TYPE MEM IS TABLE OF MEMBERS%ROWTYPE INDEX BY PLS_INTEGER;
TABLE_MEM MEM;
MEMBER_ADDR MGONZALEZ.CPKG_UTIL.ADDR;
BEGIN
test_str := '''A10000213'''||','||'''A10000213''';
insert into test_number_char(str) values ('start time of MEMBER_LOAD_CURRENT_PCP_SPAN '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
file_name := 'member_load'||to_char(sysdate,'YYYYMMDDHH24MI')||'.txt';
FILEHANDLER := UTL_FILE.FOPEN('AVMED_UTL_FILE',file_name, 'W',10000);
insert into test_number_char(str) values ('start time of opening members cursor(before open members command) '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
OPEN MEMBERS;
LOOP
FETCH MEMBERS
BULK COLLECT INTO TABLE_MEM LIMIT 1000 ;
EXIT WHEN TABLE_MEM.COUNT = 0;
insert into test_number_char(str) values ('start time of outer loop '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
FOR i IN 1 .. TABLE_MEM.COUNT
LOOP
EXTRACTED_STRING := TRIM(TABLE_MEM(i).MEMBER_NBR)||'| '||
TRIM(TABLE_MEM(i).NAME_LAST)||'| '||
TRIM(TABLE_MEM(i).NAME_FIRST)||'| '||
TRIM(TABLE_MEM(i).NAME_MIDDLE)||'| '||
TRIM(TABLE_MEM(i).ssn)||'| '||
TABLE_MEM(i).subsciber_nbr||'| '||
TRIM(TABLE_MEM(i).class_x)||'| '||
TRIM(TABLE_MEM(i).DOB)||'| '||
TRIM(TABLE_MEM(i).SEX)||'| ' ;
EXTRACTED_STRING :=
EXTRACTED_STRING ||
TRIM(TABLE_MEM(i).aff_nbr)||'| '||
pcp_eff_date||'| '||
TABLE_MEM(i).actual_ymd_enddt||'| '||
TRIM(TABLE_MEM(i).division_nbr)||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
TABLE_MEM(i).network_id||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
TRIM(TABLE_MEM(i).name_suffix)||'| '||
' '||'| '||
TRIM(TABLE_MEM(i).spouse_member_nbr)||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
' '||'| '||
TRIM(TABLE_MEM(i).email_id)||'| '||
TABLE_MEM(i).Insurance_company_code||'| '||
TABLE_MEM(i).group_nbr||'| '||
TABLE_MEM(i).language_x||'| '||
TABLE_MEM(i).region||'| '||
TABLE_MEM(i).corp_nbr||'| '||
TABLE_MEM(i).non_erisa_status||'| '||
TABLE_MEM(i).cob_flag||'| '||
TABLE_MEM(i).pre_x_flag||'| '||
TABLE_MEM(i).vip_flag
EXTRACTED_STRING := rtrim(EXTRACTED_STRING,' ');
UTL_FILE.PUT_LINE(FILEHANDLER,EXTRACTED_STRING,TRUE);
EXTRACTED_STRING := NULL;
pcp_eff_date := NULL;
END LOOP;
insert into test_number_char(str) values ('end time of outer loop '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
END LOOP;
close members;
insert into test_number_char(str) values ('end time of opening members cursor '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
commit;
UTL_FILE.FCLOSE(FILEHANDLER);
insert into test_number_char(str) values ('End time of MEMBER_LOAD_CURRENT_PCP_SPAN '||to_char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
commit;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( 'ERROR getting members '
|| SQLCODE
|| ' '
|| SQLERRM);
END ;
In my Test table which i am inserting to check the times...
I am geting on these 2 records after that it hangs up...
start time of MEMBER_LOAD_CURRENT_PCP_SPAN 07/08/2009 11:41:21
start time of opening members cursor(before open members command) 07/08/2009 11:41:21I have to call some other functions for each member to get additional details thats the reason i am going for Procedure.Instead it is just a simple SQL
Thanks in advanceIt is taking lot of timeYou could perhaps split it up in smaller, isolated parts.
Running certain steps separate.
..is it possible to find out the issues without running the proc?Other than have other people on OTN give their ideas/share experiences?
Not that I'm aware of.
There are lots of statistical views, you might be able to deduct from their data, but I personally prefer running the procedure and just trace it. But I'm always willing to learn new approaches, btw.
Still, you have 2 things to look at, at least:
- avoid loops in loops if possible
- check your predicates, if you apply a function, you lose the index, unless you create a function based index.
edit
One more thing (how could I overlook that):
You commit your instrumentation code ( insert into test_number_char(str) ) IN the loop.
Please remove commit in your loops...
Commit only once, at the end of your transaction.
Never commit in a loop.
(Preferrably the client commits)
And remove every commit in your loop...
Edited by: hoek on Jul 8, 2009 8:03 PM -
PLEASE help me with this error java.sql.SQLException
The code
public void getInitialQuery() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:PDefApp1"); sta = con.createStatement(); System.out.println(SQLQuery); res = setupSQLConnection(SQLQuery); getRecordSet(res);
private void getRecordSet(ResultSet r) { try { jTextRecordNumberField.setText(String.valueOf(r.getInt("id"))); jTextFirstNameField.setText(r.getString(2)); jTextMiddleNameField.setText(r.getString(3)); jTextLastNameField.setText(r.getString(4)); jTextDateOfBirthField.setText(r.getString(5)); jTextAKAField.setText(r.getString(6)); jComboBoxChargingDocument.setSelectedItem(r.getString(7)); jTextAreaChargingNumber.setText(r.getString(8)); jComboBoxDecision.setSelectedItem(r.getString(9)); jComboBoxDefendentStatus.setSelectedItem(r.getString(10)); jComboBoxOriginatingUnit.setSelectedItem(r.getString(11)); jTextFieldApplicationDate.setText(r.getString(12)); jTextFieldDecisionDate.setText(r.getString(13)); jTextFieldDeliveryDate.setText(r.getString(14)); jTextAreaComments.setText(r.getString(15)); } catch (Exception e) { System.err.println("getRecordSet Exception: " + e.getMessage()); e.printStackTrace(); } }
The crash occurs in getRecordSet(ResultSet r) method and it occurs on ANY line. I've commented each line to see where it occurs.
The crash says the following
run: SELECT * FROM Table1 ORDER BY id ASC setupSQLQuery: SELECT * FROM Table1 ORDER BY id ASC getRecordSet Exception: [Microsoft][ODBC Driver Manager] Invalid cursor state java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3907) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5698) at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:354) at publicdesktopapplication.PublicDesktopView.getRecordSet(PublicDesktopView.java:1411) at publicdesktopapplication.PublicDesktopView.getInitialQuery(PublicDesktopView.java:1377) at publicdesktopapplication.PublicDesktopView.<init>(PublicDefenderView.java:89) at publicdesktopapplication.PublicDesktopApplication.startup(PublicDesktopApplication.java:19) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
I am very confused why this is crashing on me. It didnt crash in the older version of this application.
Please help!Don't do this either
SELECT * FROM Table1 Explictly name the columns in the order that you are going to fetch them. This makes your code easier to follow later and as side benefit prevents any changes in the column ordering from blowing your code to smitheens.
And I do hope your table is not in fact called Table1. -
Please Help: Career Path for becoming a SQL DBA
Hi All
I am a Software developer with around 15 months of experience in .Net 2.0 and VSTO.
I am currently working in a SQLServer 2000 project.
I feel more interest to work with database than front end coding.
Can anyone suggest what need to be done for the one to be a DBA.
Could you please provide more details on the roles and responsibilities and the scope for career development on becoming a DBA.
In what Timeline can i be a DBA. After becoming a DBA what are the career options available. Please help me out in deciding my career
Thanks in Advance,
SidharthOn these days DBA is an abstract level word. DBA can be further classified to Development DBA , Production DBA , Data warehouse dba, ETL DBA , DB Architect DBA and even may be REPORTING DBA. Each job has its own significance. Role for each dba may differ. Some time DBA perform multiple role in an organization (in my case i am doing Architecting / part time Production DBA and Dev DBA role).
In addition to Kalman suggestion, what you can do is , you can start from Virtual labs provided by Microsoft. If you ask the timeline, its all depends. Hands on experience is the key.
Virtual Labs for SQL Server 2005
http://technet.microsoft.com/en-us/bb499681.aspx -
Left outer join VS Is NULL .. Please help me to understand this.
Hi Experts,
I have a requirement to use Leftouter join on a column. But unfortunately i couldnt implement this in OBIEE. so instead iam using = and is NULL condition. kindly help me to understand this or give me a solution.
Advance Thanks
I am pasting the query here. look at the last line of the query there i want to modify.
select Targ.organization_id,Targ.cycle_count_header_name,Targ.cycle_count_header_id,Targ.cc_class_name
,Targ.total_cycle_count_per_month,NVL(Act.Actual_count,0)actual_count,targ.month_year,Act.count_stat,targ.year count_date_current,length(act.count_status) count_status,nvl(length(act.count_status),0)
from
(select
Dim_date.Year,
Dim_date.month_year,
target.organization_id,
target.cycle_count_header_name,
target.cycle_count_header_id,
target.abc_class_id,
target.CC_class_name,
target.inventory_item_id_count,
target.cycle_count_per_year,
target.total_cycle_count_per_year,
target.total_cycle_count_per_month
from
(SELECT DISTINCT
TO_NUMBER (TO_CHAR (count_date_current, 'yyyy'), '9999') Year,
TO_CHAR (count_date_current, 'MON-YYYY') month_year
FROM mtl_cycle_count_entries_v)Dim_date,
(SELECT mth.organization_id,
mth.cycle_count_header_name,
mth.cycle_count_header_id,
mtc.abc_class_id,
mtc.CC_class_name,
COUNT (mti.inventory_item_id) inventory_item_id_count,
MIN (mtc.num_counts_per_year) cycle_count_per_year,
COUNT (mti.inventory_item_id)
* MIN (mtc.num_counts_per_year)
total_cycle_count_per_year,
ROUND (
(COUNT (mti.inventory_item_id)
* MIN (mtc.num_counts_per_year))
/ 12)
total_cycle_count_per_month,
TO_NUMBER (TO_CHAR (mth.creation_date, 'yyyy'), '9999') Year
FROM mtl_cycle_count_headers_v mth,
mtl_cycle_count_items_v mti,
mtl_cycle_count_classes_v mtc
WHERE mth.cycle_count_header_id = mti.cycle_count_header_id
AND mth.cycle_count_header_id = mtc.cycle_count_header_id
AND mth.organization_id = mtc.organization_id
AND mtc.abc_class_id = mti.abc_class_id
GROUP BY mth.organization_id,
mth.cycle_count_header_id,
mth.cycle_count_header_name,
mtc.abc_class_id,
mtc.CC_class_name,
TO_NUMBER (TO_CHAR (mth.creation_date, 'yyyy'), '9999')
) Target
where dim_date.Year=Target.Year) Targ,
(SELECT --TRUNC (count_date_current) count_date_current,
TO_CHAR (count_date_current, 'MON-YYYY') Month_year,
abc_class_name,
count_status count_stat,
organization_id,
cycle_count_header_id,
count_status,
SUM (NUMBER_OF_COUNTS) Actual_count
FROM MTL_CYCLE_COUNT_ENTRIES_V
GROUP BY organization_id,
--TRUNC (count_date_current),
cycle_count_header_id,
TO_CHAR (count_date_current, 'MON-YYYY'),
abc_class_name,
count_status)Act
WHERE act.cycle_count_header_id(+) = targ.cycle_count_header_id
AND act.organization_id(+) = targ.organization_id
AND act.abc_class_name(+) = targ.cc_class_name
AND act.Month_year(+)=targ.month_year
AND targ.organization_id=254
AND targ.Cycle_count_header_id=3026
AND targ.CC_CLASS_NAME= 'A PARTS'
and act.count_status (+)='Rejected'I need to replace the final line act.count_status(+)='Rejected' with
(act.count_status='Rejected' and act.count_status is NULL)But i am getting difference in data. what might be the reason?.. I am a naive user to oracle. Kindly help me and any help will be appreciated.
Thanks alot.Data set for both i am enclosing here. Kindly have a look in to that.
254 OPSCAST0909 3026 A PARTS 7 1 Dec-09 Rejected 2009
254 OPSCAST0909 3026 A PARTS 7 0 Feb-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Sep-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Jul-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 May-09 2009 Data Set for outer join
254 OPSCAST0909 3026 A PARTS 7 0 Oct-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Jun-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Jan-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Nov-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Apr-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Aug-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Mar-09 2009
254 OPSCAST0909 3026 A PARTS 7 1 Dec-09 Rejected 2009
254 OPSCAST0909 3026 A PARTS 7 0 Feb-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Jul-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 May-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Jun-09 2009 Data set of IS NULL
254 OPSCAST0909 3026 A PARTS 7 0 Jan-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Apr-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Aug-09 2009
254 OPSCAST0909 3026 A PARTS 7 0 Mar-09 2009 -
Please help me in understanding the EDIFACT D96A format for INVOICE
Hi,
Im doing an INVOICE02 IDOC to EDIFACT D96A INVOIC scenario. Im new to EDI.
Pls Pls Pls Pls kindly help me in understanding the following EDIFACT D96A file.
UNBUNOA:35410033000055:145400110000009:14070612:085511137INV96A+EANCOM1'
UNH1INVOIC:D:96A:UN:EAN008'
BGM3805010237529+9'
DTM+137:200706120000:203'
DTM+35:20070612:102'
DTM+454:20070612:102'
RFF+ON:32210'
DTM+171:20070612:102'
RFF+DQ:000030585715'
DTM+171:20070612:102'
NADSU5410148000001::9+BVBA Unilever Belgium SPRLBl.De L?'Humanité 292 292Bruxelles1190BE'
RFF+VA:BE438390312'
RFF+ARA:0438390312'
NADBY5400110000009::9+D.L.L.RUE OSSEGHEM 53-MOLENBEEKMOLENBEEK-SAINT-JEAN1080BE'
NADDP5400110000009::9+D.L.L.RUE OSSEGHEM 53-MOLENBEEKMOLENBEEK-SAINT-JEAN1080BE'
NADIV5400110000009::9+DELHAIZE FRS. CENTRALESRUE OSSEGHEM , 53BRUSSEL-MOLENBEEK1080BE'
RFF+VA:BE402206045'
RFF+ARA:0402206045'
CUX+2:EUR:4'
LIN10+8000920900987:EN'
PIA1000000000019009801:SA'
IMDF+IN:::IGLO POELEE LEGUMES CHAMPIGNONS 6X8'
QTY+47:81'
QTY+46:81'
MOA+203:1584.4'
PRI+AAA:19.56'
PRI+AAB:21.24'
TAX7VAT+++:::6.000'
MOA+125:1584.4'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN20+5410148126459:EN'
PIA1000000000011264501:SA'
IMDF+IN:::Epinards hachis en portions '
QTY+47:112'
QTY+46:112'
MOA+203:1061.01'
PRI+AAA:9.47'
PRI+AAB:10.96'
TAX7VAT+++:::6.000'
MOA+125:1061.01'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN40+5410148013452:EN'
PIA1000000000010134500:SA'
IMDF+IN:::15 Fish Sticks Colin d?'Alaska '
QTY+47:256'
QTY+46:256'
MOA+203:4937.63'
PRI+AAA:19.29'
PRI+AAB:20.16'
TAX7VAT+++:::6.000'
MOA+125:4937.63'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
LIN50+5414807999958:EN'
PIA1000000000019999501:SA'
IMDF+IN:::Iglo Poisson Pané Epinards 7X400g'
QTY+47:180'
QTY+46:180'
MOA+203:4160.31'
PRI+AAA:23.11'
PRI+AAB:24.08'
TAX7VAT+++:::6.000'
MOA+125:4160.31'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
LIN60+5410148120952:EN'
PIA1000000000011209501:SA'
IMDF+IN:::Epinards Crhme en Portions '
QTY+47:112'
QTY+46:112'
MOA+203:1594.69'
PRI+AAA:14.24'
PRI+AAB:15.92'
TAX7VAT+++:::6.000'
MOA+125:1594.69'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN70+5410148124158:EN'
PIA1000000000011241503:SA'
IMDF+IN:::EPINARDS HACHES EN PORTIONS 450G'
QTY+47:144'
QTY+46:144'
MOA+203:938.01'
PRI+AAA:6.51'
PRI+AAB:7.44'
TAX7VAT+++:::6.000'
MOA+125:938.01'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN120+5410148016729:EN'
PIA1000000000010167201:SA'
IMDF+IN:::Macaroni Fromage/Jambon '
QTY+47:260'
QTY+46:260'
MOA+203:4337.55'
PRI+AAA:16.68'
PRI+AAB:17.58'
TAX7VAT+++:::6.000'
MOA+125:4337.55'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
LIN130+5410148441255:EN'
PIA1000000000014412503:SA'
IMDF+IN:::CHOUX ROUGES AUX POMMES 450G'
QTY+47:144'
QTY+46:144'
MOA+203:1756.99'
PRI+AAA:12.2'
PRI+AAB:13.36'
TAX7VAT+++:::6.000'
MOA+125:1756.99'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN140+5410148017702:EN'
PIA1000000000010177001:SA'
IMDF+IN:::Frit?'Kot 1'
QTY+47:60'
QTY+46:60'
MOA+203:1102.6'
PRI+AAA:18.38'
PRI+AAB:22'
TAX7VAT+++:::6.000'
MOA+125:1102.6'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:4.9:1'
LIN180+8000920801796:EN'
PIA1000000000018017901:SA'
IMDF+IN:::EPINARDS EN BRANCHES 10 X 450'
QTY+47:190'
QTY+46:190'
MOA+203:2204.2'
PRI+AAA:11.6'
PRI+AAB:12.9'
TAX7VAT+++:::6.000'
MOA+125:2204.2'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN200+5410148014268:EN'
PIA1000000000010142602:SA'
IMDF+IN:::PETITS POIS EXTRA FINS 450G'
QTY+47:238'
QTY+46:238'
MOA+203:1999.6'
PRI+AAA:8.4'
PRI+AAB:9.24'
TAX7VAT+++:::6.000'
MOA+125:1999.6'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
ALCA++1'
PCD+1:1.96:1'
LIN230+8000920807248:EN'
PIA1000000000018072403:SA'
IMDF+IN:::IGLO POUL ET PENNE AUX LEG.SOLEI. 6'
QTY+47:99'
QTY+46:99'
MOA+203:1727.54'
PRI+AAA:17.45'
PRI+AAB:18.3'
TAX7VAT+++:::6.000'
MOA+125:1727.54'
ALCA++1'
PCD+1:0:1'
ALCA++1'
PCD+1:1.97:1'
UNS+S'
CNT+2:12'
MOA+124:1644.27'
MOA+86:29048.8'
MOA+79:27404.53'
MOA+125:27404.53'
TAX7VAT++:::6.000S'
MOA+125:27404.50'
MOA+124:1644.27'
UNT2121'
UNZ111137'
Advance appreciations,
Ram.Its very simple:
UNB-segment : Interchange Header
S001 SYNTAX IDENTIFIER
0001 Syntax Identifier UNOA
0002 Syntax version number 2
S002 INTERCHANGE RECIPIENT
0004 Sender Identification 8711382000091 (= GLN Code Tilburg)
0007 Identification Code Qualifier 14
S003 INTERCHANGE SENDER
0004 Recipient Identification 8711700400008(= GLN Code Unilever)
0007 Identification Code Qualifier 14
S004 DATE/TIME OF PREPARATION
0017 Date YYMMDD
0019 Time HHMM
0020 INTERCHANGE CTRL REF. Unique message reference number
0026 APPLICATION REFERENCE WMS0330
UNH-segment: Message header
0062 MESSAGE REFERENCE NUMBER Unique sequence numbe within UNB
S009 MESSAGE IDENTIFIER
0065 Message type identifier INVRPT
0052 Message type version number D
0054 Message type release number 96A
0051 Controlling agency EN
0057 Association assigned code EAN004
BGM-segment: Beginning of message
C002 DOCUMENT/MESSAGE NAME
1001 Document/message name, coded 35 (= Inventory report)
3055 Code list responsible agency, coded 9 (= EAN)
1004 DOCUMENT/MESSAGE NUMBER Unique Number assigned by CS (= Date/Time CCYYMMDDHHMMSS)
1225 MESSAGE FUNCTION, CODED 9 (= Original)
DTM-segment: Date/time/period
C507 DATE/TIME/PERIOD
2005 Date/time/period qualifier 137 (=Document/message date/time)
2380 Date/time/period Document date
2379 Date/time/period format qualifier 102 (= CCYYMMDD)
RFF-segment: Reference
C506 REFERENCE
1153 Reference code qualifier ON (= Order number)
1154 Reference identifier Agreement number
NAD-segment: Name and address
3035 PARTY QUALIFIER GY (= Inventory reporting party = CS)
GM (= Inventory controller = XYZ)
C082 PARTY IDENTIFICATION DETAILS
3039 Party id. identification GLN code
3055 Code list responsible agency, coded 9 (= EAN)
LIN-segment: Line item
1082 LINE ITEM NUMBER Unique Line Number
C212 ITEM NUMBER IDENTIFICATION
7140 Item number EAN Material code
7143 Item number type, coded EN (= EAN)
PIA-segment: Additional Product Information
4347 PRODUCT ID FUNCTION IDENTIFIER "1"(= Additional Information)
C212 ITEM NUMBER IDENTIFICATION
7140 Item number Promotional Variant
7143 Item number type, coded "PV (= Promotional variant)
QTY-segment: Quantity
C186 QUANTITY DETAILS
6063 Quantity qualifier 12 (= Despatch quantity)
6060 Quantity Number of stock units
PRI: Represent price
TAX: represent tax.
Try to go to the below website where you will able to get the information regarding all the sgements and elements of Invocie.
http://www.edifactory.de/messages.php?s=D96A
Also refer the below link for EDI understanding:
http://www.gxs.com/pdfs/Tutorial/Tutor_EDIFACT_GXS.pdf
Thnx
Chirag Gohil -
Please help me in understanding ALE
1. _Please can anybody send me the ALE Real time scenario, please dont say that it is to send the data from one client to another i.e master data ?
HI Friend,
I dont know what you are expecting but here i have a complete scenerio step by step to send material from one client to another .
ALE IDOC
Sending System(Outbound ALE Process)
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Create Model View
Tcode BD82 ? Generate partner Profiles & Create Ports
Tcode BD64 ? Distribute the Model view
Message Type MATMAS
Tcode BD10 ? Send Material Data
Tcode WE05 ? Idoc List for watching any Errors
Receiving System(Inbound ALE )
Tcode SALE ? for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 ? Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 ? Idoc List for inbound status codes
ALE IDOC Steps
Sending System(Outbound ALE Process)
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Create Model View
Tcode BD82 !V Generate partner Profiles & Create Ports
Tcode BD64 !V Distribute the Model view
This is Receiving system Settings
Receiving System(Inbound ALE )
Tcode SALE ?3 for
a) Define Logical System
b) Assign Client to Logical System
Tcode SM59-RFC Destination
Tcode BD64 !V Check for Model view whether it has distributed or not
Tcode BD82 -- Generate partner Profiles & Create Ports
Tcode BD11 Getting Material Data
Tcode WE05 !V Idoc List for inbound status codes
Message Type MATMAS
Tcode BD10 !V Send Material Data
Tcode WE05 !V Idoc List for watching any Errors
1)a Goto Tcode SALE
Click on Sending & Receiving Systems-->Select Logical Systems
Here Define Logical Systems---> Click on Execute Button
go for new entries
1) System Name : ERP000
Description : Sending System
2) System Name : ERP800
Description : Receiving System
press Enter & Save
it will ask Request
if you want new request create new Request orpress continue for
transfering the objects
B) goto Tcode SALE
Select Assign Client to Logical Systems-->Execute
000--> Double click on this
Give the following Information
Client : ERP 000
City :
Logical System
Currency
Client role
Save this Data
Step 2) For RFC Creation
Goto Tcode SM59-->Select R/3 Connects
Click on Create Button
RFC Destination Name should be same as partner's logical system name
and case sensitive to create the ports automatically while generating the
partner profiles
give the information for required fields
RFC Destination : ERP800
Connection type: 3
Description
Target Host : ERP000
System No:000
lan : EN
Client : 800
User : Login User Name
Password:
save this & Test it & RemortLogin
3)
Goto Tcode BD64 -- click on Change mode button
click on create moduleview
short text : xxxxxxxxxxxxxx
Technical Neme : MODEL_ALV
save this & Press ok
select your just created modelview Name :'MODEL_ALV'.
goto add message type
Model Name : MODEL_ALV
sender : ERP000
Receiver : ERP800
Message type :MATMAS
save & Press Enter
4) Goto Tcode BD82
Give Model View : MODEL_ALV
Partner system : ERP800
execute this by press F8 Button
it will gives you sending system port No :A000000015(Like)
5) Goto Tcode BD64
seelct the modelview
goto >edit>modelview-->distribute
press ok & Press enter
6)goto Tcode : BD10 for Material sending
Material : mat_001
Message Type : MATMAS
Logical System : ERP800
and Execute
7)goto Tcode : BD11 for Material Receiving
Material : mat_001
Message Type : MATMAS
and Execute --> 1 request idoc created for message type Matmas
press enter
Here Master Idoc set for Messge type MATMAS-->press Enter
1 Communication Idoc generated for Message Type
this is your IDOC
Change Pointers
I know how to change the description of a material using ALE Change
Pointers.
I will give the following few steps
1) Tcode BD61---> check the change pointers activated check box
save and goback.
2) Tcode BD50---> check the MATMAS check box save and comeback.
3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save
and comeback.
4) Tcode BD52---> give message type : matmas press ok button.
select all what ever you want and delete remaining fields.
save & come back.
5) 5) go to Tcode MM02 select one material and try to change the
description and save it
it will effects the target systems material desciption will also
changes
6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute
give Message type : MATMAS and Executte
ALE/IDOC Status Codes/Messages
01 Error --> Idoc Added
30 Error --> Idoc ready for dispatch(ALE Service)
then goto SE38 --> Execute the Program RBDMIDOC
29 Error --> ALE Service Layer
then goto SE38 --> Execute the Program RSEOUT00
03 Error --> Data Passed to Port ok
then goto SE38 --> Execute the Program RBDMOIND
12 Error --> Dispatch ok
Inbound Status Codes
50 Error --> It will go for ALE Service Layer
56 Error --> Idoc with Errors added
51 Error --> Application Document not posted
65 Error --> Error in ALE Service Layer
for 51 or 56 Errors do the following steps
goto WE19 > give the IDOC Number and Execute>
Press on Inbound function Module
for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your
getting 51 Error
Hope this Helps.
Thanks
Mahesh -
Can anyone please help with a Connect by PRIOR sql?
Hi,
I am not so well versed in Oracle analytic functions and am having trouble with a sql.
Oracle Version: 9.2.0.1.0
I have a tree table storing heirarchies upto 4 levels.
create table FAMILY_TREE
TREE_ID NUMBER not null,
PARENT_ID NUMBER,
NAME VARCHAR2(100)
I know that using a CONNECT BY PRIOR, I can find out who the previous ancestar is.
select
f.tree_id TreeId,
f.parent_id ParentId,
f.Name Name
from family_tree f
connect by
prior f.tree_id = f.parent_id
start with f.parent_id is null
I need to display all the ancestars in a single line (in different columns), which is where I am stumped.
I need the output, in different columns as :
Joe Jack Harry Rick Ned
Bascially, I need to display in a single row, all the ancestars.
I tried to use joins but it was very very slow due to the fact that I had to perform multiple joins.
Can anyone please point me in the right direction?
Data:
insert into FAMILY_TREE (TREE_ID, PARENT_ID, NAME)
values (1, null, 'Joe');
insert into FAMILY_TREE (TREE_ID, PARENT_ID, NAME)
values (2, 1, 'Jack');
insert into FAMILY_TREE (TREE_ID, PARENT_ID, NAME)
values (3, 2, 'Harry');
insert into FAMILY_TREE (TREE_ID, PARENT_ID, NAME)
values (4, 3, 'Rick');
insert into FAMILY_TREE (TREE_ID, PARENT_ID, NAME)
values (5, 4, 'Ned');This may give you a start
SQL> ed
Wrote file afiedt.buf
1 select f.tree_id TreeId,f.parent_id ParentId,
2 trim(',' from sys_connect_by_path(f.Name,',')) name
3 from family_tree f
4 connect by
5 prior f.tree_id = f.parent_id
6* start with f.parent_id is null
SQL> /
TREEID PARENTID NAME
1 Joe
2 1 Joe,Jack
3 2 Joe,Jack,Harry
4 3 Joe,Jack,Harry,Rick
5 4 Joe,Jack,Harry,Rick,Ned
Message was edited by:
jeneesh
Forgot to refresh..
Maybe you are looking for
-
Hi, I need to get print only one page..But my script is printing 2 pages. how to do this. I have one page in PAGES form. But still it is printing 2 pages..what could be the reason. Regards, Maruti
-
Dynamic file names on file based processing
Hi Experts we are doing file to file scenario using file based processing not on message based ( No Reposiitory Objects - No mapping , no interface objects ). we need to pickup the file name from the source directory and place it in the target direct
-
GRC AC 5.3 Logging strategy in multi server nodes
Hello Experts, We have GRC AC 5.3 SP6 and 5.2 10 landscapes and PRD system are running with multiple server nodes. SAP recomends to use SAP Logger instead of Java Logger in multi server environment, but i am not able to find out complete documentatio
-
Hi Xperts, i have created a generic data sources by using infoset query(merge 2 data sources). now when i want to see the data in PSA, i am not getting the data for one field say'XXX"(rest of the values are coming for all the fields) i checked that '
-
Apply OR clause in dynamic filter on an interactive report
Apex ver - 4.2 I have a requirement wherein I have to apply filter on interactive report. I have to apply filter which will change depending upon different conditions. So I created a PLSQL process on "On Load Before Region" For e.g if condition is --