Using another database table in a query
Hi,<BR><BR>Iam designing a report in which i have to use a table from another database<BR><BR>my query is <BR><BR>select ev_class_id,ev_id,desc,start_time from tev where start_time > today<BR><BR> and (desc like \'%f\' or desc like \'%m\' or desc like \'%yds\')<BR><BR> and ev_id not in(selct ev_id from ppbrio:race_length)<BR><BR> and ev_class_id = 23<BR><BR> union<BR><BR> select ev_class_id,ev_id,desc,start_time from tev where start_time > today<BR><BR> and ev_id not in (select ev_id from ppbrio:race_length)<BR><BR> and ev_class_id in (3,129,131,132)<BR><BR>"open bet" is a databse am using to design query and have to use a table from ppbrio(pp_race_length)<BR><BR>can some body tell me how to do this.<BR><BR>rajani<BR><BR><BR>
Put it in the post-query trigger. Post-change is there only for backward compatibility.
Similar Messages
-
Im wondering if i can use another database for the workflow engine. I mean it comes with a database managment by default i want to know if a can use another one (SQL server)
Hi,
We have been using jtds driver , which is free and the fastest and without any bugs until now, we have been using it for 4 months now.
The part below explain how to set up your mssql server with jtds driver.
create a db lets call is bpel
then run these queries on it. basically to create the tables, these files are
domain_sqlserver.ddl
server_sqlserver.ddl
workflow_sqlserver.sql
sensor_sqlserver.sql
located at
/OraBPELPM_1/integration/orabpel/system/database/scripts
After that download the jtds driver for sql server.
We do not use the microsofts jdbc driver for mssql, although we have tried it.
It doesnt work properly, with the bpel process manager, basically it has some problem with select image and blob types from DB.
Anyways, the best one we found was for jtds, it works great and is the fastest I beleive.
We used data direct's jdbc driver but its not free and after doing some benchmark tests we found jtds was the fastest.
mkdir -p jdbc/jTDS/unzip
cd jdbc/jTDS/unzip
download the jtds-1.2-dist.zip from
wget http://surfnet.dl.sourceforge.net/sourceforge/jtds/jtds-1.2-dist.zip
unzip jtds-1.2-dist.zip
cd unzip
cp jtds-1.2.jar OraHome_1/integration/orabpel/system/appserver/oc4j/j2ee/home/applib/
You will now have to configure MsSQL in your data-sources.xml file.
Microsoft SQL Server Database Configuration
Oracle Bpel now needs to be configured to use Microsoft SQL Server, using the JDBC drivers.
cd OraHome_1/integration/orabpel/system/appserver/oc4j/j2ee/home/config/
vi data-sources.xml
You must then place the following xml within the file:
<data-source class="net.sourceforge.jtds.jdbcx.JtdsDataSource"
name="BPELServerDataSource"
location="jdbc/BPELServerDataSourceWorkflow"
xa-location="BPELServerDataSource"
ejb-location="jdbc/BPELServerDataSource"
connection-driver="net.sourceforge.jtds.jdbc.Driver"
username="BPEL_user"
password="bpeluser!">
<property name="serverName" value="server_name"/>
<property name="databaseName" value="database_name"/>
<property name="portNumber" value="1433"/>
</data-source>
<data-source class="net.sourceforge.jtds.jdbcx.JtdsDataSource"
name="AdminConsoleDateSource"
location="jdbc/AdminConsoleDateSource"
xa-location="AdminConsoleDateSource"
ejb-location="jdbc/AdminConsoleDateSource"
connection-driver="net.sourceforge.jtds.jdbc.Driver"
username="user_name"
password="password">
<property name="serverName" value="server_name"/>
<property name="databaseName" value="database_name"/>
<property name="portNumber" value="1433"/>
</data-source>
<data-source class="net.sourceforge.jtds.jdbcx.JtdsDataSource"
name="BPELSamplesDataSource"
location="jdbc/BPELSamplesDataSource"
xa-location="BPELSamplesDataSource"
ejb-location="jdbc/BPELSamplesDataSource"
connection-driver="net.sourceforge.jtds.jdbc.Driver"
username="user_name"
password="password">
<property name="serverName" value="server_name"/>
<property name="databaseName" value="database_name"/>
<property name="portNumber" value="1433"/>
</data-source>
Run the BPEL server and everything should work fine. -
Tool to create Java Object classes using the Database Tables
Hi,
Is their any tools or utility available to create the Java Object Classes using the Database Tables as input.
Lets Say I am having the Employee, Employee_Salary tables in the Database.The utility has to create the Java Object classes with the relation.
Please Help...
Thx..Hm, for generating regular Java classes I wouldn't know one from memory. But I suggest you start searching in for example the Eclipse marketspace for a third party plugin that can do it. If all fail, you could always use Hibernate Tools from the Jboss Tools Eclipse plugin set to generate Hibernate/JPA entities and then strip the annotations from them to turn them into regular POJO classes.
How many tables are we talking about anyway? It might be less effort to just create the classes with properties and then use an IDE to generate getters and setters for them. -
Can't use parameter in query if using another database
Hi there, I logged on SAP Business one for company A, and try to run the following query:
select t0.field1 from \[company b\].\[dbo\].\[table1\] t0
where t0.filed2 = '\[%0\]'
And I got errors.
If '\[%0\]' is replaced by a real value it works.
select t0.field1 from \[company b\].\[dbo\].\[table1\] t0
where t0.filed2 = 1234
So you can't use parameters in a query if you're using a database that is not your current company?
Thanks.
Edited by: Leslie Woodward on Feb 22, 2010 7:40 PMThat is right. All data have to be in the same company to use '[%\]' variables.
Thanks,
Gordon -
How to use another database schema in Dictionary project
Problem description:
1) I want to use Developer Studio to create my own J2EE project. Then I have to use Dictionary Project to maintain my database. My database is Oracle.
2) I created tables in Dictionary project and deployed to database
3) After that I found my tables were deployed into SAPSR3DB schema.
Question:
What can I do if I want to deploy my tables into another schema other than SAPSR3DB? In real cases I want to separate my tables from the WAS system tables.Hi Chaoran,
If you want to use external database with Java dictionary tables..
Right click on the Java Dictionary Table, from the menu select <b>Create DDL script</b>, then select to which data base you want to generate scripts. It will generate .sql scripts, use this scripts in your database to create tables. But the same time you need to create Data sources in Visual Administrator for your oracle system.
Regards
Abhilash -
Update another database table in Background
Hi Experts,
Need a solution to update an Oracle(10g) database which is outside of SAP box run as background job on a daily basis- for e.g. daily Sales Orders should be updated in oracle table.
Proposal 1: write direct to oracle tables using secondary database connection concept in ABAP.
Proposal 2: expose a service from SAP and consume in Oracle.
Proposal 3: engage XI/PI inbetween.
Are there still more options suits this particular case? What are the measures that needs to be taken on account of performance?
anticipating suggestions and guidence,
-Nikhil BoseHi Marea,
pls check the documentation and the javadoc for jco
http://service.sap.com/connectors
example:
function = this.createFunction("BAPI_MATERIAL_GETLIST");
if (function == null) {
System.out.println(
"BAPI_MATERIAL_GETLIST" + " not found in SAP.");
System.exit(1);
codes = function.getTableParameterList().getTable("MATNRSELECTION");
codes.appendRows(2); // Add two rows to internal table
codes.setValue("I", "SIGN");
codes.setValue("EQ", "OPTION");
codes.setValue("P1001087", "MATNR_LOW");
codes.setValue("", "MATNR_HIGH");
codes.nextRow(); // Move onto next row
codes.setValue("I", "SIGN");
codes.setValue("EQ", "OPTION");
codes.setValue("P1001088", "MATNR_LOW");
codes.setValue("", "MATNR_HIGH");
mConnection.execute(function);
Regards, Jens -
Create Materialized View based on another database table using db link?
SQL> SELECT sysdate
2 FROM dual@CBRLINK ;
SYSDATE
21-NOV-12
SQL> CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
2 REFRESH COMPLETE
3 START WITH SYSDATE NEXT SYSDATE + (5/24)
4 AS
5 SELECT sysdate
6 FROM dual@CBRLINK ;
CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
ERROR at line 1:
ORA-04052: error occurred when looking up remote object SYS.DUAL@CBRLINK
ORA-00600: internal error code, arguments: [ORA-00600: internal error code,
arguments: [qksfroFXTStatsLoc() - unknown KQFOPT type!], [0], [], [], [], [],
ORA-02063: preceding line from CBRLINKIt works for me:orcl>
orcl> CREATE MATERIALIZED VIEW scott.V_T24_COUNTRY1
2 REFRESH COMPLETE
3 START WITH SYSDATE NEXT SYSDATE + (5/24)
4 AS
5 SELECT sysdate
6 FROM dual@l1 ;
Materialized view created.
orcl> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
orcl>so there is no problem with the code. HTH. -
I have a requrement for creating a report based on what the user
inputs through the parameter form. I have a form in which the
user enters his Intial Amount,Interest rate and the Number of
Instalments. Depending on the Number of Instalments I would like
to print no of rows accordingly.(i.e. If the user enters 12
instalments then 12 rows shopuld be displayed). I would like to
accomplish this without using a query. ie. I tried this using a
formula column but only one row is printed. Is there any way out
to print the no of rows based on the user inputs.
Thanking in advance.hi,
u can display grand total using list also.
use do_sum property of Fieldcat it using for summation
Message was edited by:
Dhwani shah -
Delete records from internal table using another internal table
HI,
I have two internal tables itab1 and itab2 which have same records initially.Later some records of itab2 are deleted .Then i want to delete those records from itab1 also ie,those records not found in itab2 .Is there any method other than looping.
So that itab1 again becomes equal to itab2.
Thanks in advance.
Sowmya.Soumya,
Itab1 , Itab2 .
Before deleting the records from itab2 move those records to one more internal table itab3.
Now you have deleted records of itab2 in itab3.
SORT ITAB3,ITAB1 by your main key field.
LOOP AT itab3.
READ TABLE ITAB1 WITH KEY key field = itab3-
keyfield.
IF sy-subrc EQ 0.
DELETE itab1 where keyfield eq itab3-keyfield.
ENDIF.
ENDLOOP. -
Dynamic Internal table using another internal table values
Hello All,
I have an internal table ITAB1, which will get populated inside the program. This ITAB1 will have only one field.
I want to create an internal table dynamically with the values of ITAB1( single field internal table ) as fields.
Thanks in advance.
Best Regards,
Sasidhar Reddy Matli.at this wiki
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/individualcellcoloringindynamic+alv
you can find an example where I build an internal table
you can look at the coding where I loop though the internal table and at the value to the fieldname.
* dynamic fields
LOOP AT ta_pernrs INTO wa_pernrs.
WRITE wa_pernrs-pernr TO h_ri_pernr.
is_lvc_cat-fieldname = wa_pernrs-pernr.
is_lvc_cat-ref_field = 'massn'.
is_lvc_cat-ref_table = 'PERNR'.
is_lvc_cat-just = 'C'.
CONCATENATE it_0002-inits it_0002-nachn(1) INTO is_lvc_cat-scrtext_s SEPARATED BY space.
CONCATENATE it_0002-inits it_0002-nachn INTO is_lvc_cat-scrtext_m SEPARATED BY space.
CONCATENATE it_0002-inits it_0002-nachn INTO is_lvc_cat-scrtext_l SEPARATED BY space.
APPEND is_lvc_cat TO it_lvc_cat.
and then ofcourse the creation of the table which is also mentioned in the earlier reply
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_lvc_cat
IMPORTING
*ep_table = ta_output.*** Create a new Line with the same structure of the table.
ASSIGN ta_output->* TO <ta_output>.*
CREATE DATA new_line LIKE LINE OF <ta_output>.
ASSIGN new_line->* TO <l_line>.
kind regards
arthur de smidt -
How to update two database tables when using DatabaseProvider
I'm a begginer and I've made an application which uses a database. In one page, I have a table which I've took it from "woodstock basic" palette. I was using DatabaseProvider to populate the table with data from a database table called "copii". My code is:
//i'm check all the rows in the table to see if the field "IDCOPIIC" =0 and if true I will put the value of "newCopiiId"
do {
if (copiiDataProvider.getValue("IDCOPIIC").equals
(new Long(0))) {
copiiDataProvider.setValue("IDCOPIIC", new Long(newCopiiId));
newCopiiId++;
} while (copiiDataProvider.cursorNext());
copiiDataProvider.commitChanges();
My problem comes now because I have another database table tided with a foreign key by this one and I want to update this one too when I'm updating the "copii" table. I don't know how to do it ...I've tried in many ways but is impossible. Can anyone help me ! I'm desperate...I cannot figure it out how I could insert, update in two tables in the same time when I'm using DataProvider .
Thanks in advance!Hmm.
Not sure where your going with the <select> menu.
The description you made:
"Both have an id column, which is presumably the record's primary key, but you need to create a relationship by storing the primary key of one table as a foreign key in the child (related) table. For example, you should insert the primary key of the first table in the second table as user_id. That enables you to identify which username and password are related to an individual listed in the second table"
Seems to be the direction that I'm looking for.
Now my question is how do I insert the primary key of the first table in the second table as user_id?
>
>"For example, you should insert the primary key of the first table in the second table as user_id"
Since both tables have an id column and they both are the primary key, do I just change the name of the second tables id column to "user_id" then?
Or is there an actual "insert the primary key to another table" function that I don't know about? -
hello Experts,
Is there any System table to get the Year.For Example to get the Month we can use T247 database table like this any system table to get year.
thanks
regards,
Ashok.Sorry can you explain what do you mean to get year ??
The below would give you the year.
Year = Sy-datum(4).
If you wish to convert it into words you can use SPELL_WORD and make sure to use currency with zero decimails..in that case it would return two thousand six in words. -
How to use single buffered table with FOR ALL ENTRIES KEYWORD
Hai,
I'm Using TJ02T Database table, It is single buffered table but at the same time I want to use FOR ALL ENTRIES KEYWORD , Please Help me.
Regards,
S.JananiHi,
FOR ALL ENTRIES will not depend on the buffering nature of the table. The single buffered table will only only buffer one record into memory. You can still use the statement to query the values, but it may have performance problems if the data volume is high since the records are not completely buffered into memory, the time will spent in getting data from DB.
Thanks..
Preetham S -
How to transport the DATABASE TABLE into the Test system ?
Hi Experts,
I am working on BI7, I had created Database table in BDV system using SE11. Tech_name is ZGLACC_TEMP. I had activated it. I had used this database table for the purpose of writing the start routine in the transformation. while I am transporting the transformations to the test system, It is showing as syntax error in ABAP program,
In BDV system there are no syntax errors. it is working fine,
So now I have to transport the database table to test system so that I can transport the transformations into Test system without any error.
Kindly anyone can give the answer , it will be appreciate and points will be assigned.
thanks
sekharHi Sekhar,
Go to SE11, go into the change mode of your table and change the Object Directory entry (Goto -> Object Directory Entry) to some valid package (other than $tmp). Then it will ask for a transport request. Give a transport request and then I believe you know what to do with that transport.
Another thing to keep in mind ... transport all the data elements and domains you have created for this table. Change their Object Directory Entry and assign them to the same transport request.
Best regards,
Kazmi -
Join file column with column in another database
Hi all,
I am trying to do a join between a column in a file I've imported into the BI Server with a column from a Oracle database table in the BI server, but I only get the error:
*[NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 37000 code: -3554 message: [Microsoft][ODBC Text Driver] Syntax error in ALTER TABLE statement.. [nQSError: 16015] SQL statement execution failed. (HY000)*
Joining columns between other files works but not when joining with another database table.The log seems OK, it executes the 2 SQL queries as it should but it cannot join the values in the BI Server memory (it seems). VARCHAR field, but I tried with several different types.
Any help appreciated.There are many ways of doing this, you could potentially use a Dates table to help you out but the comparison between your Excel report and the Oracle table would be pretty straightforward with just 1 calculated column / just a true&false calc column
so you can filter it would be nice.
The dates table can help you so you can only get always the dates from the current month. You can read more about that in the following
Link
Hope this helps!
Maybe you are looking for
-
How do I change country of account when still positive balance on account ?
I just moved from Switzerland to UK and want to update my account with iTunes gift card in GBP. I am not allowed to change country since 0,30 CHF are still on account. I have no possibility to redeem in CHF anymore, but just in pounds. How to update
-
How to update an app purchased with a different account?
Im trying to update iPhoto & iMovie which came with my macbook pro, but everytime I try it says "Sign in to iliketrenchcoats@****.com.au to update applications for that account." But the problem is I CANT! That account doesn't exist. My apple ID is i
-
Connecting X230 to Philips Miracast enabled Smart TV
I have a new X230 which came with Intel WiDi installed. I am trying to connect it to a Philips Smart TV which the folks at Philips tell me should work with WiDi. The TV is Miracast enabled. When I run the Intel WiDi software, the Philips TV appears
-
I cant see profile pictures in my facebook account when i log on through firefox
i cant see profile pictures of my friends in homepage and in their profiles in facebook when i log on through firefox. == This happened == Every time Firefox opened == a month ago
-
About master detail relation ship between tables
Hi I am using jdev 11.1.1.5.0 Use case: I have 2 table having master-detail relationship master table - req_hdr detail table - req_file req_hdr is drop as adf table (t1) on a fragment page and req_file is drop on popup as adf table (t2). user can add