Database Adapter: Selecting all data from table
Hi All
I am new to SOA Suite and I am using Soa Suite version 10.1.3.1 and Jdev version 10.1.3.3. It is required to select data from one database using the database adapter and insert it in a table in another database. I implemented the flow using DBadapters select operation the problem is everytime I am running the instance it transfers only one row though no condition has been specified on the select. Could anyone please help me out and let me know how to transfer a complete table from one database to another using DBadapters and in a single instance.
Thanks
Well Stupid me, got the answer, I think m just at the begining of the learning curve.
Similar Messages
-
Selecting all data from employee where foreign key = null and show it in view
Hi guys i have view like following :
SELECT dbo.Nationality.NationalityName, dbo.Employee.DriverName, dbo.Employee.DriverID, dbo.Employee.NationalityID, dbo.Employee.ResidentNo,
dbo.Country.CountryName, dbo.Employee.CountryID, dbo.Branch.BranchName, dbo.Employee.BranchID, dbo.Employee.JoinDate,
dbo.Employee.ResignDate, dbo.Employee.HealthCarNo, dbo.Employee.JobID, dbo.Jobs.JobName, dbo.Department.DepartmentName,
dbo.Jobs.DepartmentID, dbo.Employee.PlaceIssue, dbo.Employee.Deduction, dbo.Employee.ExpireDateMedical, dbo.Employee.PolicyNumber,
dbo.Employee.Owner, dbo.Employee.Version, dbo.Employee.ExpireDateResident, dbo.Employee.Salary, dbo.Employee.SexID, dbo.Sex.SexType,
dbo.Sex.FlagSex, dbo.Employee.MiritialID, dbo.Miritial.MiritualStatus, dbo.Status.StatusType, dbo.Employee.StatusID, dbo.Employee.UnactiveReason,
dbo.Employee.BirthDate, dbo.Employee.DateToday, dbo.Employee.UserID, dbo.Employee.PassportNo, dbo.Employee.Period,
dbo.Employee.AccountNo, dbo.Employee.Bonus, dbo.Employee.AccountType, dbo.Employee.PlaceOfBirth, dbo.Employee.EmplyeeName,
dbo.Employee.ExpireDateresidentHijri, dbo.Employee.PassportDateStart, dbo.Employee.PassportDateExpire, dbo.Religon.ReligonName,
dbo.Employee.ReligonID
FROM dbo.Nationality INNER JOIN
dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID INNER JOIN
dbo.Country ON dbo.Employee.CountryID = dbo.Country.CountryID INNER JOIN
dbo.Branch ON dbo.Employee.BranchID = dbo.Branch.BranchID INNER JOIN
dbo.Jobs ON dbo.Employee.JobID = dbo.Jobs.JobID INNER JOIN
dbo.Department ON dbo.Jobs.DepartmentID = dbo.Department.DepartmentID INNER JOIN
dbo.Sex ON dbo.Employee.SexID = dbo.Sex.SexID INNER JOIN
dbo.Miritial ON dbo.Employee.MiritialID = dbo.Miritial.MiritialID INNER JOIN
dbo.Status ON dbo.Employee.StatusID = dbo.Status.StatusID INNER JOIN
dbo.Religon ON dbo.Employee.ReligonID = dbo.Religon.ReligonID
suppose i need to show all data from Employee table (NationalityName,BranchName,JobName) where
NationalityID =NULL OR BranchID=NULL OR JobID=NULL
WHAT I DO
Notes : I mean in topic(selecting all data from view not table
meaning i need to show all data in employee table by view
in case of forign key(any forign key)equal nullI think you need to change
FROM dbo.Nationality INNER JOIN
dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
to
FROM dbo.Nationality
LEFT JOIN
dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
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 -
Selecting all columns from table in a model query
I have written a model query which joins 4 tables, applies some rules and returns updated rows by selecting 4 columns out of this. Currently it works fine because all 4 columns are from MODEL aliases. Now I need to select 16 more columns in the same query but none of these columns is added in MODEL aliases. When I tried selecting these columns I got oracle error ORA - 32614. Can someone please guide me to include these columns in the same model query?
I tried couple of options but no luck. Here are those options for ready reference:
1. I cannot nest existing model query into another select because there are no columns avaiable to join in output of current query to map with other records.
2. I cannot include all 16 columns in MODEL aliases because some of these columns are actually output of user defined functions.
I am using Oracle database version 11g Release 11.2.0.1.0.
Edited by: Anirudha Dhopate on Jan 23, 2011 5:43 PMThank you Avijit for your reply. There is a syntax error on the ON in this part of the statement which I don't know how to fix - I tried messing around with another INNER JOIN but am not confident that I'm doing the right thing:
SENAlertType.SENAlertTypeIDONClassMember.ClassMemberStudentID
Thanks for your help! I will need to do some more bedtime reading on joins.
Daniel -
Select the data from table which inbteween as well as one field if satisfy
Tab1. entries are below
MANDT SLRNO BUKRS ORDNR FANLKL TANLKL
111 Ger 2 00110000 00110030
111 000013 Ger 1 00110000 00130000
111 000054 Ger 1 00110000 00130000
111 000055 Ger 2 00110000 00110030
111 000072 Ger 1 00110000 00130000
111 000073 Ger 1 00110000 00130000
111 000074 Ger 2 00110000 00110030
111 000075 Ger 2 00110000 00110030
111 000126 Ger 2 00160000 00160000
lv-assetclass = u201800110020u2019 this is and company code is the only values which I have.
which is inbetween 00110000 and 00110030
So my below select statement should always give me sy-subrc = 0.
select single FANLKL TANLKL
from Tab1
into (lv_var1, lv_var2)
where BUKRS = Lv_companycode
and ( FANLKL GE lv-assetclass and TANLKL LE lv-assetclass ).
if sy-subrc <> 0.
Codes are there.
Endif.
But it is giving sy-subrc = 4.So it satisfies the if statement and what ever the code part is there in ifu2026endif that is executed.
My requirement is if lv-assetclass is 00110000 or 00110030 or inbetween these two values 00110020 for all the sy-subrc = 0.Even 00120000 should also give me sy-subrc 0 as 6th line is having entry 00110000 00130000 and 00120000 is coming under this.it should give me Sy-subrc = 0 when I put lv-assetclass as 00110000 also.
Can any one help me out in his select statement.
Regards,
ParthaHi,
Change your Select Query as:
select single FANLKL TANLKL
from Tab1
into (lv_var1, lv_var2)
where BUKRS = Lv_companycode
and ( FANLKL LE lv-assetclass and TANLKL GE lv-assetclass ). -
Create a trigger to copy data from table A to table B
Hi,
I been trying with no success to create a trigger on table a , so when the user update or delete or insert data on that table, I would like to copy all data from table a to table b BEFORE, the statement execute, I am using Oracle database 10g XE. It's URGENT and I would appreciate any quick response.
Thank you in advance.> All what I needed to do is to copy / beckup the tableA before any changes done to the table
Why? You are not giving us a problem to look at, analyse, and assist with - you are giving us a solution. That solution says "backup table before changes are made".
This solution sounds very strange in the context of a RDBMS. Even stranger when dealing with relational design as one would use date and time to keep track of how data is changing.
This, and your implementation of the solution (using triggers and DDL inside it!), makes me question whether this solution is indeed at all a solution. I see flaws and problems all the way.
What happens if two users inserts at the same time into table A? Two truncates will be fired on table B. Then the entire contents of A (and not the changes) inserted into table B? Ridiculous...
Thus from my point of view, looking at what you have presented to the forum in this thread, you do not seem to have any grasp on how to correctly use a RDBMS, never mind use Oracle.
Ignorance is not a problem. It is fairly easily curable. Which is why I referred you to the manuals.
Alternatively, instead of asking the forum how to make a flawed solution works, how about instead telling us the actual problem you are trying to solve? -
Select data from table where field is initial
I have table that has 10 million records.
I want to select data from this table where certain date field is blank.
*SELECT * FROM table*
INTO TABLE internal table
WHERE PSTNG_DATE = BLANK.
Does anybody know how to select data from data base table when certain field is blank.
I cont select all data once and delete which i dont want, the table is big, it will blow up app server.
thanks in advance,
Sachin
Moderator: Pls do not lock the posting instead provide me the link, its disrespecting.Respect the forum rules and common sense, and you will be respected.
"how to select data from a database table when the field is blank" is very basic, and basic questions will be locked, because they have been asked many times and you can find the answer yourself with a little effort. There is nothing disrespectful about it.
Thread locked.
Thomas -
How to select data from table having date in timestamp
hi All,
I have table and having one field date in type (Timestamp(6))
Date Timestamp(6)
I want to select the data from this table for yesterday or current date or someother day
Please let me know the query for the same.
Regards
KumarDo you really have a column named "DATE"? That is a reserved word in Oracle-- you cannot (easily) use it as a column name
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engin
e options
SQL> create table abc (
2 date timestamp(6)
3 );
date timestamp(6)
ERROR at line 2:
ORA-00904: : invalid identifierIt wouldn't be helpful to have a column named DATE either.
If you have a table ABC and a column TABLE_TIMESTAMP_FIELD, you would simply do as Bruce has suggested
SELECT *
FROM abc
WHERE table_timestamp_field > systimestamp - 1will give you all rows from ABC where TABLE_TIMESTAMP_FIELD is from the last 24 hours. If you want all rows where TABLE_TIMESTAMP_FIELD was some time yesterday
SELECT *
FROM abc
WHERE table_timestamp_field >= trunc(systimestamp - 1)
AND table_timestamp_field < trunc(systimestamp)Justin -
How to select the data from a Maintainance View into an internal table
Hi All,
Can anybody tell me how to select the data from a Maintainance View into an internal table.
Thanks,
srinivas.HI,
You can not retrieve data from A mentenance view.
For detail check this link,
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
Regards,
Anirban -
To Select the data from two table one is transp table and onther is cluster
Hi All,
I want to select the data from two tables
Here i am giving with an example.
Fileds: kunnr belnr from bseg. table bseg
fields: adrnr from kna1 table: kna1.
Know i want to put these into one internal table based on kunnr and belnr.
Thanks in advance.
RameshHi,
U cant use joins on cluster table and BSEG is a cluster table so use FOR ALL ENTRIES for taht
refer this code
*& Form sub_read_bsak
text
--> p1 text
<-- p2 text
FORM sub_read_bsak.
*--Select data from BSAK Table
SELECT lifnr
augdt
augbl
gjahr
belnr
xblnr
blart
dmbtr
mwskz
mwsts
sgtxt
FROM bsak
INTO CORRESPONDING FIELDS OF TABLE it_bsak
WHERE belnr IN s_belnr
AND augdt IN s_augdt.
IF sy-subrc EQ 0.
*--Sort table by accounting document and vendor number
SORT it_bsak BY belnr lifnr.
ENDIF.
ENDFORM. " sub_read_bsak
*& Form sub_read_bseg
text
--> p1 text
<-- p2 text
FORM sub_read_bseg.
IF NOT it_bsak[] IS INITIAL.
*--Select data from BSEG table
SELECT belnr
gjahr
shkzg
kostl
hkont
ebeln
ebelp
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
FOR ALL ENTRIES IN it_bsak
WHERE belnr EQ it_bsak-belnr
AND gjahr EQ it_bsak-gjahr
AND shkzg EQ 'S'.
IF sy-subrc EQ 0.
*--Sort table by accounting document
SORT it_bseg BY belnr.
ENDIF.
ENDIF.
ENDFORM. " sub_read_bseg -
I cant back up my all data from database
how can i take backup my all data from database with large object library (blob)
when i want back up i writing this statement on "cmd"
exp dbas/dbas@ddds file=D:\dms\ddfm.dmp
so it's only just backup data without large object library, any table contain large object library it can't take it
so i would like take backup all data from databaseOracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
and i am used win7 32bit
when i want back up i writing this statement on "cmd"
exp dbas/dbas@ddds file=D:\dms\ddfm.dmp
so it's only just backup data without large object library, any table contain large object library it can't take it
so i would like take backup all data from database
Edited by: 940639 on Jun 27, 2012 12:35 AM -
Probel while selecting data from table
Hi,
As per my below code i want to select data from table AFKO where PLNBEZ = it_mat-matnr, and GETRI IS BLANK , but data is not comingin IT_AFKO
**********************CODE
select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
where PLNBEZ = it_mat-matnr
and GETRI = ' '.
regards,
zafarHi,
Try below code
select AUFNR RSNUM GAMNG PLNBEZ From AFKO into table it_afko for all entries in it_mat
where PLNBEZ = it_mat-matnr
and GETRI = '00000000'.
Hope you need the records for which GETRI is not updated.
Regards
Vinod -
Can a procedure select data from tables on other schemas?
Can a procedure select data from tables on other schemas?
If it is posible, which syntax should I use to identify the tables and schemas on the SELECT query?Yes , it is possible..unless the current user has the right privileges on others' db objects schema.
Now , as regards the syntax....
1) The more descriptive way is to use the format ... <owner_schema>.<obj_name>.
2) If you have declared public synonyms of other schema's objects then you can refer to them as just <obj.name>.... but the <owner_schema>.<obj_name> is not wrong.
3) If the db objects reside on another database you must have declared a db link.... then the syntax is <owner_schema>.<obj_name>@<db_link_name>.
Regards,
Simon -
Select data from table not in another table
Hi,
I want to select data from table A which is not in table B.
Currently I am doing:
select
snoA,
nameA,
dobA
from A
where snoA not in
(select snoB from A, B
where snoA = snoB
and nameA = nameB)
But above is very slow.
Can I do something like:
select
snoA,
nameA,
dobA
from A, B
where
EXCLUDE ( snoA = snoB and nameA = nameB)
Please note that I need the where condition on both the columns.
any help will be appreciated.
-- HarveyWhat are the approximate data volumes in A and B?
What is "very slow"?
What version of Oracle?
What is the query plan?
Without knowing anything about your system, my first thought would be to see if a NOT EXISTS happened to be faster for your data
SELECT snoA,
nameA,
dobA
FROM a
WHERE NOT EXISTS (
SELECT 1
FROM b
WHERE a.snoA = b.snoB
AND a.nameA = b.nameB )Of course, I'm not sure why you are joining A & B in your NOT IN subquery. It would seem like you would just need a correlated subquery, i.e.
SELECT snoA,
nameA,
dobA
FROM a
WHERE snoA NOT IN (
SELECT snoB
FROM b
WHERE a.snoA = b.snoB
AND a.nameA = b.nameB )That should be more efficient than the original query. The NOT EXISTS version may or may not be more efficient than the NOT IN depending on data volumes.
Justin -
Select max date from a table with multiple records
I need help writing an SQL to select max date from a table with multiple records.
Here's the scenario. There are multiple SA_IDs repeated with various EFFDT (dates). I want to retrieve the most recent effective date so that the SA_ID is unique. Looks simple, but I can't figure this out. Please help.
SA_ID CHAR_TYPE_CD EFFDT CHAR_VAL
0000651005 BASE 15-AUG-07 YES
0000651005 BASE 13-NOV-09 NO
0010973671 BASE 20-MAR-08 YES
0010973671 BASE 18-JUN-10 NOHi,
Welcome to the forum!
Whenever you have a question, post a little sample data in a form that people can use to re-create the problem and test their ideas.
For example:
CREATE TABLE table_x
( sa_id NUMBER (10)
, char_type VARCHAR2 (10)
, effdt DATE
, char_val VARCHAR2 (10)
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('15-AUG-2007', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0000651005, 'BASE', TO_DATE ('13-NOV-2009', 'DD-MON-YYYY'), 'NO');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('20-MAR-2008', 'DD-MON-YYYY'), 'YES');
INSERT INTO table_x (sa_id, char_type, effdt, char_val)
VALUES (0010973671, 'BASE', TO_DATE ('18-JUN-2010', 'DD-MON-YYYY'), 'NO');
COMMIT;Also, post the results that you want from that data. I'm not certain, but I think you want these results:
` SA_ID LAST_EFFD
651005 13-NOV-09
10973671 18-JUN-10That is, the latest effdt for each distinct sa_id.
Here's how to get those results:
SELECT sa_id
, MAX (effdt) AS last_effdt
FROM table_x
GROUP BY sa_id
; -
Hi all,
I am using function module through Call fucntion.
There i am getting <b>Table Name</b> as import Parameter.
Now i need to fetch data from that table (Which name we got througfh function module).
Is there any point to know how can we fetch data from runtime table .
i need some sample code for this.
Thanks inn advance,
Regards,
BhaskarHello Bhaskar,
I don't have an SCM system, so I cannot test out that FM
However, I modified the above code to update the table as well
*& Report ZKRIS_DYNAMIC_TABLE_READ_MOD
REPORT ZKRIS_DYNAMIC_TABLE_READ_MOD LINE-SIZE 256.
DATA : LV_FIELD_DESC TYPE STRING.
DATA : LV_DATA1 TYPE STRING.
DATA : LV_DETAIL(128).
DATA : COMMA TYPE C VALUE ','.
DATA : LV_TNAME LIKE DD02L-TABNAME.
DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
DATA : DREF TYPE REF TO DATA.
DATA : FLAG_MODIFIED. " determines if database needs to be updated
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE, " used to store dynamic tables
<WA> TYPE ANY, " used to store record data
<WA1> TYPE ANY . " used to store field data
* call Fm /SAPAPO/TS_PA_COPY_TABLE_GET here
LV_DBTAB1 = 'ZGSTSET'. " <-- put your table name here
DATA: IT_FIELDS TYPE X031L OCCURS 0.
DATA: WA_FIELDS LIKE LINE OF IT_FIELDS.
CALL FUNCTION 'DDIF_NAMETAB_GET'
EXPORTING
tabname = LV_DBTAB1
* ALL_TYPES = ' '
* LFIELDNAME = ' '
* GROUP_NAMES = ' '
* UCLEN =
* IMPORTING
* X030L_WA =
* DTELINFO_WA =
* TTYPINFO_WA =
* DDOBJTYPE =
* DFIES_WA =
* LINES_DESCR =
TABLES
X031L_TAB = IT_FIELDS
* DFIES_TAB =
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* we do not know the sized of the table that must be generated beforehand
* hence we use field symbols to dynamically generate the internal table
CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN DREF->* TO <ITAB> .
* selects all data
SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> .
LOOP AT <ITAB> ASSIGNING <WA>.
FLAG_MODIFIED = ''.
LOOP AT IT_FIELDS INTO WA_FIELDS.
ASSIGN COMPONENT WA_FIELDS-FIELDNAME OF STRUCTURE <WA>
TO <WA1>.
IF WA_FIELDS-FIELDNAME = 'FIRSTNAME'. " fieldname in the table you wish to modify
IF <WA1> = 'Kris'. " old value
<WA1> = 'NewName'. " new value
MODIFY TABLE <ITAB> FROM <WA>.
FLAG_MODIFIED = 'X'.
ENDIF.
ENDIF.
WRITE <WA1>. " comment this line to remove the display
ENDLOOP.
IF FLAG_MODIFIED = 'X'. " updates database only if the record was changed
UPDATE (LV_DBTAB1) FROM <WA>.
* note that if the field you choose is a key field, sy-subrc will be set to 4
ENDIF.
* display
NEW-LINE.
ENDLOOP.
Maybe you are looking for
-
Apex application registered as an external application to Portal 10.2
I am having trouble doing this. I have followed this document http://www.oracle.com/technology/products/database/application_express/howtos/htmldb_as_external_app.html And when I click on the link I end up with a blank page. Any advise?
-
AUDIGY 4 PRO PROBLEM WITH I/O
NEW MEMBER Just purchased a AUDIGY 4 PRO sound card, card works GREAT, however the external I/O hub which is connected via a multiconductor cable from the sound card, appears to be DEAD, no LED indicator light come on;, when the headset is pluged int
-
Can I change a field that is displayed on a Purchase Order Message Output
I have read on a couple message threads that have stated that it is not recommended to change the length of a field on a purchase order. If I am unable to change a field length, can I instead use another field that is long enough to fit in the info
-
Extract customer master partner functions.
Hi , We are generating an sales order extract we also need to provide customer details.I understand that the customer address data should read from transactional ADRC table.Could you please suggest which ship-to address should be put in the custome
-
I feel like an idiot because I can't figure this out. I know this cannot be as tricky as it seems to be. We've got an index where the letters are in front of blocks of color. The entire line is highlighted. I cannot figure out how to turn the color o