Creating multiple tables
I feel like this is something I should have been able to figure out, but it seems I'm stuck on something I am willing to bet will be a simple fix. Anyway, I am trying to use a single file to create three tables so I can simply run the file from sqlplus and create the tables (and eventually populate them straight off too with data I am given). I have the following in the .sql file right now:
CREATE TABLE v (
Vno VARCHAR2(4) NOT NULL,
Vname VARCHAR2(255) NOT NULL,
City VARCHAR2(255) NOT NULL,
Vbalance NUMBER(7,2)
CREATE TABLE c (
Account VARCHAR2(4) NOT NULL,
Cname VARCHAR2(255) NOT NULL,
Province VARCHAR2(255) NOT NULL,
Cbalance NUMBER(7,2),
Crlimit NUMBER(7,0)
CREATE TABLE t (
Tno VARCHAR2(4) NOT NULL,
Vno VARCHAR2(4) NOT NULL,
Account VARCHAR2(4) NOT NULL,
T_Date DATE,
Amount NUMBER(7,2)
Now, when I try and run that I get:
CREATE TABLE c (
ERROR at line 7:
ORA-00922: missing or invalid option
Like I said, I know this is probably something very simple, but I am new to Oracle and would greatly appreciate any assistance you could provide.
Thanks,
Carl
Hi,
Just do it like:
CREATE TABLE v (
Vno VARCHAR2(4) NOT NULL,
Vname VARCHAR2(255) NOT NULL,
City VARCHAR2(255) NOT NULL,
Vbalance NUMBER(7,2));
CREATE TABLE c (
Account VARCHAR2(4) NOT NULL,
Cname VARCHAR2(255) NOT NULL,
Province VARCHAR2(255) NOT NULL,
Cbalance NUMBER(7,2),
Crlimit NUMBER(7,0));
CREATE TABLE t11 (
Tno VARCHAR2(4) NOT NULL,
Vno VARCHAR2(4) NOT NULL,
Account VARCHAR2(4) NOT NULL,
T_Date DATE,
Amount NUMBER(7,2));
Similar Messages
-
CREATE MULTIPLE TABLES USING BATCH FILE OR ANYOTHER MODE
Dear Legends,
I want to create Multiple table at a single stroke in oracle sql developer or sql*plus using any mode like batch file or sql files...
I dont know the exact mode and how to create it please guide me..I want to learn more about this since am a DBA Beginner..
Any kind of help would be appreciated more...Thanks in Advance
Regards,
Karthik..Hi Everyone,
According to your suggestion I did everything and all works fine yesterday... But today the same script.bat file is not opening sqlplus...
as soon as I double click the bat file it opens the prompt and it shows upto the copyright ..oracle all rights reserved. sql> prompt is not visible or upto that it strucks... please help me..
My SCRIPT.BAT
@echo off
set ORACLE_SID=VESS
set PATH=%oracle_home%\bin\
sqlplus scott/tiger@VESS @test.sql
echo "Disconnected"
My test.sql
select * from tab;
Please help me...
Regards,
Karthik.. -
Create multiple tables in adobe form
hi,
Is there anyone can tell me how to create multiple tables in Adobe Form using SAP Netweaver Developer Studio. Are there any steps i can follow?Hi,
Define the tables in subforms and then wrap them into another subform and make it the subform as type flowed.
Regards,
Raju. -
How to create multiple tables in Adobe air?
Hi, I am using Flash CS5 coding for adobe air 2.0.
How do you create a database with multiple tables and link them together?
I know how to do it in SQL just can't seem to get it to work in Flash CS5 Adobe air.
The following is ONLY an example of a database layout that shows linking tables together.
Table CUSTOMER
customerID - PK
customerName
Table ITEMS
itemID- PK
itemName
Table ORDERS
orderID- PK
data
customerID = 1
customerName = bob
itemID = 1
itemName = cup
orderID = 1
output example
1,bob,1,cup,1
ThankyouBump
-
Creating multiple tables based on existing tables
Hi,
I have to create 60 tables based on existing 60 tables. Instead of creating one by one how can I create all 60 at once.
The current 60 tables are named FY11_ACC1, FY11_ACC2, FY11_SALES1, FY11_SALES2 ...... , but all 60 tables start with FY11. I need to create the same structured tables but with FY12 names like FY12_ACC1, FY12_ACC2, FY12_SALES1, FY12_SALES2 .....
Currently I am using "create table FY12_ACC1 as select * from FY11_ACC1 where 1=0". Is there a way I can write all of them in one query?
Thanks for your time and help.ssk1974 wrote:
Hi,
I have to create 60 tables based on existing 60 tables. Instead of creating one by one how can I create all 60 at once.
The current 60 tables are named FY11_ACC1, FY11_ACC2, FY11_SALES1, FY11_SALES2 ...... , but all 60 tables start with FY11. I need to create the same structured tables but with FY12 names like FY12_ACC1, FY12_ACC2, FY12_SALES1, FY12_SALES2 .....
Currently I am using "create table FY12_ACC1 as select * from FY11_ACC1 where 1=0". Is there a way I can write all of them in one query?
Thanks for your time and help.Well, i'm assuming FY = Fiscal Year and 11 = 2011 and then ACC1 = Account #1.
From the sounds of things, your design isn't likely "correct'.
If you'd care to delve in to the requirements a little bit ... what you have and what you need (business speak wise) there are no shortage of experts here that i'm sure would be happy to help you.
If you're stuck with what you've got (or don't care to change your 'design') and all you care about is achieving that please disregard this message. -
Problem creating multiple tables in one story
Hello,
I have a script that imports text from a .txt file and then makes a table out of it. That works fine. However, at a later time I will want to import some more text from a different .txt file and also make that into a table. And I’ll want the ability to do that a number of times.
All of the tables are in the same story.
The first table is created at the same time the ID document is created. When I run the script again to add a second table the script detects that the document exists and presumes there already is a table. The script then goes to a function that creates a second table. All this works fine as well.
However, I cannot then add any more tables without subsequent tables being added into the second table, which is quite messy.
Below is a boiled down script that just concentrates on the problem. I have written it so that it will add a second and third table to the first. What I need to do is to collapse the functions secondTable() and thirdTable() into one function. If you comment out the thirdTable() and run the script with the secondTable() function twice you will see the problem I have.
To make this work, just open up a new ID document, one page, with one text frame.
Thanks for any help,
Tom
var myDoc = app.activeDocument;
var myStory = myDoc.stories.everyItem();
firstTable();
secondTable();
//secondTable();
thirdTable();
//***functions*****
function firstTable(){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastChar = myStory.characters.lastItem();
var firstChar = myStory.characters.item(-lastInsertionPointIndex);
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end firstTable
function secondTable(){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var lastChar = myStory.characters.lastItem();
var firstChar = myStory.characters.item(-lastInsertionPointIndex+1);
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end secondTable
function thirdTable(){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var lastChar = myStory.characters.lastItem();
var firstChar = myStory.characters.item(-lastInsertionPointIndex+2);
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end thirdTableHi Tom,
Please check below code.
var myDoc = app.activeDocument;
var myStory = myDoc.stories[0];
firstTable();
secondTable();
secondTable();
thirdTable();
//***functions*****
function firstTable(){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var firstChar = myStory.characters.item(lastInsertionPointIndex);
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastChar = myStory.characters.lastItem();
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end firstTable
function secondTable(aa){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var firstChar = myStory.characters.item(lastInsertionPointIndex);
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var lastChar = myStory.characters.lastItem();
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end secondTable
function thirdTable(){
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var firstChar = myStory.characters.item(lastInsertionPointIndex);
myStory.insertionPoints.item(lastInsertionPointIndex).contents = "Cell one \tCell two\rCell three \tCell four";
var lastInsertionPointIndex = myStory.insertionPoints.lastItem().index;
var lastChar = myStory.characters.lastItem();
var theTextRange = myStory.texts.itemByRange(firstChar, lastChar)
theTextRange.convertToTable("\t","\r");
}//end thirdTable
Hope it will work for you.
Shonky -
How to create multiple tables SQL in toplink?
Table A {
field1,
field2,
field3
Table B {
field1,
field2,
field3
select a.field1,a.field2,b.field3
from a,b
where a.field1=b.field1
and a.field2=b.field2
How can I create dynamic sql in toplink as Hibernate HQL?
Is there any simple method?Use multipleTableJoinExpression is too difficult.
Thanks!Bump
-
How to Create multiple rows in Rich table programatically
Hello ADF Exparts.
I am Using below Code to create Rich Table Programatically on Clicking a button but I can't able to Create multiple tables will you please help me to create new row programatically
public class NewTable {
private RichInputText txtSearching;
private RichShowDetailItem resultTab;
private RichShowDetailItem simpleSearchTab;
private RichColumn firstColumn;
private RichOutputText outPutText;
private String searchString;
AdfFacesContext ctx=AdfFacesContext.getCurrentInstance();
Connection conn;
RichTable table;
Statement stmt;
private RichShowDetailItem basicSearchTab;
private RichTable basicResultTable;
private RichPanelGroupLayout panelGL;
public NewTable() {
public String buttonClicked() {
// Add event code here...
//Starrt Creating Table
table =new RichTable();
table.setId("demo");
table.setVisible(true);
table.setWidth("1024px");
table.setValue("mat_search");
table.setVar("Search");
table.setFilterVisible(true);
table.setAllDetailsEnabled(true);
table.setRowKey("0");
table.setFetchSize(25);
table.setRows(10);
table.setRowBandingInterval(0);
table.setRowSelection("single");
// table.setHorizontalGridVisible(false);
//table.setVerticalGridVisible(false);
//Start Table Header Text Declaretion and Assignment
RichOutputText colTextMat_No = new RichOutputText();
colTextMat_No.setValue("Material No ");
RichOutputText colTextShotDes = new RichOutputText();
colTextShotDes.setValue("Short Description");
RichOutputText colTextLongDes = new RichOutputText();
colTextLongDes.setValue("Long Description");
//Start Table Columan Creatin
RichColumn colMat_No = new RichColumn();
colMat_No.setVisible(true);
colMat_No.setHeader(colTextMat_No);
colMat_No.setWidth("100px");
colMat_No.setSortProperty("Material No");
colMat_No.setSortable(true);
colMat_No.setFilterable(true);
colMat_No.setSeparateRows(true);
RichColumn colShotDes = new RichColumn();
colShotDes .setVisible(true);
colShotDes .setHeader(colTextShotDes);
colShotDes.setWidth("500px");
colShotDes.setSortProperty("Short Description");
colShotDes.setSortable(true);
colShotDes.setFilterable(true);
colShotDes.setSeparateRows(true);
RichColumn colLongDes = new RichColumn();
colLongDes .setVisible(true);
colLongDes .setHeader(colTextLongDes);
colLongDes.setWidth("500px");
colLongDes.setFilterable(true);
colLongDes.setSeparateRows(true);
//End Table Columan Creatin
//Start Creating table Children
List<UIComponent> tblChild;
tblChild=table.getChildren();
//Start adding Columan to Table
tblChild.add(colMat_No);
tblChild.add(colShotDes);
tblChild.add(colLongDes);
List<UIComponent> displayPanel;
displayPanel=panelGL.getChildren();
List<UIComponent> matChild;
matChild=colMat_No.getChildren();
RichOutputText rot=new RichOutputText();
rot.setValue("15000");
matChild.add(rot);
displayPanel.add(table);
System.out.println("RowIndex="+table.getRowIndex());
System.out.println("Row Count="+table.getRowCount());
return null;
Thank you very muchMaybe you can get some ideas from here -
http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html -
Creating multiple user tables using script
hi
my requirement is i want to create multiple tables by running script . is it possible .how do i do that can any one suggest me and send sample code to solve this task.
(i have to create 100 userTables it is very difficult to create using code or from B1 that is my requirement )and i think some good solution is there for my problem and inserting the tables into B1 by running script.Hi Om,
Take a look at the SDK help files, or even better, the examples provided with the SDK, they give you a good example how to create a usertable.
Tried that, you could programm a loop wich creates your usertables, or a function that progresses a input file containing all your usertables.
<b>Pseudo code loop (C#)</b>
for(int i = 1; i <=100; i++)
/* Call you your function that creates a usertable with the given name */
CreateUserTable("TBL_" + i.ToString());
Hope it helps,
Rowdy -
Multiple table of contents in one document
I would like to create multiple table of contents in one document. It would look something like the layout below. Each of the documents is a standalone FrameMaker file. Is this possible? I'm wracking my brain for ideas. Thank you!
Salome
TABLE OF CONTENTS
Group 1 Program
Document: Alligator
Document: Bear
Document: Camel
Document: Deer
Document: Eagle
Group 2 Program
Document: Fish
Document: Giraffe
Document: Hippopotamus
Document: Iguana
Document: Jaguarlawrence,
Pages will only accommodate one TOC, I'm sorry to say. The others will have to be generated manually.
-Dennis -
Keeping track of multiple tables
I'm creating multiple tables by resuing the same JTable object and merely changing and the tablemodel associated with it. The number of tables I have are based on the number of data tables I have.
Right now I have an Mouselistener attached to my tables to register which rows and columns have been clicked on. My question is, how do I keep track of which table the row and column come from? Any suggestions?
Thanks in advance.I won't do a lecture on Java object and reference here.
If a single JTable keeps changing its model or model data, it's simply no problem.
Are you going to do that?
However,
JTable t0, t1, t2, t3, ... ;
t0 = new JTable(model0);
t1 = t2 = t3 = ... = t0;
/* and, somewhere else ... */
t1.setModel(model1);
/* again elsewhere */
t2.setModel(model2);
.....This is certainly a disaster.
how do I keep track of which table the row and column come from?Define a custom class for object for managing table meta data. And use a Collection or a Map
for storing them. Or, simple set of meta data can be stored in your table model object that
extends DefaultTableModel. Don't extend AbstractTableModel -- that is often unnecessary
and often can be a futile, bogging and nightmarish effort. Keep yourself away from it. -
[ADF Help] How to create a view for multiple tables
Hi,
I am using Jdeveloper 11G and ADF framework, and trying to create a view to update multiple tables.
ex:
Table A has these fields: ID, Name
Table B has these fields: ID, Address
A.ID and B.ID are primary keys.
B.ID has FK relationship with A.ID
(basically, these tables have one-to-one relation)
I want to create a view object, which contains these fields: B.ID (or A.ID), A.Name, B.Address.
So I can execute C,R,U,D for both tables.
I create these tables in DB, and create entity objects for these tables.
So there are 2 entity objects and 1 association.
Then I create a view object based on B and add fields of A into the view:
If the association is not a "Composition Association",
when I run the model ("Oracle Business Component Browser") and try to insert new data, fields of A can't edit.
If the association is a "Composition Association", and click the insert button, I will get
"oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity"
If I create a view object based on A and add filed of B into the view:
When I run the model and try to insert new data, fields of B can't edit, no matter the association is or is not a composition association.
So... how can I create a view for multiple tables correctly?
Thanks for any advices!
Here are some pictures about my problem, if there is any unclear point, please let me know.
http://leonjava.blogspot.com/2009_10_01_archive.html
(A is Prod, B is CpuSocket)
Edited by: user8093176 on Oct 25, 2009 12:29 AMHi Branislav,
Thanks, but the result is same ....
In the step 2 of creating view object, I can select entity objects to be added in to the view.
If I select A first, and then select B (the "Source Usage" of B is A), then finishing the wizards.
When I try to create a new record in the view, I can't edit any properties of B (those files are disabled).
If I select B first, and then select A in crating view object, the result is similar ...
Thanks for any further suggestion.
Leon -
Why do we create multiple aliases to a single table?
<h4>{color:#0000ff}Hi,{color}</h4>
<h4></h4>
<h4></h4>
<h4>{color:#0000ff} Why do we create multiple aliases to a single table in the same query?{color}</h4>
<h4></h4>
<h4></h4>
<h4>{color:#0000ff}{color:#000000}For Ex: {color}{color}</h4>
<h4>
{color:#000000}select name,address,phone, from emp e, emp e1{color}</h4>
<h4></h4>
<h4>{color:#000000}where e.empid = e1.empid;{color}</h4>
<h4>
{color:#0000ff}ofcourse the above query's where condition is not correct, but i am giving as an example only{color}</h4>
<h4>{color:#0000ff}I have seen similar kind of queries where a single table name is aliased 10 times in the same query{color}</h4>
<h4>{color:#0000ff}can someone help me to understand the logic behind it?{color}</h4>
<h4>{color:#0000ff}Thanks in advance{color}</h4>
<h4>{color:#0000ff}greddy.{color}</h4>
Edited by: greddy on Oct 24, 2008 2:46 AMHi,
When you say
FROM emp e
, emp e1you are using two copies of the same table.
Can you imagine using two copies of the same book at the same time?
Say you see a word (like "hyrax") that you don't know. You might look up that word in the dictionary.
The English sentence "Open the dictionary to the page containing the new word." is like this SQL query:
FROM dictionary
WHERE :unknown_word BETWEEN low_guide_word and high_guide_wordWhat if you saw that word while reading a book (let's call it book_a).
You might want to leave book_a open, and place the dictionary beside book_a, so you can easily compare how the word is used in book_a with the definition in the dictionary.
This corresponds to joining two tables in SQL:
FROM book_a
JOIN dictionary ON unknown_word BETWEEN low_guide_word AND high_guide_word
WHERE book_a.page = whatever -- NOTE: both tables have a column called pageor you can use aliases for one or both of the tables
FROM book_a a
JOIN dictionary d ON a.unknown_word BETWEEN d.low_guide_word AND d.high_guide_word
WHERE a.page = whatever -- NOTE: both tables have a column called pageNow, imagine that book_a is itself the dictionary. Say you saw the word "hyrax" while you were looking up another word, "ibex".
You can do a side-by-side comparison, as above, if you have two copies of the dictionary. Leave one copy open to "ibex", and open the other copy to "hyrax".
This corresponds to a self-join in SQL:
FROM dictionary a
JOIN dictionary d ON a.unknown_word BETWEEN d.low_guide_word AND d.high_guide_word
WHERE a.page = whatever -- NOTE: both tables have a column called pageNotice that this last bit of code is identical to the previous one, except that book_a is replaced with dictionary.
In this case, you must you a table alias, at least for one copy. It wouldn't make any sense to say "Leave the dictionary open to "ibex" and open the dictionary to "hyrax". You have to have some unique way of referring to each copy, such as "Leave the dictionary on my left open to "ibex" and open the dictionary on my right to "hyrax"." -
How to create a table with multiple select on???
Hi all,
I am new to webdynpro and my requirement is to create a table with multiple selection on.I have to add abt 10 rows in the table but only 5 rows should be visible and moreover a verticalscroll should be available to view other rows.Can anybody explain me in detail how to do that.Please reply as if you are explaining to a newcomer.Reply ASAP as i have to do it today.
ThanxsHi,
1. Create a value node in your context name Table and set its cardinality to 0:n
2. Create 2 value attributes within the Table node name value1 and value2
3. Goto Outline view> Right click on TransparentUIContainer>Apply Template> Select Table>mark the node Table and it's attributes.
you have created a table and binded its value to context
Table UI properties
4.Set Selection Mode to Multi
5.Set Visible Row Count to 5
6.ScrollableColCount to 5
In your implemetaion, you can add values to table as follow:
IPrivate<viewname>.ITableElement ele = wdContext.nodeTable().createTableElement();
ele.setValue1(<value>);
ele.setValue2(<value>);
wdContext.nodeTable().addElement(ele);
The above code will allow you to add elements to your table node.
Regards,
Murtuza -
Hi All,
I would like to create clickable Table of Contents (TOC) that can lead to a sub clickable TOC that would lead to a specific page of different PDFs within a folder.
Is that possible?
Secondly, is is possible to create a search box that upon typing a specific word (not related to text within the PDFs), that word to be linked to a specific page of a particular PDF out of many within a folder?
To make it more clear, I have a database of specifications of equipment and drawings of a building, all in multiple PDF files. I would like to be able to unify all those PDFs and if I type the room number of the building to be presented with a menu of choces pointing to services assosiated with that room, being elctrical power drawings, lighting drawings or drawings of Air Conditioning and Ducting associated with that room. So I type a room number, then I get a menu of Power, Lights, Fire Alarm, or Ducting all associated with that room, then if I click Fire Alarm to be directed straight to the drawing within a PDF related to that room.
ThanksI would say: Try and Error. Create a copy of your document and unmark in the copied document in the document inspector all boxes for the TOC. Then mark them again. Maybe you should also delete the paragraph styles and mark them again. If that doesn't work, try to copy the complete text of your document to a new created one. Maybe that works.
Good luck!
P.S.: If that doesn't work look here. Maybe this helps.
Maybe you are looking for
-
Bose headset no longer works on iPhone 4
My Bose headset, which worked flawlessly on 3GS, no longer works for voice control and voice memos on my new iphone 4. They still work fine as headphones but the microphone no longer is operational. The Apple supplied headset works and if I unplug th
-
How can I load photos on a new iPad for a customer?
Now this is something that I've done before. But iOS has gone through some changes since then, and now I can't remember what to do. Basically, I have a new iPad which was purchased for a customer. I need to load some photos on the iPad for the custom
-
What is the best solution for me to run Microsoft Access on my brand new iMAC? Assume I'm a casual user. I am lead to believe by some real smart guys on the Apple site that If I have the Apple Store partition my iMAC and add the full suite of Office
-
Hi We have found many MIGO entries with document date prior to purchase data and many invoice document date prior to MIGO date. Auditors have objected to it and would like to know whether SAP does not have any option to control this. Please let us kn
-
How do I turn Search auto-complete OFF?
It's very annoying that it goes to the word my cursor is on instead of the word I typed.