Three Tables from same database
What is the most effective way to simultaniously display
three seperate dynamically generated tables all from the same data
table?
Could the OP possibly mean displaying 3 HTML tables based on
data from a single database table?
Phil
Similar Messages
-
Unable to copy table in same Database
I m using jdbc:odbc bridge to connect to MS access database. i am trying to create a table by copying data from another table in same database. the code is
Statement stmt = mycon.createStatement();
String query = "create table " + temp1 + " as select * from " + temp2;
stmt.executeUpdate(query);
But java is throwing exception as:
java.sql.SQLException: [Microsoft][ODBC Microsoft Acces Driver] Syntax error in
CREATE TABLE statement.
Simple create and select are working fine. Is there something like MS Access doesnt support such queries?
Thanx for help
VineyHi Viney_yadav,
First a general suggestion: The error message you got states that is a SQL syntax error. This tells you that you should try running the SQL that is failing directly through Access and correct the syntax problem there. That will help you verify the SQL syntax and avoid any complications related to Java.
And now some specific help (cut/paste from a previous life): Different DBMS's handle the SELECT INTO... differently. SELECT INTO... in Microsoft Access actually creates a new table. If the table already exists (in Access) then you would use the INSERT INTO..SELECT... statement.
EXAMPLE to create and populate a new table in Access (sorry didn't test this):
select temp2.* into temp1 from temp2 -
How to import a table from another database using DB toolset.
Hello All
I would like to import a table from one database to another using DB toolbox.
I do not want to import all data to LV and then save them to another database. Instead I would prefer to use SQL syntax.
Does anobody know how to write SQL command to import whole table from one database to another?
I have found in some SQL manual that INSERT INTO should work, but JET4 returns an error that table (e.g. c:\mydatabase\table1) can not be found.
Thanks in advance
Pawelif i don't have TEST table on server B whether COPY command will create this table on server B with the same structure ? If you specify CREATE as a clause the table will be created:
SQL> help copy
COPY
COPY copies data from a query to a table in a local or remote
database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
COPY {FROM database | TO database | FROM database TO database}
APPENDCREATE|INSERT|REPLACE} destination_table
[(column, column, column, ...)] USING query
where database has the following syntax:
username[password]@connect_identifier -
To make three tables from one table
Hi,
I have created a random table from a big table and now i want to make three tables of same numbers, means each table should contain 1000 records, as the table has random idx column, so i cant divide directly on basis of idx. in addition, i cant create three seperate tbles from main table, as i dont want any duplicate data in those three tables, whcih may occur if i will create each table individually.
Best regards,Table 1.
create table emp1 as
select empno,ename,sal--,................
from(select e.*,row_number() over(order by rowid) rn,count(*) over(order by null) cnt
from emp e)
where rn < cnt/3
Table 2.
create table emp1 as
select empno,ename,sal--,................
from(select e.*,row_number() over(order by rowid) rn,count(*) over(order by null) cnt
from emp e)
where rn between cnt/3 and cnt*2/3
Table 3.
create table emp1 as
select empno,ename,sal--,................
from(select e.*,row_number() over(order by rowid) rn,count(*) over(order by null) cnt
from emp e)
where rn > cnt*2/3 -
Problem adding more than 1 table from a database
I am running Crystal Reports 2008 on windows server 2008 and connecting to an ODBC database using IBM Client access driver. When I create a new report and only add one table from the database, everything works fine. If I try to go add a second table to the report, then I get an error - Crystal Reports has stopped working - there is no other useful information. I have also tried creating a new report and adding 2 tables at the same time, it also blows up before I even get to the linking screen.
I have also tried opening a report that was created in Crystal 11 that has 2 or more tables in it. The report will open and run successfully in Crystal 2008.Hi Gwyn,
Moved this post to the Database Connectivity Forum.
Have you installed any CR patches? If not please do so. Also you can find our DataDirect ODBC drivers from this link also:
http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm
Select Crystal Report, 2008 and you'll find Service Pack 2 and the Data Direct ODBC drivers. Try both and then reply if you have still have a problem or if it now works.
Thank you
Don -
How to check relation between two tables in same database
How to check relation between two tables in same database using Oracle SQL developer. Version 2.1.1.64
Hi,
Try this,
SELECT cons.owner AS child_owner, cons.table_name AS child_table,
cons.constraint_name constaint_name,
cons.constraint_type constraint_type, col.owner parent_owner,
col.table_name parent_table, col.column_name column_name
FROM dba_cons_columns col, dba_constraints cons
WHERE cons.r_owner = col.owner
AND cons.r_constraint_name = col.constraint_name
AND col.owner = 'MY_USER'
ORDER BY child_table;Thanks,
Shankar -
Getting error while creating table from one database to other.
Hi,
We are getting below error while creating the table from one database to other.
SQL> create table fnd_lobs parallel compress as select * from [email protected];
create table fnd_lobs parallel compress as select * from [email protected]
ERROR at line 1:
ORA-01555: snapshot too old: rollback segment number 28 with name "_SYSSMU28$"
too small
ORA-02063: preceding line from EEXIT2TEST
ORA-01555: snapshot too old: rollback segment number 28 with name "_SYSSMU28$"
too small
ORA-02063: preceding line from EEXIT2TEST
ORA-01555: snapshot too old: rollback segment number 28 with name "_SYSSMU28$"
too small
ORA-02063: preceding line from EEXIT2TEST
ORA-01555: snapshot too old: rollback segment number 28 with name "_SYSSMU28$"
too small
Regards,
Bhatiahi
what are the apps version local and remote database???
Snapshot too old errors occur because Oracle can 't reconstruct a consistent
image of a block for the purposes of a consistent read.
I feel at remote database, you are using UNDO, it will be rather easy to iincrease the undo retention time or increase the undo tablespace size.. if you are dealing with roll back segments, you may have rollback segments whose optimal values are too small...
increase roll back segments size and select again then
the following metalink notes might be helpful
ORA-01555 "Snapshot too old" - Detailed Explanation Doc ID: 40689.1
How To Avoid ORA-01555: Snapshot Too Old When Running PAAPIMP Doc ID: 603259.1
OERR: ORA 1555 "snapshot too old (rollback segment too small)" Doc ID: 18954.1 -
Error while importing tables from oracle database
Hi
I am getting the following error when i am trying to import table from oracle database.
my operating system is windows and my database is oracle.
[nQSError: 16001]ODBC error state: IM004 code:0 message:
[Microsoft][ODBC Driver Manager] Driver`s SQLAllocHandle on SQL_HANDLE_ENV failed.
please help me in resolving this issue.
Thanks and Regards,
RajHi Madan,
I have done migration Discoverer Admin EUL Layer into OBIEE repository using below methodology.
Navigate to the <installdrive>\OracleBI\server\Bin directory. There are two important files in this directory: the migration assistant executable file named MigrateEUL.exe and a properties configuration file named MigrationConfig.properties.
Could you please help me how to migrate discoverer plus workbooks and worksheets into OBIEE Answers?
go through below link, It will show navigation steps for migrating of EUL from Discoverer to OBIEE.But i need migration of workbooks and worksheets from Discoverer into OBIEE Answers.
http://www.oracle.com/technology/obe/obe_bi/discoverer/discoverer_1012/discomigration/migrate_disco_biee.htm
This is very great full help to me …
Advance thanks for your suggestions.
Regards
Duraga Prasad. -
Replicate some tables from local database server to Remote database sever
how can i replicate some tables from local database server(Oracle 8.1.7 on windows 2000 server) to a remote database server(Oracle 8.1.7 on Sun Solaris)
whenever there is some insertion or updation on the table of base(main) database it should get updated to the remote database server
or
on time base for example: every 2 hours
please help me!!!!It all depends on waht you are going to do with the data on the remote.
if tehre are no updates there, creating a simple materialized view on the remote to pull it's data from the local should suffice.
If there are updates on the remote, you will more than likely want to look into either Multi-master replication, or updatable materialized views. -
Select query based on joining of tables from different database is taking too long
Hi Team,
Select query on table with millions of records is taking very long time. It took 50mins, the below query is joining on multiple table from two databases DB1.dbo.Table1 contains 100 million records and also Table3 and Table4 (of different database) might
contain close to 1million records.
Select T1.*
From DB1.dbo.Table1 T1
Join DB1.dbo.Table2 T2 on RTRIM(T1.Col3) = RTRIM(T2.Col3)
Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
Join Table3 U on CA.Col2 = U.Col2 AND RTRIM(T2.Col2) = U.Col3
Where U.Col4 NOT IN ('A1', 'A2', 'A3', 'A4', 'A5', 'A6','A7','A8','A9')
And (T1.flg IS NULL OR T1.flg = 'N')
And LTRIM(RTRIM(T2.Col2)) NOT IN ('B1','B2')
How can i improve the performance of this query. Actual thing is update the data in Db1.dbo.table1 based on the conditions but if the select is taking close to 1hr then update will take hours together. Indexes already implemented on all the tables.
Thanks,
Eshwar.
Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users.Thanks.
Join Table4 CA on RTRIM(T1.Col1) + T2.Col2 = CA.Col1
This join is not working with spaces if Rtrim is not used.
Thanks! Eshwar.
Please don't forget to Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful. It will helpful to other users. -
Connection with tables of same database
i want to access two tables of same database using JDBC.
how can i do it in MS Access
i have to create two connection one for each or two statement for same connectioni want to access two tables of same database using
JDBC.
how can i do it in MS Access
i have to create two connection one for each or two
Yo don't need to create two connections to access two tables.
Single Database connection is enough.
Try the following pseudo code to access two tables
1. get Database Connection
2. create statement with query that is for table 1
3.execute it and close the statement .
4. again create the statement with query that is for table 2
5. execute it and close the statement .
6. close the connection.
hope it will clear you,
nvseenu
statement for same connection, -
To copy table from one database to another
hai,
I will be really pleased if someone can me tell me that how can i copy table from one database to another. I am having two databases.
GursimranYou can Also do
++ Create a database link on the TARGET to SOURCE
CREATE PUBLIC DATABASE LINK <<DBLNK_NAME>> CONNECT TO <<USER>> IDENTIFIED BY <<PASSOWORD>> USING '<<TNS_NAME>>';
++ And copy as below
CREATE TABLE EMP AS SELECT * FROM EMP@DBLNK_NAME; -
Insert data into fact table from source database tables
here i try to insert data into fact table from source database tables here is the query
ALTER procedure [dbo].[facttable]
as
insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
from
[PRODUCTION PLANNING 2].dbo.[Products],
[PRODUCTION PLANNING 2].dbo.[Production Detail],
[PRODUCTION PLANNING 2].dbo.[Material category],
[PRODUCTION PLANNING 2].dbo.[Materials],
[PRODUCTION PLANNING 2].dbo.[Equipment],
[PRODUCTION PLANNING 2].dbo.[Working Centre] ,
[PRODUCTION PLANNING 2].dbo.[Recipies]
where
Products.[Product ID] in (13, 14, 15, 16, 17) and
[Production Detail].[Production ID] in (1, 2, 3) and
[Materials].[Material ID] in (1, 2, 3, 4, 5) and
[Equipment].[Equipment ID] in (1, 2, 3, 4) and
[Working Centre].[Work Centre ID] in (1, 2, 3) and
[Recipies].[Recipy ID] in (1, 2, 3) and
[Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
and when i execute query it shows me error
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
ERD IS
HOW TO SOLVE THIS PROBLEM?I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
What is te best way to copy a table from a database to another?
Hello friends:
I have two databases: an Access database and an Oracle database. I must copy the data from al tables from the Access database to the oracle database. The tables in the both databases are equal (number of columns, type, etc).
I read an resultset from acces (select * from table1) and I insert every row in the Oracle database with an while loop (while (r.next)...). It works fine when there are a few rows, but I have a table with over 200000 rows, and when I'm copying the row number 30.000, the system goes very slow...
How can I copy tables from a database to another more quickly?
Thanks!CASE #1
The most efficient method would be to copy all the rows from Microsoft Access and write them to a text file using Access's native interface (not JDBC), then use Oracle's SQL Loader utility (not JDBC) to insert the data.
You can insert 200,000 rows of 80 bytes each in 30 seconds or less even on a modest Oracle system using SQL Loader. The extract from Access is very dependent on the size of the CPU and the available memory.
Hint 1: Avoid explicit or implict network traffic.
Hint 2: Extract and load from local drives rather than networked or shared drives on other services
Please note that this is done for efficiency of load, but has issues related to error checking, and operational scripting.
Anything else you do or use will be slower than the method (above).
CASE #2
If you want to integrate this into a single JDBC program which will provide better operational management of the process, then you can simply connect to both databases in your Java program, then read the rows one at a time from Access, insert them using the Batch mechanism of JDBC to Oracle. You will also want to set the FetchSize in Oracle to a larger value then the default (i.e set it to 100 vs 10).
Hint #3 You may want to look into alternative JDBC drivers for accessing MS Access, rather than the JDBC-ODBC bridge which is not optimized for MS Access. You may also want to consider using the OCI8 driver from Oracle rather than the thin driver. Both provide Type 4 functionality but I have heard (not experienced) that the OCI8 driver is better for managing batch style of processing like yours
Good luck!
Joel -
How to Move or Copy the Tables from One Database to Another Database ?
HI,
Can any one help me on this, How i can move or copy the tables from one database to another database in SQL server 2005 by using SQL query. Hope can anyone provide me the useful and valuable response.
Thanks
GopiHello,
Maybe these links help you out
http://www.microsoft.com/downloads/en/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
http://www.suite101.com/content/how-to-copy-a-sql-database-a193532
Also, you can just detach the database make a copy and move it to the new server.
Maybe you are looking for
-
How to get iOS 7 on my iPod 5th Gen? It won't show up in my settings???
Everybody says u can get it in the settings but its not there
-
I can not open new tabe in the same page
i can not open new tabe im the same page when i click on new tabe , it donsnt open at all
-
Query works as two queries, but not as one
I am beating my head against the wall trying to figure out why a query will not return, yet when I break it up into two queries, they both return successfully. There is a text index on the text_a field. This is my query: select distinct /*+ */ table_
-
Hi, I have a requirement. i have a prompt with countries. after opening prompt there will be 100s of countries. for example three country names starting with letter I (India,Iran,Indonesia). If the user presses I in keyboard the pointer in prompt sho
-
Problem with user group querys in transaction Ad-Hoc-Quey
Hello experts. I have one doubt, i need to know how when I execute transaction S_PH0_48000510 (Ad-Hoc-Quey), like obtaining that by defect appear querys of a certain user group. I have tried with the user's parameters AQB, AQQ, AQW but nothing works.