Problem creating several tables in a story
Hello
I have a script that any text in a .txt file, then make a table out of it. Which works very well. However, at a later date I want to import text over a different .txt file and also what to do in a table. And I'll have the opportunity to do several times.
All the tables are in the same story.
The first table is created at the same time, the document ID is created. When I run the script to add a second table, the script detects that the document exists and that it assumes that there is already a table. The script then goes to a function that creates a second table. This works fine as well.
However, I can't add then all the tables more without the following tables to be added to the second table, which is quite messy.
Here's a mush down script that just focuses on the problem. I wrote it so that it will add a table of second and third in the first. What I have to do is to reduce the functions secondTable() and thirdTable() in a function. If you comment out the thirdTable() and run the script with the function secondTable(), twice, you will see the problem I have.
To do this, simply open a new document ID, page, with structure in a single text.
Thanks for any help,
Tom
myDoc var = app.activeDocument;
monarticle var = myDoc.stories.everyItem ();
firstTable();
secondTable();
secondTable();
thirdTable();
functions *.
function firstTable() {}
var lastInsertionPointIndex = myStory.insertionPoints.lastItem () .index;
myStory.insertionPoints.item (lastInsertionPointIndex) = .silence ' Cell a \tCell two\rCell three four \tCell;
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) = .silence ' Cell a \tCell two\rCell three four \tCell;
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) = .silence ' Cell a \tCell two\rCell three four \tCell;
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 thirdTable
Hi Tom,
Please check below the 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
Tags: InDesign
Similar Questions
-
Hi guys,.
There I am facing a problem I need to create the table in the select statement result 0 records as output.
Sue, the error displayed is:
SQL error: ORA-01723: columns null are not allowed
01723 00000 - "columns null are not allowed.
* Cause: Columns with a length zero could not.
* Action: Correct use of the column.
no selected line
Can you please suggest a way?
I need to create several tables like that of the select statement.
As Johan has picked up on, if the VEL_CEM_ALL_CONTENT is a point of view, then the data types will be those of the columns returned in the select from this point of view, and if one of those is null then you will get the error.
-
Creating the table and get the invalid identifier
Thank you so much Ed (and all those who responded) to my previous post!, you all be extremely useful.
In fact, I have another question... Can I repost a new thread or continue on this one?
Here's my problem.
create the table DonationEvent
('ID' NUMBER (1,1) Not Null,)
"EventNumber" NUMBER (1,1) Not Null,
'Type' char (30) Not Null,
"OrganizerName' char (30) Not Null,
'Location' char (30) Not Null,
'Date' NUMBER (10.1) Not Null,
'Time' char (30) Null,
"DonationTotal" NUMBER (10.1) Not Null,
Primary Key (ID),
);
Getting ORA-00904: invalid identifier
Also I use Express Edition 10g, how can I get a view of context to see the line where error occurs?Cushgod wrote:
I always get invalid identifiers... Your focus is so useful! My teacher is not useful. At his table did not work it would be copy and paste that work and say that he didn't had the time to debug it... I can't even say what my mistake is on in the Express edition...What do you use to write/test your sql? That's why I asked sqplus. This is the basic sql shell. In the examples I showed you I had by the sql in a text (doit.sql) file, shot to the top of sqlplus, connect to the base, execute "doit.sql".
You're my only hope! Thank you very much in advance, I learn a little which makes me question why my teach would even use "" eventid NUMBER (1,1) not null "" after your explanation. " It's not supposed to have a decimal number to a primary key event IDS... anyway thanks in advance.
create the table DONATIONEVENT
(eventid NUMBER (5) Not Null,)
eventnumber NUMBER (9) Not Null,
EventType VARCHAR2 (30) Not Null,
OrganizerName VARCHAR2 (30) Not Null,
location VARCHAR2 (30) not Null,
EventDate DATE Not Null,
duration VARCHAR2 (30) Null,
donationtotal NUMBER (10.2) Not Null,Primary Key (ID),
);
If I use a DATE instaed (4) no setting, I get "' missing right parenthesis"... once again. I counted my bracket and the match 10 (and 10)
See below.DATE is right. Where did you get the idea of DATE (4)?
The documentation site (tahiti.oracle.com) Oracle seems to be down at the moment, but you really, * really *, * REALLY * need to get there and take the reference SQL and SQL * reference manuals more.
create the table DONATIONEVENT
(eventid NUMBER (5) Not Null,)
eventnumber NUMBER (9) Not Null,
EventType VARCHAR2 (30) Not Null,
OrganizerName VARCHAR2 (30) Not Null,
location VARCHAR2 (30) not Null,
EventDate DATE (4) Not Null,
duration VARCHAR2 (30) Null,
donationtotal NUMBER (10.2) Not Null,Primary Key (ID),
);
-
Creating a combined chronology based on several chronologies in several tables
Hello
I need to extract a timeline for a customer based on valid_from and valid_to dates in several tables.
For example: I have a table named customers with an id, a valid_from a valid_to date and a table named contracts with contrat_name and customer_id and valid_from valid_to:
CUSTOMERS:
ID | VALID_FROM | VALID_TO
1. 01.03.2010 | 01.01.4000
CONTRACTS:
CONTRACT_NAME | CUSTOMER_ID | VALID_FROM | VALID_TO
Contracted | 1. 01.03.2010 | 01.10.2010
ContractB | 1. 01.10.2010 | 01.01.4000
The following statement would now give me the correct chronology:
Select customer cus.id, con.contract_name, greatest(cus.valid_from,con.valid_from) least(cus.valid_to,con.valid_to) valid_to valid_from
customers cus
stupid contracts on cus.id = con.customer_id inner join;
CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
1. Contracted | 01.03.2010 | 01.10.2010
1. ContractB | 01.10.2010 | 01.01.4000
It works, but I get a problem whenever I have a point from the time there is no contract for a client, but I would always like to have these periods in my calendar:
Suppose the following data and the same select statement:
CUSTOMERS:
ID | VALID_FROM | VALID_TO
1. 01.03.2010 | 01.01.4000
CONTRACTS:
CONTRACT_NAME | CUSTOMER_ID | VALID_FROM | VALID_TO
Contracted | 1. 01.05.2010 | 01.10.2010
ContractB | 1. 01.12.2010 | 01.03.2011
What I would now get would be:
CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
1. Contracted | 01.05.2010 | 01.10.2010
1. ContractB | 01.12.2010 | 01.03.2011
But what I get is the following:
CUSTOMER | CONTRACT | VALID_FROM | VALID_TO
1. null | 01.03.2010 | 01.05.2010
1. Contracted | 01.05.2010 | 01.10.2010
1. null | 01.10.2010 | 01.12.2010
1. ContractB | 01.12.2010 | 01.03.2011
1. null | 01.03.2011 | 01.01.4000
What I won't is generate a result with contract = null any time, there is no contract because I actually want to join the chronology of several different tables into one and it would be very complicated to assume things based on what data can or can not be found in a specific table.
Thanks for any help or ideas,
Kind regards
ThomasHi, Thomas,.
Whenever you have a problem, after the sample data in a form that people can use to recreate the problem and test their ideas. CREATE TABLE and INSERT statements are great.
For example:CREATE TABLE customers ( customer_id NUMBER (6) PRIMARY KEY , valid_from DATE NOT NULL , valid_to DATE NOT NULL ); INSERT INTO customers (customer_id, valid_from, valid_to) VALUES (1, DATE '2010-03-01', DATE '4000-01-01'); INSERT INTO customers (customer_id, valid_from, valid_to) VALUES (2, DATE '2010-03-01', DATE '4000-01-01'); CREATE TABLE contracts ( contract_name VARCHAR2 (15) NOT NULL , customer_id NUMBER (6) , valid_from DATE NOT NULL , valid_to DATE NOT NULL ); INSERT INTO contracts (contract_name, customer_id, valid_from, valid_to) VALUES ('Contract 1a', 1, DATE '2010-03-01', DATE '2010-10-01'); INSERT INTO contracts (contract_name, customer_id, valid_from, valid_to) VALUES ('Contract 1b', 1, DATE '2010-10-01', DATE '4000-01-01'); INSERT INTO contracts (contract_name, customer_id, valid_from, valid_to) VALUES ('Contract 2a', 2, DATE '2010-05-01', DATE '2010-10-01'); INSERT INTO contracts (contract_name, customer_id, valid_from, valid_to) VALUES ('Contract 2b', 2, DATE '2010-12-01', DATE '2011-03-01');
If a customer contracts of n, then you might need as much as 2n + lines 1 output for this client:
(a) 1 row showing the period, not from the date of customers both valid_from 1st contract begins
(b) n lines indicating the periods under contracts
(c) n lines indicating the period right after each contract, until the following starts (or valid_to of the client, if there is no next contract)
However, you will have lines for periods not contacted ((a) or (c)) if their mandate is 0 days.This sounds like a job for the UNION. Make a UNION 3 lanes in a subquery to generate (a), (b), and (c), and then put a WHERE clause on the combined, results to filter the lines not length 0.
In the query subsidiary UNION, (a) can be done with a query GROUP BY, and (c) can be done using the analytical function of LEAD.WITH union_data AS ( SELECT ua.customer_id , NULL AS contract_name , MIN (ua.valid_from) AS valid_from , MIN (oa.valid_from) AS valid_to FROM customers ua JOIN contracts oa ON ua.customer_id = oa.customer_id GROUP BY ua.customer_id -- UNION ALL -- SELECT customer_id , contract_name , valid_from , valid_to FROM contracts -- UNION ALL -- SELECT uc.customer_id , NULL AS contract_name , oc.valid_to AS valid_from , LEAD ( oc.valid_from , 1 , uc.valid_to ) OVER ( PARTITION BY uc.customer_id ORDER BY oc.valid_from ) AS valid_to FROM customers uc JOIN contracts oc ON uc.customer_id = oc.customer_id ) SELECT * FROM union_data WHERE contract_name IS NOT NULL OR valid_from < valid_to ORDER BY customer_id , valid_from ;
Output:
CUSTOMER_ID CONTRACT_NAME VALID_FROM VALID_TO ----------- --------------- ---------- ---------- 1 Contract 1a 01.03.2010 01.10.2010 1 Contract 1b 01.10.2010 01.01.4000 2 01.03.2010 01.05.2010 2 Contract 2a 01.05.2010 01.10.2010 2 01.10.2010 01.12.2010 2 Contract 2b 01.12.2010 01.03.2011 2 01.03.2011 01.01.4000
Published by: Frank Kulash, April 20, 2011 06:51
Examples added -
Unable to create cache with several tables group
Hello
I need to create a group of cache with several tables, which are referential to the other.
There are 2 related tables and table 1 child...
While trying this thing, it gives me an error:
8222: multiple parent tables found
It is not possible to use several tables of root in a single cache group? Is there another way to use it?
Script, I used is:
create a cache group asynchronous writethrough TEST. CG1
of the TEST. ROOT1)
KEY PRIMARY ID VARCHAR2 (8 BYTES),
NAME VARCHAR2 (50 BYTE),
DESCRIPTION VARCHAR2 (255 BYTE),
POLICYTYPEID VARCHAR2 (7-BYTE)),
TEST. ROOT2)
PARAMTYPEID VARCHAR2 (5 BYTES) PRIMARY KEY,
PARAMETERUSAGE VARCHAR2 (1 BYTE),
NAME VARCHAR2 (25 BYTE),
DESCRIPTION VARCHAR2 (255 BYTE)),
TEST. CHILD1)
PARAMDETAILID NUMBER (20) PRIMARY KEY,.
ID VARCHAR2 (8 BYTE),
PARAMETERUSAGE VARCHAR2 (1 BYTE),
DISPLAYVALUE VARCHAR2 (255 BYTE),
OPERATORID VARCHAR2 (5 BYTE),
VENDORID NUMBER (20).
FOREIGN KEY REFERENCES TEST. ROOT1 (ID),
TEST KEY (PARAMETERUSAGE) REFERENCES STRANGERS. ROOT2 (PARAMETERUSAGE));You can't have multiple root within a group of cache tables. The requirements for tables in the group a cache are very strict; There must be only one top-level (root table) table and there may possibly be several children tables. Tables of the child should be linked through foreign keys to the root table or a child table above in the hierarchy.
The solution for your case is among the tables of root and the other root table in a separate cache group and the child table in a cache group. If you do this, you must take care of a few things:
1. you cannot define foreign keys between the tables of groups of different cache in TimesTen (keys may exist in Oracle) so the application must enforce referential integrity itself for these cases.
2. If you load data in a cache group (using LOAD the GROUP CACHE or "load we demand") and Timesten will not automatically load the corresponding data in the other group of cache (since he doesn't know the relationship). The application must load the data into the other group of cache explicitly.
There is no problem with transactional consistency when changes are pushed to Oracle. TimesTen maintains and reinforces the coherence transactional regardless of how the tables are arranged in groups cache correctly.
Chris
-
There was a problem creating the destination folder. If please check the permission of folder or choose a different folder. What that means, tried to name several different folders, but still the same error message. Would be grateful for the help!
This means that the folder you want to create is blocked because of file permissions. The drive or folder you are trying to create the destination folder is set to read-only, and your username does not have write permissions.
-
Why we cannot create more than one primary key on a table. Why we create several unique key on a table. Please explain if anyone have details of this.
«a primary key has semantic meaning, it is to be immutable (never change of value), unique and not null.»
a unique constraint is simply "at any time, these values are unique - they can change and they can be null.
You use a unique when constraint
(a) you do not already have a primary key for a table can have only one
(b) you allow NULL values in attributes
"(c) to allow you to update the values in the attributes.https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:5541352100346689891
-
Problem creating hierarchy based on 2 physical dimension tables
I'm having a problem create 1 dimension logic with a hierarchy of exploration, based on two separate physical dimension tables. The errors I get when navigating in the exploring hierarchy is:
"Cannot find coverage source logical table to the columns of the logical" &
"Missing join between the logical tables.
I use OBIEE 10.1.3.4
Here are the details of what I have set up as:
Physical layer:
Table DIM_ORG with the dimension columns:
-dimension_key
-org_total_code
-org_total_description
-org_detail_code
-org_detail_description
Dimension table DIM_DEPT with columns:
-dimension_key
-dept_total_code
-dept_total_description
-dept_detail_code
-dept_detail_description
FACT_SALES table with columns of facts:
-fk_org
-fk_dept
-sum_sales
Physical joins:
FACT_SALES.fk_org = DIM_ORG_dimension_key
FACT_SALES.fl_dept = DIM_DEPT.dimension_key
Business model and the mapping of layer:
I created a logical dimension ORG_DEPT. It contains two sources of logic table (DIM_ORG & DIM_DEPT) and the following logical columns:
-All departments (mapped to dept_total_code)
-Organization (mapped to org_detail_description)
-Organisation number (mapped to org_detail_code)
-Department (mapped to dept_detail_description)
-Department Code (mapped to dept_detail_code)
The logical key of the company is based on the combination of number of organization & Department Code
The hierarchy, I need is: all departments-> organization-> Department so I created the following hierarchy for ORG_DEPT:
-Total level containing: all departments
-Organization level containing: company (defined as logical level key) number & Organisation (als defined the key level drill)
/ Department detail level containing: Department (defined as logical level key) Code and the Department (defined as key level drill).
In the LTS of the ORG_DEPT dimension, I've set levels of content for sources:
DIM_ORG: Level of organization
DIM_DEPT: Level of detail Department
The LTS non - joins inner - came against the associated physical tables.
I created a logical fact table (based on the physical fact table) SALES and joined him on the ORG_DEPT logical dimension table.
In the LTS, level of content for ORG_DEPT is part of the level of retail service. Non - joins inner were aded against related physical tables.
When I create a report in response to test the hierarchy and select only "all departments' I get the value of the returned correct size. When I try to break through to the next level, I get the following ODBC error:
"Could not find coverage source logical table for logical columns: [all of them]." "Please check more detailed level keys are correctly mapped.
When I create a report in responses and select "Every department" and "Sales", I get the correct result. When I try to break through to the next level, I get a different ODBC error:
"Lack of join between the logical tables DIM_DEPT and DIM_DEPT: there must be at least a physical link to join between the underlying physical tables.
All suggestions are welcome!
Thank you!You have no relationship defined between the Department and org.
You can either:
a. create a table of physical dimension with a composite key of org_id & dept_id if there is a relationship defined somewhere, then to obiee model as you have already done, but in the physical layer on the composite key join
b. model your exisitng as two-dimensional and two hierarchies tables and set up a path of forest favorite between them according to your needs.Kind regards
Robert
-
How to create a table of contents of several levels?
How to create a table of contents of several levels, or at least a TOC of two levels, so that when you click on the sign '+' or something similar to the first level, the second level will increase?
Select the item/s from the list Table of contents, and then use the arrows that will apear at the bottom of the skin Editor to move them to the right. This will cause a new point TOC to appear as a cap for all items indented beneath it.
Be aware that during the execution by clicking on this article of the topic does not operate the game to slide under him. There is no that expand the group to show slides of the child. You will then need to click on the first slide of the child in the group to trigger playback. Personally I don't like the way it works, but that's how it is. Register a feature (like me) request if you want that it works differently in a future version of Captivate.
-
Problems of creating a Table of contents of an InDesign document
I am putting together a test document so that it contains all the styles, I need to create a Table of contents, and I am new to the control of this process, I appreciate any help I can get from the community here.
I have my paragraph styles, both for the headings in the document, as well as for table of contents entries, and I have them mapped to appropriate levels in the style of Table of contents.
First problem: When I look at one the resunting table of contents, the entries are sort according to the page they are but not their position on the page. These entries are contained in different text blocks arranged on each page. Certainly, it must be possible to make it work!
Second problem: I can't get the function of head of the tab work the same way for two different styles for the same level within the table of contents. In other words, the page numbering for the style hidden for my headers (placed on layers to hide when the document print) does not justify the right in alignment with the right reason for the numbering of headings unhidden. I have OCD topics paragraph style in place with a tab on right justify, with a '. ' in the ' Leader: "box. When you change the style of table of contents, I have the box "between entry and number" to "Right indent tab." Is there a different setting for what I should use for this box "between entry and number? I have not found a good explanation of options two dozen on the list of choices.
Here's an example of what looks like my OCD:
Topic #1........................................................1
#2 theme (which is hidden)... 1
Part of the #1 section has
Theme #1 part b
Part of the #2 section a, which is hidden.
Topic #3........................................................2
Topic #4........................................................2
Part of the #3 a topic
Theme #3 part b
Part of the #4 section has
Theme #4 part b
Topic #5 (what is hidden)... 3
Part of the #5 section a, which is hidden
Thanks in advance for your help.
The general principle is that ID leans on the upper left corner of the insert text frames and begins with one who is on the left, then moves down. This means that a block of text that begins at the bottom of the page, but whose left edge is more to the left, will be picked up before a frame which is high on the page, but whose left edge is more to the right.
-
create the view of several tables of days
Hello
I'll have existing oracle db with the daily stat data, tables strangely named data_mon, data_tue, data_wed... For my batch that I intend to use the view with multiple day data, let say for the last 5 days.
Do not know how better to implement my sql with these suffixes _mon statement to make it more or less dynamic.
I create also ever seen from several tables, then, probably, that I can do something that will add daily updated data and remove data from 5 days?
You will appreciate comments on the details and the whole concept. I have prev sql server experience.
Thank you
Tuser12943718 wrote:
Hello
I'll have existing oracle db with the daily stat data, tables strangely named data_mon, data_tue, data_wed... For my batch that I intend to use the view with multiple day data, let say for the last 5 days.
Do not know how better to implement my sql with these suffixes _mon statement to make it more or less dynamic.
I create also ever seen from several tables, then, probably, that I can do something that will add daily updated data and remove data from 5 days?You will appreciate comments on the details and the whole concept. I have prev sql server experience.
Thank you
TChange the data model if you have 1 table for a day.
You have just a DATA table and a column to indicate the day of the application.
Then you don't need a view, do not need anything dynamic, do not need to break your head against a wall for a simple query... etc.
-
Create a trigger instead of update several tables in a view
Dear everybody
I am trying to create a trigger that updates instead of to day joined several tables in a view, but I can't get my trigger to work. The create view command was as follows:
The view above connects a polygon table to the table of function names which means that a polygon appears several times in a view, even though one version of the polygon exists in the base table. This means the direct update of view cannot take place, since 1 polygon can appear multiple times in a view. The two original base tables and their columns names are:CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC AS SELECT MAP_INDEX.mi_prinx, index_type_id, original_map_publication_id, original_map_sheet_number_id, name_of_feature, geog_coordinates_id, GEOG_COORDINATES.mi_prinx AS "mi_prinx_polygon", GEOG_COORDINATES.geographical_coordinates, GEOG_COORDINATES.mapinfo_style_row FROM MAP_INDEX JOIN GEOG_COORDINATES ON geog_coordinates_id=GEOG_COORDINATES.mi_prinx;
Relax, I created was as follows:MAP_INDEX --------- MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE MAPINFO_STYLE_ROW GEOGRAPHICAL_COORDINATES GEOG_COORDINATES_ID GEOG_COORDINATES ---------------- MI_PRINX GEOGRAPHICAL_COORDINATES MAPINFO_STYLE_ROW
The idea is that when I draw a new polygon in MapInfo and assign him a revised number geog_coordinates_id and the number of mi_prinx_polygon, which are the same, once I have save the view as then it updates the underlying tables. Geographical_coordinates and mapinfo_style_row of map_index table columns are columns with ancient polygon data which while not having currently new data inserted into them, are required for the previous data they contain. These data are currently being added to the geog_coordinates table with other scripts. The idea is that all the data is then read using a view and updates made to the view, triggering instead of relaxing, so data are not duplicated but still visible as if it were.CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC REFERENCING NEW AS NEW FOR EACH ROW BEGIN UPDATE MAP_INDEX SET mi_prinx = :NEW.mi_prinx, index_type_id = :NEW.index_type_id, original_map_publication_id = :NEW.original_map_publication_id, original_map_sheet_number_id = :NEW.original_map_sheet_number_id, name_of_feature = :NEW.name_of_feature, mapinfo_style_row = :NEW.mapinfo_style_row, geographical_coordinates = :NEW.geographical_coordinates, geog_coordinates_id = :NEW.geog_coordinates_id WHERE geog_coordinates_id = :OLD.geog_coordinates_id; UPDATE GEOG_COORDINATES SET mi_prinx = :NEW.mi_prinx, geographical_coordinates = :NEW.geographical_coordinates, mapinfo_style_row = :NEW.mapinfo_style_row WHERE mi_prinx = :OLD.mi_prinx; END; /
When I created first the relaxation above in SQLdeveloper it seems to run constantly. Then my computer crashed, not related to this work, and I lost session because I did not commit it. I was not ready to commit it because I believe that something is wrong.
I am in the trigger syntax correctly and I go about it in the right way? I want to only update the rows that have changed, that's why I was using: NEWS and: OLD.
Kind regards
Tim
Published by: user467357 on November 18, 2008 18:07
I modified my script a little because there were a few errors. for example. start and old as old and view name typoSomething like this->
satyaki> satyaki>select * from v$version; BANNER ---------------------------------------------------------------- Oracle 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 Elapsed: 00:00:01.78 satyaki> satyaki> satyaki>create table MAP_INDEX 2 ( 3 mi_prinx NUMBER(10) not null, 4 index_type_id NUMBER(6) not null, 5 original_map_publication_id NUMBER(6) not null, 6 original_map_sheet_number_id NUMBER(6) not null, 7 name_of_feature VARCHAR2(80) not null, 8 mapinfo_style_row VARCHAR2(80), 9 geographical_coordinates SDO_GEOMETRY, 10 geog_coordinates_id NUMBER(10), 11 constraints pk_mi_prinx primary key(mi_prinx) 12 ); Table created. Elapsed: 00:00:04.39 satyaki> satyaki>create table GEOG_COORINDATES 2 ( 3 mi_prinx NUMBER(10) not null, 4 geographical_coordinates SDO_GEOMETRY, 5 mapinfo_style_row VARCHAR2(80), 6 constraints pk_mi_prinx_n primary key(mi_prinx) 7 ); Table created. Elapsed: 00:00:00.30 satyaki> satyaki> satyaki>CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC 2 AS 3 SELECT MAP_INDEX.mi_prinx, 4 MAP_INDEX.index_type_id, 5 MAP_INDEX.original_map_publication_id, 6 MAP_INDEX.original_map_sheet_number_id, 7 MAP_INDEX.name_of_feature, 8 MAP_INDEX.geog_coordinates_id, 9 GEOG_COORINDATES.mi_prinx AS "mi_prinx_polygon", 10 GEOG_COORINDATES.geographical_coordinates, 11 GEOG_COORINDATES.mapinfo_style_row 12 FROM MAP_INDEX , GEOG_COORINDATES 13 WHERE MAP_INDEX.geog_coordinates_id=GEOG_COORINDATES.mi_prinx; View created. Elapsed: 00:00:00.32 satyaki> satyaki> satyaki>insert into MAP_INDEX values( 2 &mi_prinx, 3 &index_type_id, 4 &original_map_publication_id, 5 &original_map_sheet_number_id, 6 '&name_of_feature', 7 '&mapinfo_style_row', 8 null, 9 &geog_coordinates_id); Enter value for mi_prinx: 1 old 2: &mi_prinx, new 2: 1, Enter value for index_type_id: 44 old 3: &index_type_id, new 3: 44, Enter value for original_map_publication_id: 5678 old 4: &original_map_publication_id, new 4: 5678, Enter value for original_map_sheet_number_id: 356 old 5: &original_map_sheet_number_id, new 5: 356, Enter value for name_of_feature: AA old 6: '&name_of_feature', new 6: 'AA', Enter value for mapinfo_style_row: GG old 7: '&mapinfo_style_row', new 7: 'GG', Enter value for geog_coordinates_id: 9 old 9: &geog_coordinates_id) new 9: 9) 1 row created. Elapsed: 00:00:00.16 satyaki>/ Enter value for mi_prinx: 2 old 2: &mi_prinx, new 2: 2, Enter value for index_type_id: 55 old 3: &index_type_id, new 3: 55, Enter value for original_map_publication_id: 6789 old 4: &original_map_publication_id, new 4: 6789, Enter value for original_map_sheet_number_id: 357 old 5: &original_map_sheet_number_id, new 5: 357, Enter value for name_of_feature: BB old 6: '&name_of_feature', new 6: 'BB', Enter value for mapinfo_style_row: 10 old 7: '&mapinfo_style_row', new 7: '10', Enter value for geog_coordinates_id: 8 old 9: &geog_coordinates_id) new 9: 8) 1 row created. Elapsed: 00:00:00.04 satyaki> satyaki>commit; Commit complete. Elapsed: 00:00:00.03 satyaki> satyaki> satyaki>insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row'); Enter value for mi_prinx: 9 Enter value for mapinfo_style_row: FFG old 1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row') new 1: insert into GEOG_COORINDATES values(9,null,'FFG') 1 row created. Elapsed: 00:00:00.07 satyaki>/ Enter value for mi_prinx: 8 Enter value for mapinfo_style_row: GGT old 1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row') new 1: insert into GEOG_COORINDATES values(8,null,'GGT') 1 row created. Elapsed: 00:00:00.05 satyaki> satyaki>commit; Commit complete. Elapsed: 00:00:00.02 satyaki> satyaki>select * from VIEW_MI_JOIN_GC; MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES) ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- --------------------------------------------------------------------------------------------------------------- 1 44 5678 356 AA 9 9 2 55 6789 357 BB 8 8 Elapsed: 00:00:00.09 satyaki> satyaki> satyaki>CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC 2 INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC 3 FOR EACH ROW 4 DECLARE 5 m_info_svw varchar2(80); 6 BEGIN 7 m_info_svw := :NEW.mapinfo_style_row; 8 9 UPDATE MAP_INDEX 10 SET mi_prinx = :NEW.mi_prinx, 11 index_type_id = :NEW.index_type_id, 12 original_map_publication_id = :NEW.original_map_publication_id, 13 original_map_sheet_number_id = :NEW.original_map_sheet_number_id, 14 name_of_feature = :NEW.name_of_feature, 15 mapinfo_style_row = m_info_svw, 16 geographical_coordinates = :NEW.geographical_coordinates, 17 geog_coordinates_id = :NEW.geog_coordinates_id 18 WHERE geog_coordinates_id = :OLD.geog_coordinates_id; 19 UPDATE GEOG_COORINDATES 20 SET mi_prinx = :NEW.geog_coordinates_id, 21 geographical_coordinates = :NEW.geographical_coordinates, 22 mapinfo_style_row = m_info_svw 23 WHERE mi_prinx = :OLD.geog_coordinates_id; 24 END; 25 / Trigger created. Elapsed: 00:00:00.20 satyaki> satyaki>select * from VIEW_MI_JOIN_GC; MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES) ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- --------------------------------------------------------------------------------------------------------------- 1 44 5678 356 CC 9 9 2 55 6789 357 BB 8 8 Elapsed: 00:00:00.09 satyaki> satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES; MI_PRINX MAPINFO_STYLE_ROW ---------- -------------------------------------------------------------------------------- 9 FFG 8 GGT Elapsed: 00:00:00.07 satyaki>select * from MAP_INDEX; MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE MAPINFO_STYLE_ROW GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------------------- 1 44 5678 356 CC HHH 2 55 6789 357 BB HHH Elapsed: 00:00:00.12 satyaki> satyaki>update VIEW_MI_JOIN_GC 2 set name_of_feature = 'DD' 3 where mi_prinx = 1; 1 row updated. Elapsed: 00:00:00.05 satyaki> satyaki>select * from VIEW_MI_JOIN_GC; MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES) ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- --------------------------------------------------------------------------------------------------------------- 1 44 5678 356 DD 9 9 2 55 6789 357 BB 8 8 Elapsed: 00:00:00.08 satyaki> satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES; MI_PRINX MAPINFO_STYLE_ROW ---------- -------------------------------------------------------------------------------- 9 FFG 8 GGT Elapsed: 00:00:00.06 satyaki> satyaki>update VIEW_MI_JOIN_GC 2 set mapinfo_style_row = 'OOOO' 3 where mi_prinx = 1; 1 row updated. Elapsed: 00:00:00.05 satyaki> satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES; MI_PRINX MAPINFO_STYLE_ROW ---------- -------------------------------------------------------------------------------- 9 OOOO 8 GGT Elapsed: 00:00:00.06 satyaki> satyaki>select mapinfo_style_row from MAP_INDEX; MAPINFO_STYLE_ROW -------------------------------------------------------------------------------- OOOO HHH Elapsed: 00:00:00.06 satyaki>
Hope this will help you.
Kind regards.
LOULOU.
-
Problem in creating several attributes XML with the same name of the attribute
I am trying without success trying to create several attributes XML with the same name, as shown here in a Microsoft example configuration file:
I'm calling the NewDocument GetRootElement functions and then "newelement" (appSetting), "newelement" (add)
Then I call AddAttribute with add, key & Key0, then with add, value & 0. This seems to work fine but when I try to add the second pair of key & Key1 and value attributes & 1 for item "Add" replaces "
"and I find myself with" " only. I do something wrong or CVI is not able to create an XML of this type?
Thank you
Here's how you do it. I show not to keep things simple error checking.
#include
public static void CreateAddElement (mother of CVIXMLElement, const char * key, const char * value)
{
Add the CVIXMLElement;
CVIXMLNewElement (parent, -1, 'Add', &add);)
CVIXMLAddAttribute (add, "touch", key);
CVIXMLAddAttribute (add, "value", value);
CVIXMLDiscardElement (add);
}void main (void)
{
CVIXMLElement root, and appSetting;
Doc CVIXMLDocument.
CVIXMLNewDocument ("configuration", &doc);)
CVIXMLGetRootElement(doc, &root);)
CVIXMLNewElement (root,-1, "appSetting", and appSetting);
CreateAddElement (appSetting, "Key0", "0");
CreateAddElement (appSetting, "Key1", "1");
CreateAddElement (appSetting, "Key2", "2");
CVIXMLDiscardElement (appSetting);
CVIXMLDiscardElement (root);
CVIXMLSaveDocument (doc, 1, "c:\\temp\\temp.xml");
CVIXMLDiscardDocument (doc);
} -
Hello
I am building an application that handles (APEX 4.0) material inventory. I have an entry page that adds data to two or more tables at once. The page has two forms on it pointing to two separate tables. However when I try to run the page, it fails and returns an error:
ORA-06550: line 1, column 437: PL/SQL: ORA-00904: "ORH_LAST_UPDATE_DATE": invalid identifier ORA-06550: line 1, column 7: PL/SQL: statement ignored
Error failed to process row in the IDD_ID_DATA table.
As far as I can see in the application, this column is not in question (I don't even do anything for her and she is nullable). I looked at the application itself as well as some research online but can't find anything useful...
So my question is this: is it possible to add several tables to a page? If yes how?
I'm new to APEX so any help would be greatly appreciated!UPDATE:
I received an email from support of APEX team:
«The answer is simple, it's you will need manually code processes query (and DML) If you want to maintain multiple tables on a page (there is a limit of a table when you use the integrated process).»
For this I suggest that you remove the process generated by the wizards and create processes of PL/SQL with insert, update, delete statements as needed. "This encoding is not difficult but takes much longer when you can use the integrated process.I've been playing with code PL/SQL and the final result is the following:
Start
INSERT INTO table1
VALUES)
: P2_Item_Field1,.
(: P2_Item_Field2);
INSERT INTO table2
VALUES)
: P2_Item_Field1,.
(: P2_Item_Field2);
end;I used this code in a PL/SQL custom in the treatment process > section to the Page processing and it seems to work fine now. The only downside to this method is that if the name of a Page element is changed the code will also have to be changed. Except that I had no problem.
-
Insert APPEND Hint in several tables
Hi all:
Let me say at the outset that I have no dataset example of post, it is just an issue where I'm hoping to get some directions to help out my own query.
I have an insert multi-table into two tables. When I use the indicator append, the plan of the explain command is no indication that the indicator is respected. But if I change the statement and perform an insert in a single table, then I see "LIVE LOAD INTO" in the plan.
I'm stumped as to how to begin troubleshooting. Does anyone have ideas on how you might tackle a problem like this?
Thanks in advance!Looks like it works right out of the box. Here is an example of using 11.2.0.2:
create table t1 (c1 number) parallel 2; create table t2 (c1 number) parallel 2; alter session enable parallel dml; explain plan for insert all into t1 (c1) values (rnd) into t2 (c1) values (rnd) ( select 1 as rnd from dual connect by level < 10000 ); SELECT * FROM TABLE(dbms_xplan.display); rollback; alter session disable parallel dml;
Here is the output of DBMS_XPLAN showing the LIVE MODE on several tables:
Plan hash value: 2997348579 ---------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib | ---------------------------------------------------------------------------------------------------------------------------- | 0 | INSERT STATEMENT | | 1 | 3 | 2 (0)| 00:00:01 | | | | | 1 | PX COORDINATOR | | | | | | | | | | 2 | PX SEND QC (RANDOM) | :TQ10001 | | | | | Q1,01 | P->S | QC (RAND) | | 3 | MULTI-TABLE INSERT | | | | | | Q1,01 | PCWP | | | 4 | PX RECEIVE | | | | | | Q1,01 | PCWP | | | 5 | PX SEND ROUND-ROBIN | :TQ10000 | | | | | | S->P | RND-ROBIN | | 6 | VIEW | | 1 | 3 | 2 (0)| 00:00:01 | | | | |* 7 | CONNECT BY WITHOUT FILTERING| | | | | | | | | | 8 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 | | | | | 9 | DIRECT LOAD INTO | T1 | | | | | Q1,01 | PCWP | | | 10 | DIRECT LOAD INTO | T2 | | | | | Q1,01 | PCWP | | ---------------------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 7 - filter(LEVEL<10000)
Now, there are a series of restrictions on the direct expenses as soon as you start the overlay on the constraints and triggers. See the restrictions in this section: [documentation Oracle 11.2 INSERT | http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9014.htm#SQLRF01604]
NOTE: Edited to remove the sentence that PARALLEL DML has been the key. It's not as demonstrated in successive messages but still it trigger inserts in DIRECT-path on an INSERT ALL.
Published by: scatmull on August 22, 2011 12:55
Published by: scatmull on August 22, 2011 13:56
Maybe you are looking for
-
After update to Melodyne and logic Melodyne has stopped working as a plugin in Logic. Logic open Melodyne but the waiting circle appears instantly and you will have to force close logic. Melodyne works very well in stand-alone mode. Someone else with
-
HP ePrint only works for the main e-mail address, does NOT work for the other email address
I have several e-mail addresses configured in the list of authorized sender, but it seems to work only for e-mail messages sent from the e-mail address (main) of the owner. I get a confirmation email when I use other e-mail addresses, saying that "la
-
All- I have my data (20 columns of ~ 700 000 lines) stored in a binary file and I would like to add a timestamp to each row of data. I intend to use the sampling with the number of samples to add the time at which the sample was recorded in data. I
-
Sale on Visual Studio 2008 Professional Edition Academic
Hello My apologies if this is in the wrong forum but none appeared there. I recently finished a course in VB.Net and I wondered what the implications of the sale on the study material, specifically to the copy of VS 2008 Pro Edition (academic) accomp
-
Try to install KB2656378, get error codes: 0 x 643 and 0x8007F070
I tried ALL suggested fixes, including MicrosoftFixIt50123 etc, uninstall and reinstall all versions of .NET Framework, for the following problem that has persisted for six weeks. "The following update has not been installed: a security update for Mi