Need a logic to load a table
Hi All,
I am trying to figure out a logic to load a table from 3 differnt tables... below are the tables
Contact
contact_id DS_ID
(Number) (Varchar2)
CR_TYpe
CR_Type_ID CR_Type
(Number) (Varchar2)
Source_CR_Type
S_CR_Type_ID CR_TYPE
(Varchar2) (Varchar2)Contact.DS_ID =Source_CR_Type.S_CR_Type_ID (the relation between contact and Source_CR_Type is 1:M)
Distinct Source_CR_Type.CR_TYPE = CR_TYpe.CR_Type
The table that needs to be loaded is MAP_CON_CR_TYPE
MAP_CON_CR_TYPE
MAP_ID COntact_id CR_Type_ID
(Number) (Number) (Number)
sequencecan any one help me with a logic to load this bridge table or suggest me how to approch.
Edited by: BluShadow on 15-Feb-2013 15:26
added {noformat}{noformat} tags for readability. Please see {message:id=9360002} to learn to do this yourself in future.
How do I ask a question on the forums?
SQL and PL/SQL FAQ
Similar Messages
-
Urgent:Logic needed to fetch data from Internal Table
Here i have an internal table having Emp no,Emp name,Salary fields....
With unique Emp no.
My requirement is i want to fetch all the details of the employees(like empno,emp name, emp address..) whose salary is the third highest salary.
Note: Many employees can have unique salary.
I need the logic for that,
helpfull ans ill be rewarded.suppose ur table has three fields like
types : begin of typ_emp,
num type i ,
name type char20 ,
salary type char10 ,
end of typ_emp.
data : it_emp type table of typ_emp ,
it1_emp TYPE TABLE OF typ_emp ,
wa_emp type typ_emp .
DATA : count TYPE i ,
w_salary type i .
code is
SORT it_emp BY salary ASCENDING .
it1_emp = it_emp .
Take the all data to another table and delete all adjacent duplicates .
DELETE ADJACENT DUPLICATES FROM it_emp COMPARING salary .
READ TABLE IT_EMP INTO WA_EMP INDEX 3.
MOVE WA_EMP-SALARY TO W_SALARY .
now the third highest salary will come into w_salary .
and now again process your internal table and retrieve whose salary is equal to w_salary ...
thanks
reward if helpfull..............
Edited by: sam k on May 27, 2008 12:43 PM
Edited by: sam k on May 27, 2008 12:55 PM -
Adding a single table without a logical join to another table (OBIEE 10g)
Sometimes I want to just display a single table without a logical join to another table in the repository. However, everytime I move it to the Business Model and Mapping layer and perform a Global Consistency Check, it tells me that it needs a logical join and I am forced to create another table to join to it. Thus creating a dimension-fact relationship. There are times I don't need this relationship and just want to display some data. Is there anyway to get around this?
Thanks in advance!Yes,You have to create a join.You cannot take single table to BMM layer.You can create an alias of the table.Join this alias and base table through any common column and take both tables to BMM and desired table to presentation layer.
Another way is to create a view in physcial layer.Write a select statement like
Select primary_key from Table
Where primary_key is primary key of base table.Join this view ith base table and repeat the steps defined for Alias.
Regards,
Sandeep -
ORA-00054 error when loading Oracle table using Data Services
Hello,
we are facing ORA-00054 error when loading Oracle table using BO Data services
(Oracle 10g database, BODS Xi 3.2 SP3)
Test Job performs
1- truncate table
2- load table (tested in standard and bulk load modes)
Scenario when issue happens is:
1- Run loading Job
2- Job end in error for any Oracle data base error
3- When re-running the same Job, Job fails with following error
ORA-00054: resource busy and acquire with NOWAIT specified
It seems after first failure, Oracle session for loading the table stays active and locks the table.
To be able to rerun the Job, we are forced need to kill Oracle session manually to be able to run the Job again.
Expected behaviour would be : on error rollback modifications made on table and BODS stops Oracle session in a clean way.
Can somebody tell me / or point me to any BODS best practice about Oracle error handling to prevent such case?
Thanks in advance
Paul-Mariethe ora-0054 can occure depending how the job failed before. If this occures you will need the DBA to release the lock on the table in question
Or
AL_Engine.exe on The server it creates the Lock. Need to Kill Them. Or stop it..
This Problem Occurs when we select The Bulkloading Option in orclae We also faced the same issue,Our admin has Killed the session. Then everything alright. -
Need to fetch value from a table based on data range
Hello there,
I was hoping that the community could give me a hand with this little puzzle I got.
I am currently creating a Time Dimension for a data wharehouse, and I have the requirement to populate a column named SEASON (e.g: Summer, Winter, Spring, Autumn) for each date row. So for the 20/Dec/2013, the Season column must say Winter.
Here is now my Time Dimension table looks like, without the Season information (which I yet have to load):
DimTime Table
TIMEID
FULLDATE
YEAR
SEASON
MONTH
MONTHDAY
WEEK
WEEKDAY
274
02-MAR-10
2010
3
2
9
2
275
03-MAR-10
2010
3
3
9
3
276
04-MAR-10
2010
3
4
9
4
277
05-MAR-10
2010
3
5
9
5
278
06-MAR-10
2010
3
6
9
6
279
07-MAR-10
2010
3
7
9
7
This entire table is being populated using Oracle functions to manipulate a date field from another table, named PDATE:
My ETL Code
INSERT INTO DimTime(timeid, fulldate, year, month, monthday, week, weekday)
SELECT tim_seq.NEXTVAL, pdate, year, month, monthday, week, weekday
FROM (SELECT DISTINCT pdate, EXTRACT(year from pdate) year, EXTRACT(month from pdate) month,
EXTRACT(day FROM pdate) monthday, to_number(to_char(to_date(pdate,'DD/MM/YY'),'IW')) week,
TO_CHAR(pdate, 'D') weekday
FROM Performance PER
ORDER BY pdate);
NOTE: Code considers the table DimTime to be truncated every time it loads (i.e.: I don't need to consider additional loads).
As you can see, Season wasn't populated. Since the solstices and equinoxes vary for each year, I can't just say that Summer start at a given date (e.g: 21 of June) because one year it could be the 19/Jun, another the 22/Jun, etc. So in order to solve this problem, I have a table named Season which defines the START and END dates for the seasons:
Season Table
SEASON#
SEASONNAME
YEAR
DATEFROM
DATETO
1
Spring
2010
01-MAR-10
30-MAY-10
2
Summer
2010
31-MAY-10
29-AUG-10
3
Autumn
2010
30-AUG-10
28-NOV-10
4
Winter
2010
29-NOV-10
27-FEB-11
5
Spring
2011
28-FEB-11
29-MAY-11
6
Summer
2011
30-MAY-11
28-AUG-11
7
Autumn
2011
29-AUG-11
27-NOV-11
8
Winter
2011
28-NOV-11
26-FEB-12
9
Winter
2009
30-NOV-09
28-FEB-10
This is the bit I don't know how to do. How can I make sure that I populate the correct Season in my DimTime table based on the season specified in the Season table?
Thanks in advance for your help!
Regards,
P.Just join to table Season:
INSERT
INTO DimTime(
timeid,
fulldate,
year,
month,
monthday,
week,
weekday,
seasonname
SELECT tim_seq.NEXTVAL,
pdate,
year,
month,
monthday,
week,
weekday
FROM (
SELECT DISTINCT pdate,
EXTRACT(year from pdate) year,
EXTRACT(month from pdate) month,
EXTRACT(day FROM pdate) monthday,
to_number(to_char(to_date(pdate,'DD/MM/YY'),'IW')) week,
TO_CHAR(pdate,'D') weekday,
seasonname
FROM Performance PER,
season
WHERE pdate between datefrom and dateto
SY. -
Best practice to load a table that is a relationship between 2 parent tabs
I need to know what is the best way to load a table that is a kind of relationship between 2 master tables and that is relating them. It is an append procedure not a replace procedure.
should it be a sqlldr?
what tool should be used?
Thanks a lot.
@}--->----->>----------
PaolaYes it is inside of a file that is a kind of .txt, it is ASCII.
I want to load without having problems with constraints at all.
But the point is that it should be fast enough to avoid performance problems.
Thank you.
Paola
@{--->----->>---------- -
hi experts , i need a logic
i have a internal table itab_equi in that i am getting 11 values when i pass this internal table to another table using for all entries i will get 4 values in int_bmgkobj . i need logic for how to get the deleted values i.e 9 values deleted . i need that value 9 values ..
SELECT matnr
sernr
kunde
objnr FROM equi
INTO TABLE itab_equi " i am getting 11 values here
WHERE kunde = kunde .
IF itab_equi[] IS NOT INITIAL.
SELECT j_objnr
gwldt
gwlen FROM bgmkobj
INTO TABLE itab_bgmkobj " i am getting 4 values here
FOR ALL ENTRIES IN itab_equi
WHERE j_objnr = itab_equi-objnr .
i need the deleted 9 values in a seperate internal table ..
plz help me for this logic
regards
chinnaiya PHI,
Check this ..
SELECT matnr
sernr
kunde
objnr FROM equi
INTO TABLE itab_equi " i am getting 11 values here
WHERE kunde = kunde .
IF itab_equi[] IS NOT INITIAL.
SELECT j_objnr
gwldt
gwlen FROM bgmkobj
INTO TABLE itab_bgmkobj " i am getting 4 values here
FOR ALL ENTRIES IN itab_equi
WHERE j_objnr NE itab_equi-objnr . "--> Check here
Or
Select all the data from bgmkobj into internal table itab_bgmkobj.
Loop the itab_bgmkobj and check the entry using entries in internal table itab_equi..if found delete ..the left entries are what you required -
Extract Data from XML and Load into table using SQL*Loader
Hi All,
We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
Your suggestion is highly appreciated.
Thanks in advanceHi,
First of all go to PSA maintanance ( Where you will see PSA records ).
Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
> Give the proper file name where you want to download and then-----> Generate.
You will get ur PSA data in Excel Format.
Thanks
Mayank -
Hi Experts,
I have a table
SSN data balance paid_amount rank
111111111 1st week date 1000 100 1
111111111 2nd week date 1000 100 2
111111111 3rd week date 1000 100 3
111111122 1st week date 1000 100 1
111111122 2nd week date 1000 100 2
111111122 3rd week date 1000 100 3
I want the output as
SSN data balance New_balance
111111111 1st week date 1000 1000
111111111 2nd week date 1000 900
111111111 3rd week date 900 800
111111122 1st week date 1000 1000
111111122 2nd week date 1000 900
111111122 3rd week date 900 800
For first New_balance values will be same as balance
for second week balance = new_balance and new_balance = balance-paid_amount
for third week balance = new_balance and new_balance = balance-paid_amount
I am using data service version 4.1
Need a Logic to perform above
Thanks
MadhuHi Mohd,
It worked Perfect for the new balance field, thank you so much, Also the balance field should change
In the above result set the 3rd Week balance should be same as 2nd week new balance
In other words, 2nd Week Balance should be same as first week new balance as shown below
Input
SSN
DATE
BALANCE
PAID_AMOUNT
111111111
1ST Week
1000
100
111111111
2nd Week
1000
100
111111111
3rd Week
1000
100
111111112
1ST Week
1000
100
111111112
2nd Week
1000
100
111111112
3rd Week
1000
100
111111112
4TH Week
1000
100
output
SSN
DATE
BALANCE
NEW_BALANCE
111111111
1ST Week
1000
1000
111111111
2nd Week
1000
900
111111111
3rd Week
1000
800
111111112
1ST Week
1000
1000
111111112
2nd Week
1000
900
111111112
3rd Week
1000
800
111111112
4TH Week
1000
700
Thanks for your Effort -
Query Builder doesnt load the tables. Schema not loaded
Hi all,
One small issue i am facing.. I have made a connection to Oracle db using the user id given by my DBA.
But when I try to open the query builder it doesnt load any tables.. cant see any tables.
Findings:
If on toad i run a query
select * from table it returns me noting.
But if i run it with SIEBEL
Select * from SIEBEL.table it returns result.
just prefixing it with SIEBEL gives me the result.
Do i need to ask the DBA to give my user id the access to run queries without prefixing SIEBEL... what exactly shld i ask him to do
OR is something we can do at the publisher end itself so that it strt loading required tables avalable for my user id?
thanks a lot!!
DevFrom your description I'd conclude that your DBA has provided you database access via a user ID (schema), let's say USER1. If you have registered this database as JDBC / JNDI data source using this particular user, then you will always need to prefix your table names with 'SIEBEL.' as the database objects are stored in the SIEBEL schema, and not in the USER1 schema.
You may question your DBA about the feasibility of setting up a logon trigger on the USER1 account so that it automatically switches the current schema to the SIEBEL one.
alter session set current_schema = <your_schema_name>;
Something similar was discussed in the following thread:
how to switch schema in a logon trigger when in 3-tier (how to define case) -
Hi,
Can any one briefly explain what is the need of Logical database?
In which case , abapers r going for logical database?
regards,
PoojaHi Pooja,
A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
GET will fetch the table data immediately
GET LATE
In the LDB when you define the table structure in hierarchy, first it will fetch the higher node data and then all the below node tables data and comes to a second record in the top node table. for this GET Late is used.
You can create any number of primary keys in a table
The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the application logic.
GO THROUGH LINKS -
http://www.sap-basis-abap.com/saptab.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
Re: **LDB**
www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html
www.sap-img.com/abap/abap-interview-question.htm
www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm
Reward if useful.
Regards,
Hemant -
What is best way to load USRACL table
I want some advice on loading the USRACL table with initial entries for mapping SNC names onto SAP user names. I know that SNC1 can be used, but I also wondered what functionality exists in SAP to load this table using table maintenance tools, e.g. loading from a .csv file or bulk loading some other way ?
Thanks,
TimFirst use Disk Utilty to make a disk image of the iWork disc on your iMac. Then there are two easy ways to install on your mothers new iMac. One is to copy to your USB thumb drive, visit your mother and install from the thumb drive. The other is to use a free upload and download service like www.wetransfer.com. Upload the .dmg disk image via www.wetransfer.com, then your mother downloads and installs. After installation you'll need to update iWork for Mountain Lion compatibility.
-
Loading source tables without common columns using owb
Dear All,
I have 5 tables say a,b,c,d,e who has no columns between any of these tables .but i need to poulate some of the columns in each table as per my requirement and
i need to load into my target table which needs the above tables source columns data .
how can we achieve this as we dont have any columns across 5 tables.
regards
rajeshSame thread .
Loading source tables data without common columns in owb
Please close it.
Edited by: Nawneet on May 18, 2009 11:06 AM -
Loading DB2 Table for JD Edwards
I am trying to load a F40307 JD Edwards table for which is stored in DB2 on AS/400. Has anyone loaded DB2 tables using ODI? If yes, did you have to install additional dirvers?
You will need the JDBC driver, which IBM have opensourced. Search the IBM site and it sends you to the relevant place. The driver file needs to be in your oracledi/drivers directory.
The KMs for use with AS/400 are in the oracledi/impexp directory.
You might also take a look at the KM guide which will explain what the specific KMs for the JDE can do for you. -
Hi,
I have a dbf (foxpro) table that I need to import into an oracle table, is there a way to use SQL Loader for this? If there is a better way, please recommend.
Thanks,
EdIf you do not have Foxpro, DBase IV or some other dbase clone to dump that dbf file, you could load into M$ Access and dump to cvs file from there.
:p
Maybe you are looking for
-
Jobs with a startevent and starttime
hello, I'd like to plan a job in an abap program which is started when an event is raised or a certain timespan has passed. When planing the job by using the functionmodules job_open, job_submit and and job_close I can supply an event and a startdate
-
How do you stop all devices from going off when one is being called?
After most recent update for apple, all my devices are going off at the same time when only one is where the call is gong to. I have 2 iPhones, 3 iPads and an iPad mini and one newer iPod. Is there a way to stop this? It is kind of a pain.
-
Mac Pro Won't Boot from any HDD
My system: 2008 8-core Mac Pro running 10.6.8 Snow Leopard 4 HDDs installed, 2 of them are a striped RAID 0 that is the bootup volume, a couble of external hard drives (1 of them a bootable clone), a DVI display backed up with Time Machine; thanks fo
-
Insert or Update a target with no constraints
I am trying to figure out how to do an insert/update on a target table which doesn't have a constraint? In other words how to define a condition on this target table attribute to achieve this? please advice. ~Prabha
-
TS1424 Can't download a movie in iTunes. Error 8008. Anyone know how to fix?
I've tried a few different times to download a movie in iTunes -- it stops at the same point each time -- gives error 8008. I'm trying to figure out how to get tech help (without waiting for the iTunes Store receipt to do so). Still searching, but op