FindGrep results in tables tables, depending on the object table of GOLD?
Hello
Currently, I get the text, I would like to consider using an index of PointInsertion from a previous search:
... . parent.insertionPoints.itemByRange (startPos, endPos)
Original research, as I did, I got a simple table, but the search inside the insertionPoints, I had an array of arrays.
Code example below. Just open a new blank document in InDesign and run the following. Adapted text is added in the code example, of research. (Tested in CS6 so far.)
var activeDocument = app.activeDocument; var pg = activeDocument.pages[0]; var fr = pg.textFrames.add(); fr.geometricBounds = [20, 20, 100, 100]; fr.contents = 'a00sdf 12-9999\n15-888' app.findGrepPreferences = app.changeGrepPreferences = null; // Search for digits on a certain pattern app.findGrepPreferences.findWhat = '\\d\\d-\\d\\d+'; var findings =activeDocument.findGrep(); // Searching the whole document // The result is an array of Text objects $.writeln('1. ' + findings[0].constructor.name); // Result: Text // Now search using an insertionPoint object instead. Search from the start (0) up to the position where we found the first match in the grep above. var myTextObj = findings[0]; var insObj = myTextObj.parent.insertionPoints.itemByRange(0, myTextObj.index) // Now just search for any two digits app.findGrepPreferences.findWhat = '\\d\\d'; var innerFindings = insObj.findGrep(); // Searching inside the insertion points object // The result is an Array of Arrays $.writeln('2. ' + innerFindings[0].constructor.name); // Result: Array // ... inside which are the Text objects $.writeln('3. ' + innerFindings[0][0].constructor.name); // Result: Text // ... so why did I get an array of arrays when searching inside the insertionPoints object?
Thank you
Andreas
Hi all
In any case, a range of text is a special beast compared to the results of.itemByRange (...) the regular Collection.
The fact is that myText. insertionPoints.itemByRange (0, myIndex) provides a collective PointInsertion (and it would be the same with the characters, wordsor any collection of text), but this text range instantly forced into an single text unit as soon as you access a property. Compare:
.pointSize de.stories.itemByRange (0, -1) myDoc(1); => Size chart
(2) myText. insertionPoints.everyItem () .pointSize; => Size chart
(3) myText.pointSize de.insertionPoints.itemByRange (0, -1); / /-online single size (even in the heterogeneous context)
Thus, text ranges are specially treated as text units, which leads to ask why myRange.findGrep () returns an array of arrays. IMO, the DOM is not in conformity on this point.
As shown in Peter, the workaround is easy. We just need to explicitly convert the beach in unity of the text reference is made, using either () myRange.getElements [0] or myRange.texts [0].
@+
Marc
Tags: InDesign
Similar Questions
-
Hi all
Oracle DB version: 11.2
I have an object called XLZ, there a lot of dependencies on other objects. In this sense, it uses a lot of packages inside. I want to list all the packages that are used inside the package XYZ. Not only that, but I need to drill down to all of its packages and find the dependence of it, until I have find the package that has no dependencies. I'm not bothered about the other any other object of the Package body.
I tried to write the query something like this:
Select * from DBA_DEPENDENCIES
First name = 'XYZ' and type = 'PACKAGE BODY'
Connect prior REFERENCED_NAME = name
and referenced_type = 'PACKAGE BODY';
But this only gives the package dependent with XYZ. This does not bore down to the package of sheet body.
My expected output is:
(1) view all dependent modules of XYZ
(2) Let's say XYZ depends on CBA, PQR and EFG
(3) now to explore the body of ABC and PQR EFG package and pick up his package depending on body
(4) keep this iteration until you find no dependence more
Thank you.
Maybe
Select *.
(select level lvl, is_cycle road, sys_connect_by_path(name,'/') connect_by_iscycle, ud.*)
of user_dependencies ud
First name = 'CYCLIC_ORDER' and type = 'PACKAGE BODY'
connect to nocycle
prior referenced_name = name
and prior referenced_type = "PACKAGE".
)
where referenced_type = 'PACKAGE '.
LVL IS_CYCLE PATH NAME TYPE REFERENCED_OWNER REFERENCED_NAME REFERENCED_TYPE REFERENCED_LINK_NAME SCHEMAID DEPENDENCY_TYPE 1 1 / CYCLIC_ORDER CYCLIC_ORDER PACKAGE BODY ETBIN CYCLIC_ORDER PACKAGE - 202055 HARD 2 0 / CYCLIC_ORDER/CYCLIC_ORDER CYCLIC_ORDER PACKAGE BODY SYS STANDARD PACKAGE - 202055 HARD 2 0 / CYCLIC_ORDER/CYCLIC_ORDER CYCLIC_ORDER PACKAGE SYS STANDARD PACKAGE - 202055 HARD 1 0 / CYCLIC_ORDER CYCLIC_ORDER PACKAGE BODY SYS STANDARD PACKAGE - 202055 HARD Concerning
Etbin
-
Hello
I am train to write a procedure where I would spend the table as a parameter name and then the code would determine it is column names, and then he would insert records in each column depending on the data type. could someone help me with this.
Thank you
SM
Hello
Perhaps you need to dummy data just for the table.
Here is my exercise
create or replace procedure generate_rows(p_table_name varchar2, p_count number) is -- function insert_statement(p_table_name varchar2) return clob is l_columns clob; l_expressions clob; l_sql clob default 'insert into p_table_name (l_columns) select l_expressions from dual connect by level <= :p_count'; begin select -- l_columns listagg(lower(column_name), ',') within group (order by column_id), -- l_expressions listagg( case when data_type = 'DATE' then 'sysdate' when data_type like 'TIMESTAMP%' then 'systimestamp' when data_type = 'NUMBER' then replace('dbms_random.value(1,max)', 'max', nvl(data_precision - data_scale, data_length) ) when data_type = 'VARCHAR2' then replace(q'|dbms_random.string('a',data_length)|', 'data_length', data_length ) else 'NULL' end, ',') within group (order by column_id) into l_columns, l_expressions from user_tab_columns where table_name = upper(p_table_name); -- l_sql := replace(replace(replace(l_sql, 'p_table_name', p_table_name), 'l_columns', l_columns), 'l_expressions', l_expressions); -- debug dbms_output.put_line(l_sql); -- return l_sql; end; begin execute immediate insert_statement(p_table_name) using p_count; end; / -- test create table mytable( id number(4,0), txt varchar2(10), tstz timestamp with time zone, dt date, xml clob ) ; set serveroutput on exec generate_rows('mytable', 10); select id, txt from mytable ; drop procedure generate_rows ; drop table mytable purge ; Procedure GENERATE_ROWS compiled Table MYTABLE created. PL/SQL procedure successfully completed. insert into mytable (id,txt,tstz,dt,xml) select dbms_random.value(1,4),dbms_random.string('a',10),systimestamp,sysdate,NULL from dual connect by level <= :p_count ID TXT ---------- ---------- 3 WnSbyiZRkC 2 UddzkhktLf 1 zwfWigHxUp 2 VlUMPHHotN 3 adGCKDeokj 3 CKAHGfuHAY 2 pqsHrVeHwF 3 FypZMVshxs 3 WtbsJPHMDC 3 TlxYoKbuWp 10 rows selected Procedure GENERATE_ROWS dropped. Table MYTABLE dropped.
and here is the vision of Tom Kyte for the same https://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2151576678914
Edit: to improve my code, it must use p_count as bind as Tom.
-
Hello
If I delete a table, then the following, which will be automatically removed by oracle if they depend on the same deleted table?
VIEW (forced the view and the normal display mode)
SYNONYM
PROCEDURE
FUNCTION
TRIGGER904298 wrote:
all of them will be invalid if the table is dropped?NO, now prove me right or wrong.
-
calculate the balance depends on the previous record result
Hello
I have a requirement like calculating the balance depends on the previous record result. but I'm unable to accomplish by using select statement.
Sample data: WITH T AS (SELECT 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 14 AMOUNT, 0.3 PERCENT FROM DUAL )
process: 10(AMOUNT) * 0.2(PERCENT) = 2 11 - 2(Result of previous calculation) = 9 12 - 9(Result of previous calculation) = 3 13 -3(Result of previous calculation) = 10 14 - 10(Result of previous calculation) = 4;
Please, help me build the select statement.required output. AMOUNT RESULT 10 2 11 9 12 3 13 10 14 4
There is no order in the lines of the relational table. Only ORDER BY guarantees the order. So, even if the AMOUNT is increasing in your sample, I guess in life real amounts are in no particular order. If Yes, you need another column indicating the order of the lines:
WITH T AS ( SELECT 1 ID, 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 2 ID, 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 3 ID, 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 4 ID, 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 5 ID, 14 AMOUNT, 0.3 PERCENT FROM DUAL ) SELECT AMOUNT, RESULT FROM T MODEL DIMENSION BY(ID) MEASURES(AMOUNT,AMOUNT RESULT,PERCENT) RULES( RESULT[1] = RESULT[1] * PERCENT[1], RESULT[ID > 1] ORDER BY ID = RESULT[CV()] - RESULT[CV() - 1] ) ORDER BY ID / AMOUNT RESULT ---------- ---------- 10 2 11 9 12 3 13 10 14 4 SQL>
If the AMOUNT is still growing:
WITH T AS ( SELECT 10 AMOUNT, 0.2 PERCENT FROM DUAL UNION ALL SELECT 11 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 12 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 13 AMOUNT, 0.3 PERCENT FROM DUAL UNION ALL SELECT 14 AMOUNT, 0.3 PERCENT FROM DUAL ) SELECT AMOUNT, RESULT FROM T MODEL DIMENSION BY(ROW_NUMBER() OVER(ORDER BY AMOUNT) ID) MEASURES(AMOUNT,AMOUNT RESULT,PERCENT) RULES( RESULT[1] = RESULT[1] * PERCENT[1], RESULT[ID > 1] ORDER BY ID = RESULT[CV()] - RESULT[CV() - 1] ) ORDER BY ID / AMOUNT RESULT ---------- ---------- 10 2 11 9 12 3 13 10 14 4 SQL>
SY.
-
Hi, I have a little problem. I want to fill a table with the results of a flat Structure of the sequence.
Sorry, I can't pass the code, but here's a screenshot.
I hope someone can help.
(I'm quite beginner.)
Hi touchko,.
You must use the following:
-Register to keep the table stored during several iterations to offset
-InitArray function to initialize the array to the desired size
-ReplaceArraySubset to put your values into the right position (index)
It's a shame you can't show your VI. The small party is not sufficient to provide more help than this...
-
Hi gurus,
SQL > select * from v version $;
BANNER
----------------------------------------------------------------
Oracle Database 10g Release 10.2.0.4.0 - Production 64-bit
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for Linux: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL >
I want a table nested in the object. Here's my implementation
CREATE or REPLACE TYPE test_language_obj AS OBJECT
(returned VARCHAR2 (3),)
Description varchar2 (50)
)
/
CREATE or REPLACE TYPE test_language_tab AS TABLE OF THE test_language_obj;
/
CREATE or REPLACE TYPE test_Region_obj () AS OBJECT
get rid of the VARCHAR2 (6).
r_date DATE,
lang_tab test_language_tab,
CONSTRUCTOR FUNCTION test_Region_obj RETURNS RESULTS of AS SELF);
/
CREATE or REPLACE TYPE test_Region_tab AS TABLE OF THE test_Region_obj;
/
When I run the suite of applications, it works fine
Select test_language_obj ('001', 'This is the English language code') of double
But when I run the following question
SELECT Test_Region_obj ('111 ', sysdate, (select test_language_obj ('001', 'This is the English language code') of double)) double
It gives following error
ORA-06553: PLS-306: wrong number or types of arguments in the call to 'TEST_REGION_OBJ '.
My goal is to get all languages within the region.
Anyone can point out what I'm missing here?
Thanks in advance.
The problem is that your test_Region_obj does not contain an object of test_language_obj but a collection of test_language_obj objects.
If the constructor of test_Region_obj waiting for the 3rd Argument of type test_language_tab instead of test_language_obj.
HTH
Roger
-
How to fill the value in the nested table by using the object type
Hi gurusI created an object type and able to fill the values in it, now I want to create a nested table type of this object and fill it but looks like I'm doing something wrong, see my code below.
Code example
CREATE or REPLACE TYPE countries_o
AS
OBJECT
(
COUNTRY_ID TANK (2 BYTES),
COUNTRY_NAME VARCHAR2 (40 BYTE),
REGION_ID NUMBER);
/create or replace type countries_t is table of the countries_o;
/CREATE OR REPLACE
ABC of the PROCEDURE
IS
v_print countries_t; -: = arr_countries_t('01','Aus',1);
BEGIN
v_print: = countries_t('01','A',11);
DBMS_OUTPUT. Put_line (v_print. COUNTRY_ID | v_print. COUNTRY_NAME | v_print. REGION_ID);
END;
/
Error
- Error (6.3): PL/SQL: statement ignored
- Error (6,12): PLS-00306: wrong number or types of arguments in the call to 'COUNTRIES_T '.
- Error (7.3): PL/SQL: statement ignored
- Error (7.32): PLS-00302: component 'COUNTRY_ID' must be declared
Thanks in advance
Concerning
Muzz
Hi user,
Here is another method that you can try-
CREATE OR REPLACE
ABC of the PROCEDURE
IS
v_print countries_t: = countries_t (countries_o('01','A',11));
BEGIN
DBMS_OUTPUT. Put_line (v_print (1).) COUNTRY_ID | v_print (1). COUNTRY_NAME | v_print (1). REGION_ID); -you're accessinf the first element of the nested table, which in turn points to the object.
END;
In the sections of the declaration you have assigned values to the nested table.
Kind regards
Maxou - Error (6.3): PL/SQL: statement ignored
-
How to start a job using DBMS_SCHEDULER depending on the result of other JOBS
How to start a job using DBMS_SCHEDULER depending on the result of other JOBS
For example I have two jobs A and B of EMPLOYMENT, I would like to start JOB B only when a JOB is complete, is an option like that?
Hello
Yes, you can create a channel with the Scheduler, see the documentation:
Creation and management of channels of employment
http://docs.Oracle.com/CD/E11882_01/server.112/e25494/scheduse.htm#ADMIN10021
-
Insert the object into the table
Hi all
I would insert my type of object in a table without specifying the name of the variable.
That's my bad example:
create or replace type MY_TYPE_OBJ as object ( val1 number, val2 number, val3 number ); / CREATE TABLE MY_TABLE of MY_TYPE_OBJ; / declare myType MY_TYPE_OBJ; begin myType := new MY_TYPE_OBJ(1, 2, 3); insert into MY_TABLE values (myType.val1, myType.val2, myType.val3); end; /
As you can see, on my last procedure, I had to use the insert into statement with val1, val2, val3 name filed.
Is there a quicker way to insert an object into a table? In the production environment of the object type that almost 100 filed is not so friendly to write each one by one.
Thank you
Federico
Example:
SQL> create or replace type TFoo as object( 2 attr1 integer, 3 attr2 varchar2(10), 4 attr3 date 5 ); 6 / Type created. SQL> SQL> create table footab of TFoo( 2 attr1 primary key, 3 attr2 not null 4 ) organization index 5 / Table created. SQL> SQL> declare 2 foo TFoo; 3 begin 4 foo := new TFoo( 1, 'test1', trunc(sysdate) ); 5 insert into footab values foo; 6 end; 7 / PL/SQL procedure successfully completed. SQL> SQL> select * from footab; ATTR1 ATTR2 ATTR3 ---------- ---------- ------------------- 1 test1 2014/08/27 00:00:00 SQL>
I agree though - be careful with tables of objects and now their technical implementation and advantages and disadvantages.
-
(1) I received an email like this:
Event_alert
2013-09-17 22:00:16 ERROR OGG - 01028 Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 80673 is compressed. Compression of the table is not supported.
2013-09-17 22:00:16 ERROR OGG - 01668 Oracle GoldenGate Capture for Oracle, ext_1.prm: PROCESS ABENDING.
(2) I have not found the OBJ
SQL > select OBJECT_ID, OBJECT_NAME from dba_objects where object_id = 80673;
no selected line
(3) change a few times the process EXT recover;
(4) my excerpt settings
Cat ext_1.prm
EXTRACT ext_1
Ogg, ogg PASSWORD USERID
TRANLOGOPTIONS EXCLUDEUSER ogg
SETENV (NLS_LANG = AMERICAN_AMERICA. ZHS16GBK)
-SETENV (NLS_LANG = AMERICAN_AMERICA. AL32UTF8)
EXTTRAIL ./dirdat/t1
DYNAMICRESOLUTION
TABLE YBK.*;
This is a bug that has been fixed
Excerpt from abending with Table of Compression is not supported, even if the database has no tables compressed. (Doc ID 1510691.1)
event text: Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 86173 is compressed. Compression of the table is not supported.
tableexclude *. DBMS_TABCOMP_TEMP *.
-
What are the tables in 10g OEM repository shows the details of the objectives/groups
Hi Experts,
I had a requirement where I need to collect information on the targets for different groups and their status. And for this I need to know how we could collect their repository tables/views.
Can someone help me to what repository views/tables will contain this information (I need to know the objectives and the corresponding group and its status).
Thanks in advance.
NaveenCheck out mgmt$ target and mgmt group_members views $.
-JP -
Returns the name of the object in a table
Hello
I received the canvas of the objects stored in a table. Each painting has its name property.
Is it possible to return a specific name?
Actually I need an index number of this table, where I spend a name property of the object within this table (the name is taken from the event). Something like this:
x = array.indexOf (canvasName = event.currentTarget.name)
Why can't you just to target the instance? It's enough to tell the difference between different objects.
x = array.indexOf (event.currentTarget);
-
update the object attribute table
Hi all
I'm trying to populate an attribute on a table of objects and need some ideas on how to do this after an update or insert on
two relational tables?
The object table is defined as follows:
The object table is in bulk sampled in an update and The GROUP_ID is applied at the same time as follows:create or replace type ty_gli as object (SOB_ID number ,GROUP_ID number ,SOURCE_NAME varchar2(25) ,INTERFACE_RUN_ID number ,AUTOPOST_ID number) / create or replace type tb_gli as table of ty_gli /
An insert then follows, in the course of which the INTERFACE_RUN_ID is obtained from a sequenceupdate GL_Interface gli set gli.Group_ID = Gl_Interface_Control_S.nextval where gli.Accounting_Date <= l_Max_Rate_Date and gli.Set_of_Books_ID = p_SOB_ID returning ty_GLI (gli.Set_Of_Books_ID, gli.Group_ID, gli.User_JE_Source_Name, 0, 0) bulk collect into l_GLI_Tab;
At this point in the code, preferably before or after insertion.insert into GL_Interface_Control ( JE_Source_Name ,Group_ID ,Set_Of_Books_ID ,Interface_Run_ID) (select gli.Source_Name ,gli.Group_ID ,gli.SOB_ID ,GL_Journal_Import_S.nextval from table(l_GLI_Tab) gli);
I would like to each attribute of the object INTERFACE_RUN_ID table l_GLI_Tab to
equal to the value inserted into GL_INTERFACE_CONTROL, which has been GL_JOURNAL_IMPORT_S.NEXTVAL
I thought to do before inserting it in the update, but it doesn't work!
/returning ty_GLI (gli.Set_Of_Books_ID, gli.Group_ID, gli.User_JE_Source_Name, GL_Journal_Import_S.nextval, 0)
I then thought about that;
but who doesn't either!update (select gli.Group_ID ,gli.Accounting_Date ,gli.Set_of_Books_ID ,GL_Journal_Import_S.nextval as Interface_Control_ID GL_Interface gli set gli.Group_ID = Gl_Interface_Control_S.nextval where gli.Accounting_Date <= l_Max_Rate_Date and gli.Set_of_Books_ID = p_SOB_ID) gli set gli.Set_of_Books_ID = p_SOB_ID returning ty_GLI (gli.Set_Of_Books_ID, gli.Group_ID, gli.User_JE_Source_Name, gli.Interface_Control_ID, 0)
Any help would be appreciated!
THX
P;I thought to do before inserting it in the update, but it doesn't work!
returning ty_GLI (gli.Set_Of_Books_ID, gli.Group_ID, gli.User_JE_Source_Name, GL_Journal_Import_S.nextval, 0)
You just need a little change here. Create a function like this
create or replace function Get_GL_Journal_Import_S return integer as begin return GL_Journal_Import_S.nextval; end; /
use it in your code
returning ty_GLI (gli.Set_Of_Books_ID, gli.Group_ID, gli.User_JE_Source_Name, Get_GL_Journal_Import_S, 0)
It should work correctly.
-
Whether the object is a table, view, or synonym
In our database, there are a lot of tables/views which have similar fields. I get confused about which is which. In addition, there a lot of synonyms. Are there sql commands to check where an object is a table, view, or synonym for a table/view? If it's a view created from a view, I would like to trace through the hierarchy and find root tables which provide the data.
Thank you very much.Check DBA_OBJECTS to the name of the object type. For synonyms, you can check DBA_SYNONYMS and point of view, you can see DBA_VIEWS.
Maybe you are looking for
-
Can satellite M30x - I use Windows 7?
Does anyone has installed Windows 7 on a M30X? People keep telling me that Windows 7 gives a new breath to the older laptops, but it seems difficult to find the correct drivers in the absence of support from Toshiba. I'd be interested to hear about t
-
WARNING 200015 took place in Scripture DAQmx
Hello I'm trying a sync multi function HAVE AO with USB-4431. The program works well, but when I stop the program, it gives me a warning "When writing to memory buffer during a regeneration, the actual data generated may have alternated between the o
-
Problem with HP Connection Manager
Hello I have HP ProBook s 4330 with Windows 7 operating system, and today when I opened the connection manager showed me the message: a fatal error has occurred. I don't know what to do and I don't want to make a mistake, so I hope you can help me.
-
Printer intermittently is unable to detect the ink cartridges
Sometimes my printer works very well; other times are not print and displays the message "print cartridge missing or not detected". I have checked connections, turned and, closed and restarted, removed and replaced the cartridges, replaced the USB c
-
Cannot change the default audio playback device
Hello I tried to get a sound via HDMI, but after hours of trying, each solution is to change the audio playback device by default (in the volume mixer). My PC allow me to do so! It just won't change current default device (digital output Realtech). C