Get data with more than one table
hi Gurus,
I am from ABAP and now am doing Crystal reports...please bear with me if am silly.
in ABAP I have developed a report based on my select statement.
ex : **SELECT SINGLE * FROM cabn WHERE atnam EQ 'Z10_OPS_INC_REGION'.**
CLEAR ausp_objek.
CONCATENATE cciht_ihva-recn cciht_ihva-actn INTO ausp_objek.
CLEAR ausp.
now i have value in ausp_objek based on this i gone to other table to get the ausp-atwrt
SELECT DISTINCT atwrt FROM ausp
INTO CORRESPONDING FIELDS OF TABLE lt_ausp
WHERE objek EQ ausp_objek
AND atinn EQ cabn-atinn
so i have value in lt_ausp-atwrt which i wanted..
so in CRYSTAL How does this work???...i have linked the tables but it is not a direct value from single table...at this point how do we get the desired results...
hope am clear...
thank you,
pasala.
Hi Pasala,
Nothing silly about it... We have a forum called SAP integration Kit which is both familiar with ABAP and CR so I moved your post to that forum.
Try searching on the home page for this forum on "ABAP" and you'll find lots of examples and suggestions and of course others will help too.
Don
Similar Messages
-
JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC
Hi,
I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
Regards
KumarHI,
Yes it can be possible ,please see the following links
JDBC Receiver with Oracle Stored Procedures
configuring jdbc adapter with multiple tables
RFC -> XI -> JDBC Scenario Updating Multiple Tables
/people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
JDBC Adapter multiple Selects
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
Regards
Chilla.. -
Get the data with more than one of the desired value
Hi,
I need to pull the records with more than one value of 'Other' on the delivery days fields.
The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
Here is the Sample data:
cust_id: 123
item: newspaper
mon: Home
tue:Work
wed: Other
thu: Home
fri: Other
sat: Other
And here is my query so far.
select
cust_id,
item,
mon,
tue,
wed,
thu,
fri,
sat,
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
else 0 end) as day_ctr
from customer
Could you please help me with the right formula I need to get this?
Thank you in advance..First
DESC customer
Second
Can you explain what you are trying with
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
Third
Usually it's helpful a example of the result you want...
Perhaps you want this
select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
select
COUNT(DISTINCT mon) mon,
COUNT(DISTINCT tue) tue,
COUNT(DISTINCT wed) wed,
COUNT(DISTINCT thu) thu,
COUNT(DISTINCT fri) fri,
COUNT(DISTINCT sat ) sat
from customer
) -
Simple journalization with more than one table
Hello,
I wanted to journalize more than one table with a simpe journalization?
is it possible?
I confgured my OdiWaitForLogData like that:
OdiWaitForLogData "-CONTEXT=GLOBAL" "-GLOBAL_ROWCOUNT=2" "-LSCHEMA=employe" "-OPTIMIZED_WAIT=AUTO" "-POLLINT=2000" "-SUBSCRIBER_NAME=SUNOPSIS" "-TIMEOUT=0" "-TIMEOUT_WITH_ROWS_OK=YES" "-UNIT_ROWCOUNT=1" "-TABLE_NAME=Departement,Employe"
when I executed my interface, my interface is still at the step running.
what happened please?
Thanks
BillyroseHello,
I wanted to journalize more than one table with a simpe journalization?
is it possible?
I confgured my OdiWaitForLogData like that:
OdiWaitForLogData "-CONTEXT=GLOBAL" "-GLOBAL_ROWCOUNT=2" "-LSCHEMA=employe" "-OPTIMIZED_WAIT=AUTO" "-POLLINT=2000" "-SUBSCRIBER_NAME=SUNOPSIS" "-TIMEOUT=0" "-TIMEOUT_WITH_ROWS_OK=YES" "-UNIT_ROWCOUNT=1" "-TABLE_NAME=Departement,Employe"
when I executed my interface, my interface is still at the step running.
what happened please?
Thanks
Billyrose -
Submitting data to more than one table
I want to be able to use one form to submit data to two or
more tables in the same database. Does anyone know if this is
possible and if so how would I go about it. I understand how to use
a form to submit to one table I am just stuck on more than one.
I am using Access 2000 and DW MX 2004
thanks in advanceIt's usually best to use a stored procedure to handle
this. -
Block with more than one table type agurment - Update Procedure for Block
Hi,
I have one form with 3 Block. First Block is single row block, and other 2 are details block . The details balocks are based on the Procedure datasource, because of the complex query conditions. Now my requirement is When Inserting / Updating the Master Block (Single Row Block), I need to get the values in the two details block , because I need to update some other tables also based on these values. I created a procedure with two Table Type parameters (for each details block) , but when I using this procedure as the Update Procedure Name in the block, I am getting the error Only One table type arguement is allowed. Is there any other method to implement this.
Thanks in advance.Rizly,
A quick summary to make sure I understand your requirements. You have a single row base table master block with two detail blocks that are based on Procedures. When you update the single row base table master block, you need all of the data in the two procedure based detail blocks as there are updates that you have to perform to other tables that use this data. You have created a stored procedure that take two PL/SQL tables as parameters, but you are getting the error that only 1 table parameter is allowed.
I need to ask you a few questions first. What is your Forms version? The stored procedure you created; are you using this procedure in the "On-Insert, On-Update, On-Delete" triggers or do you call the procedure in one of the Base Table block ("Key-Commit, When-Button-Pressed" or other trigger)? When you modify or add a new Master block record are you adding values to the detail blocks or using values from the previous Master block record?
If you are using your procedure in the On-Insert, On-Update or On-Delete trigger(s), then based on your description, the error you are receiving is correct. The "On-..." triggers are constrained in that their procedures expect only a single PL/SQL table, Table of Records or Ref Cursor as a parameter. This is a Forms constraint - not a PL/SQL constraint as Forms is expecting you to only perform actions on the block where the "On-..." Trigger is located.
Perhaps you should consider creating a database Package that has two package specification constructs (Ref Cursor, Table of Records, etc) you can populate from Forms and then simply call the package procedure that will use the Ref Cursors to perform the needed update or inserts.
Hope this helps.
Craig...
If mine or someone elses response was helpful, please mark it accordingly -
LoadFromDatasource with more than one table
Hi,
I want to fill a matrix with the items. I need the columns itemcode, itemdescription and Manufacturer. It is no problem to initalize a recordset, do a query with a joining between the tables OITM (items) and OMRC (manufacturers) and fill the matrix by running through the recordset. But this is too slow.
With the help of "LoadFromDatasource" it is much more faster. But my datasource is the table OITM. I do not have the information of the manufacturers name, because the table OITM only holds the manufacturers code. In other words: I do not want to see 1, 2, 3 and so on in the column for manufacturer, but I want to see the manufacturers name (from the table OMRC) instead. How can I realize this? Any ideas?
thanks and regards,
Markus NiebergallHi Adele,
thanks for your answer. This is not, what I wanted to hear But now I´m sure that I have to do it with an additional UserDataSource.
Thanks,
Markus -
Retriving data from more than one table
I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.
926085 wrote:
I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.You can check the table_name where column value is present by
select table_name, AVG_COL_LEN from user_tab_columns where column_name='ID' and AVG_COL_LEN != 0;You'll get the results if you have all these table analyzed -
Creating Table View's with more than one table
I have two custom tables.
Table A has 2 fields: Code and Description
Table B has 4 fields: Code, Country, Emp Group and Personnel Area
I would like to build a view which has: Code, Description, County, Emp Group and Personnel Area. This view should be able to pull in the Description from Table A when the user enters in the Code.
I have created a view with SE11 and have put both Table A and B with joins as follows: A Code = B Code. Under the view fields I have put the fields B.Code, A. Description, B.Country, B.Emp Group and B.Personnel Area.
When I generate this view (Utilities, Table Maintenance Generator) it only shows the Code and Description field. It does pull in the Description automatically which is great. The issue is 2 things 1) The Description can be changed and 2) The other fields I specified above are not included on the view (e.g., Country etc.)
Any ideas?I have checked several times that it is against the view as it is so strange that not all of the fields are appearing.
I go into SE11, Click on View, Type in the View Name and then Change. I goto into Utilities, Table Maintenance Generator and select it as one Step and then click on the Create Button. When I go into SM30 I only see the 2 fields? -
How to get albums with more than one artist to show as one album?
All of my iTunes purchased classical music CDs appear as 4 sometimes more albums on imatch. How do I get them to show as a single album?
Hi,
I use the composer in Album Artist fields.
Jim -
Looking data from more than one table and inserting into another.
Hello,
I am giving you the Table structures as per my requirement..
CREATE TABLE TEMP_A
(NAME VARCHAR2(100) primary key);
CREATE TABLE TEMP_B
(STRUCTURE VARCHAR2(10));
CREATE TABLE TEMP_C
( NAME VARCHAR2(100),
STRUCTURE VARCHAR2(10),
VALUE VARCHAR2(10));
Alter table TEMP_C
add constraint fk_name_tempc foreign key(name) references TEMP_A(name)
INSERT INTO TEMP_A VALUES('SMITH');
INSERT INTO TEMP_A VALUES('ALLEN');
INSERT INTO TEMP_A VALUES('WARD');
INSERT INTO TEMP_A VALUES('JONES');
COMMIT;
INSERT INTO TEMP_B VALUES('IN');
INSERT INTO TEMP_B VALUES('IN_MIN');
INSERT INTO TEMP_B VALUES('IN_TYP');
INSERT INTO TEMP_B VALUES('IN_MAX');
INSERT INTO TEMP_B VALUES('DIP');
INSERT INTO TEMP_B VALUES('TIM');
COMMIT;
INSERT INTO TEMP_c VALUES('SMITH','C1','');
INSERT INTO TEMP_c VALUES('SMITH','C2','');
INSERT INTO TEMP_c VALUES('SMITH','D1','');
INSERT INTO TEMP_c VALUES('ALLEN','D2','');
INSERT INTO TEMP_c VALUES('ALLEN','R1','');
INSERT INTO TEMP_c VALUES('WARD','R2','');
COMMIT;
i want to say is it should insert into table 'TEMP_C' values as :
For 'SMITH' there should be (6 * 3) = 18 records.
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C1')
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'C2')
( 6 distinct values of TEMP_B for SMITH to be inserted into TEMP_C against 'D1')
For 'ALLEN' there should be (6 * 2) = 12 records.
( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'D2')
( 6 distinct values of TEMP_B for ALLEN to be inserted into TEMP_C against 'R1')
For 'WARD' there should be (6 * 1) = 6 records.
( 6 distinct values of TEMP_B for WARD to be inserted into TEMP_C against 'R2')
Like this if there are records for JONES also , it should also do the same way( Depending on the No. of records present
in the table 'TEMP_C' for 'JONES').
Thanks in advance,
AmkotzIs this what you are looking for?
SQL> insert into temp_c (name, structure, value)
2 select c.name, c.structure, b.structure
3 from temp_a a, temp_c c, temp_b b
4 where a.name = c.name
5 ;
36 rows created.
SQL> select * from temp_c;
NAME STRUCTURE VALUE
SMITH C1
SMITH C2
SMITH D1
ALLEN D2
ALLEN R1
WARD R2
SMITH C1 IN
SMITH C1 IN_MIN
SMITH C1 IN_TYP
SMITH C1 IN_MAX
SMITH C1 DIP
SMITH C1 TIM
SMITH C2 IN
SMITH C2 IN_MIN
SMITH C2 IN_TYP
SMITH C2 IN_MAX
SMITH C2 DIP
SMITH C2 TIM
SMITH D1 IN
SMITH D1 IN_MIN
SMITH D1 IN_TYP
SMITH D1 IN_MAX
SMITH D1 DIP
SMITH D1 TIM
ALLEN D2 IN
ALLEN D2 IN_MIN
ALLEN D2 IN_TYP
ALLEN D2 IN_MAX
ALLEN D2 DIP
ALLEN D2 TIM
ALLEN R1 IN
ALLEN R1 IN_MIN
ALLEN R1 IN_TYP
ALLEN R1 IN_MAX
ALLEN R1 DIP
ALLEN R1 TIM
WARD R2 IN
WARD R2 IN_MIN
WARD R2 IN_TYP
WARD R2 IN_MAX
WARD R2 DIP
WARD R2 TIM
42 rows selected.
SQL> -
Crystal Report - More than one table from MySql
Hello, I am in need of help big time.
I have am using Visual Studio 2010 and Crystal Report 10.
The problem that I am incounting is that I am unable to retreive data from more than one table from a MySql database. I have been stuck on this for too long and need to hjump the hurdle.
I am using a MySql connection string, a dataset and a crystal report which is based on the dataset.
The main error that I am having is, the browser opens and a form appears saying "The report you requetsed requires further information" With the Server name: DataSetPropertiesDetials, while the User name and Password fields are then enabled.
I am guessing I am missing something in my code.
When I retreive data from one table the report is fine, but when I try to use more than one table it throws the error.
My Code is below and also attached:
Imports System.Data.SqlClient
Imports System.Configuration
Imports MySql.Data.MySqlClient
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Web
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim con As MySqlConnection
Dim rpt As New CrystalReport3()
Dim myReport As New ReportDocument
Dim myData As New DataSet
Dim cmd As New MySqlCommand
Dim cmdUser, cmdProperty, cmdBranch As New MySqlCommand
Dim daBranch, daProperty, daUser As New MySqlDataAdapter
con = New MySqlConnection()
'Connection String
con.ConnectionString = "Server=****;Database=***;UID=***;Password=****"
Try
con.Open()
cmdBranch.CommandText = "SELECT branch FROM tblbranch"
cmdBranch.Connection = con
daBranch.SelectCommand = cmdBranch
daBranch.Fill(myData)
cmdProperty.CommandText = "SELECT ref, keys_held, key_no, keys_out, no_name, address_line1, address_line2,key_label FROM tblproperty"
cmdProperty.Connection = con
daProperty.SelectCommand = cmdProperty
daProperty.Fill(myData)
cmdUser.CommandText = "SELECT known_name FROM tbluser"
cmdUser.Connection = con
daUser.SelectCommand = cmdUser
daUser.Fill(myData)
myReport.Load("REPORT LOCATION")
myReport.SetDataSource(myData)
myReport.Database.Tables(0).SetDataSource(myData.Tables(0))
CrystalReportViewer1.ReportSource = myReport '
Catch myerror As MySqlException
MsgBox(myerror.Message)
End Try
End Sub
End ClassHi,
You have 3 SQL commands but you are calling SetDataSource only once. You need to look through for each of the SQL Commands.
Good luck,
Brian -
Error while running spatial queries on a table with more than one geometry.
Hello,
I'm using GeoServer with Oracle Spatial database, and this is a second time I run into some problems because we use tables with more than one geometry.
When GeoServer renders objects with more than one geometry on the map, it creates a query where it asks for objects which one of the two geometries interacts with the query window. This type of query always fails with "End of TNS data channel" error.
We are running Oracle Standard 11.1.0.7.0.
Here is a small script to demonstrate the error. Could anyone confirm that they also have this type of error? Or suggest a fix?
What this script does:
1. Create table object1 with two geometry columns, geom1, geom2.
2. Create metadata (projected coordinate system).
3. Insert a row.
4. Create spacial indices on both columns.
5. Run a SDO_RELATE query on one column. Everything is fine.
6. Run a SDO_RELATE query on both columns. ERROR: "End of TNS data channel"
7. Clean.
CREATE TABLE object1
id NUMBER PRIMARY KEY,
geom1 SDO_GEOMETRY,
geom2 SDO_GEOMETRY
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
'OBJECT1',
'GEOM1',
2180,
SDO_DIM_ARRAY
SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
'OBJECT1',
'GEOM2',
2180,
SDO_DIM_ARRAY
SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
CREATE INDEX object1_geom2_sidx ON object1(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
SELECT *
FROM object1
WHERE
SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
SELECT *
FROM object1
WHERE
SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE' OR
SDO_RELATE("GEOM2", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
DELETE FROM user_sdo_geom_metadata WHERE table_name = 'OBJECT1';
DROP INDEX object1_geom1_sidx;
DROP INDEX object1_geom2_sidx;
DROP TABLE object1;
Thanks for help.This error appears in GeoServer and SQLPLUS.
I have set up a completly new database installation to test this error and everything works fine. I tried it again on the previous database but I still get the same error. I also tried to restart the database, but with no luck, the error is still there. I geuss something is wrong with the database installation.
Anyone knows what could cause an error like this "End of TNS data channel"? -
Create a logical column with more than one data source
I'm having a problem to create a logical column with more than one data source in Siebel 7.8.
What I want to do is the union of 2 physical tables in one logical table.
For example, I have a "local_clients" table and a "abroad_clients" table. What I want is to have a logical table "clients" with the client data from the 2 tables.
What I've tried is dragging the datasources I need onto the logical column.
However this isn't working because it only retrieves the data from the first data source.Hi!
I think it is not possible to do this just by dragging the columns to the logical table. A logical table can have more than one source, but I think each column must have just one direct source column.
I'm not sure, but maybe you should do the UNION SQL to get the data of the two tables. In the physical layer, when you create a new physical table, it's possible to set the "table type" as a "SELECT". I didn't try that, but it seems that it's possible to have the union table in the physical layer.
Bye.
Message was edited by:
user578388 -
Spatial index creation for table with more than one geometry columns?
I have table with more than one geometry columns.
I'v added in user_sdo_geom_metadata table record for every column in the table.
When I try to create spatial indexes over geometry columns in the table - i get error message:
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13203: failed to read USER_SDO_GEOM_METADATA table
ORA-13203: failed to read USER_SDO_GEOM_METADATA table
ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
ORA-06512: at line 1
What is the the solution?I'v got errors in my user_sdo_geom_metadata.
The problem does not exists!
Maybe you are looking for
-
How can I split a Lightroom 3 catalog? And join two together...
I've mistakenly done a lot of work on a lot of images in the 'wrong' Lightroom catalog. I'm primarily a sports photographer and have all my sports stuff in one catalog and the non-sports stuff in another. And I've put a major sports event - 8000 phot
-
Using JPDA in Solaris, accept error...
I downloaded the JPDA stuff and installed it. I have extended my PATH and LD_LIBRARY_PATH to include the new bin and lib/sparc respectively. When I do java -Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,server=y,suspend=y Classn
-
Is there anyway i can update subtotal KZWI6 with a value, becasuse of a configuration mistake in the pricing procedure the system took zero value into the sub-total for certain invoices.
-
Hello All, I am facing two issues. One is sometimes when I login to Portal with admin id, it prevents me from displaying contents under the content administration. The reason being a Javascript error at the left bottom of the browser page access deni
-
Anonymous user on 7.0 EHP1 SP07
Dear all, I've started the development of an anonymous accessible Portal using NW 7.0 EHP1 SP03, so the all configurations was been done and it was working well, after update for SP07, the anonymous user can't show the contents, the note 837898 was f