Script Label insert into FileName
Any help would be greatly appreciated!
This is a portion of "PageExporterUtility5.0.js" that I'm tailoring to use at our workplace. Finding a simple description of how to use the "Script Label" is stumping me. How would you modify the following to work? My InDesign document has a Text Frame that I'd like to utilize the text contents in the filename. The text frame has been identified with a "Script Label" called "DOC_SIZE". An example of the text contents would be "18X24" (which is not the actual page size, just a rough description is needed).
Current Base Name:
816069-OHI-none-none.indd
Export Name:
816069_18X24_"Output Directory".eps
w/ the Output Directory, I'd like to use the Folder Name, not the full path.
These are the revalent sections of the script identifying the "outFile" Name.
VAR SETUP
for(currentDoc = 0; currentDoc < peuINFO.numDocsToExport; currentDoc++) {
var tempENTRY = getNewTempENTRY();
tempENTRY.theDoc = app.documents[currentDoc]
tempENTRY.singlePage = (tempENTRY.theDoc.documentPreferences.pagesPerDocument==1)?true:false;
tempENTRY.getOut = true;
var baseName = (tempENTRY.theDoc.name.split(".ind"))[0];
var baseName = baseName.replace(/-OHI-none-none/g, "")
MIDDLE
else{
currentINFO.outfileName = currentINFO.baseName;
exportPage(currentINFO, PageRange.allPages);
EXPORT PORTION
case 2:
app.epsExportPreferences.pageRange = pgRange;
currentINFO.theDoc.exportFile(ExportFormat.epsType, (new File(outFile + ".eps")), false);
If the problem is getting the text contents of your labeled box, try something like this:
var docsizeBoxes = new Array;
for (var i = 0; i < app.activeWindow.activePage.textFrames.length; i++) {
if (app.activeWindow.activePage.textFrames[i].label == "DOC_SIZE") {
docsizeBoxes.push(app.activeWindow.activePage.textFrames[i]);
break; }
var docsizeString = app.activeWindow.activePage.textFrames[i].contents;
You should now be able to use docsizeString in parsing out the name of the output file. This assumes that there will be one and only one text frame labeled "DOC_SIZE" on the active page. So you might need some error checking.
If it were me, though, I'd just get the actual pageWidth and pageHeight from documentPreferences and use them. In my place, we don't have too many doc sizes to choose from.
Similar Messages
-
Sample script to insert into mtl_transactions_interface for sales order
Hi,
can any one provide me the script to insert into mtl_transactions_interface for sales order transactions. actually i have to create the transactions for all the assemblies/components of C* item (configured item). as per the standard functionality it will create only for the C* item.
Thanks in advance..
Regards,
SreenathIf I understood your question correctly, your requirement is as follows.
You have a sales order for a configured item - say C*123.
The components of C*123 are A and B.
A and B as well as C*123 appear on the sales order.
When you ship the sales order, Oracle will create sales order issue transaction for C*123.
You would like to use the transactions interface to create sales order issue transactions for A & B.
That is wrong thing to do.
You should not create a sales order issue for A & B.
You need to BUILD C*123 by creating a work order. You need to perform WIP component issue transaction for A & B.
Hope this helps,
Sandeep Gandhi -
Sql Script containing INSERT INTO TABLE_NAME taking very long time
Version:11g
I have a .sql file which contains insert statements for the table ZIP_CODES like.
INSERT INTO ZIP_CODES (ZIP_CODE, CITY, PROV, COUNTRY_CODE, LONGITUDE, LATITUDE)
VALUES (..........);This sql file contains above 800,000 INSERT statements like these! Execution of this file takes around 20 minutes.
Our client insists that they need a script to create this table and not a dump file (export dump of just this table)
Is there any way i could speed up these INSERTs in this script. I have added a commit half way through this file because i was worried about UNDO tablespace.
This table (ZIP_CODES) is not dependant on any other table (no FKs, no FK references,..).
Edited by: Steve_74 on 03-Sep-2009 05:53One possible option is to use External Tables
1. Create a CSV file with the values to be stored in the table.
2. Create an directory object (The location where the CSV file will be stored)
3. Create an External Table pointing to the CSV file
4. Just do a INSERT INTO ZIP_CODES SELECT * FROM <external table> (may be try to use a APPEND hint)
5. Drop the Directory object and External Table. -
Duplicate script label warning into preflight panel - possible?
Hello!
Duplicate script labels are creating problems for us.They occur when our graphic designers copy a picture box and forget to change the script label, resulting in two identical images - if the indesign document is closed - and reopened.
Is there any way to either provide a warning for duplicate script labels, and/or a insert duplicate script label-warning in the preflight panel?Hi Hans,
Thanks for that suggestion.Simple and affective.
Cheers!
Date: Fri, 22 Mar 2013 01:07:21 -0700
From: [email protected]
To: [email protected]
Subject: Indesign script for locating metadata in images
Re: Indesign script for locating metadata in images
created by -hans- in InDesign Scripting - View the full discussion
Why scripting¿ http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5169242-310155/450-213/Copyrig ht.png
Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5169242#5169242
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5169242#5169242
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5169242#5169242. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in InDesign Scripting by email or at Adobe Community
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
Using INSERT INTO for FDM Memory Issue
All -
We configured FDM to run an integration script into our EBS instance upon the import step. It worked fine for a time, then we began running out of memory on the FDM server. Upon Oracle's suggestion, we stopped running through a record set to append and update the values to strWorkTableName and instead began using INSERT INTO. I admit, I have never needed to use the INSERT INTO way of doing things so I may be missing something bery basic.
Our integration script:
Function SQLIntegration2(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM IMPORT Integration Script:
'Created By: karks
'Date Created: 2011-10-26 13:05:18
'Purpose:
Dim strSQL 'SQL string
Dim lngPartitionKey
Dim strConn 'Connection string to the source data
Set cnSS = CreateObject("ADODB.Connection")
lngPartitionKey = RES.PlngLocKey
strConn= "File Name=C:\Users\karksadm\Desktop\NewConnection.udl;"
cnSS.open strConn
strSQL = "Insert Into " & strWorkTableName & " (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) "
strSQL = strSQL & "SELECT " & lngPartitionKey & ", " & lngCatKey & ", TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & "), 'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, '[None]', EBS.CURRENCY_CODE FROM "
strSQL = strSQL & "(Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, 'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, "
strSQL = strSQL & "(SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE "
strSQL = strSQL & "FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D "
strSQL = strSQL & "WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR "
strSQL = strSQL & "And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = 'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME "
strSQL = strSQL & "And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = 'USD' And D.LEDGER_ID = 2022) "
strSQL = strSQL & "And C.END_DATE = TO_DATE (TO_DATE ('30/12/1899','dd/mm/yyyy')+" & dblPerKey & ") "
strSQL = strSQL & "And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = 'A' "
strSQL = strSQL & "And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 "
strSQL = strSQL & "GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 "
strSQL = strSQL & "ORDER BY B.SEGMENT4) EBS"
DW.DataManipulation.fExecuteDML(strSQL)
'Give success message
RES.PlngActionType = 2
RES.PstrActionValue = "SQL Import successful!"
'Assign Return value
SQLIntegration2 = True
cnSS.close
Set cnSS = Nothing
End FunctionI can run the SQL minus the Insert line in my SQL Developer and it works fine. When I run the script in its entirety in FDM, we receive the following:
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:30] **
ERROR:
Code............................................. -2147217865
Description...................................... ORA-00942: table or view does not exist
Insert Into tWibison72564424799 (PartitionKey, CatKey, PeriodKey, DataView, Amount , Account, Entity, ICP, UD1, UD2, UD3, UD4) SELECT 772, 28, TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724), N'YTD', EBS.YTD_BALANCE, EBS.ACCOUNT, EBS.SEGMENT1, EBS.SEGMENT5, EBS.SEGMENT4, EBS.SEGMENT5, N'[None]', EBS.CURRENCY_CODE FROM (Select D.NAME, A.CODE_COMBINATION_ID, D.NAME LEDGER_NAME, A.ACTUAL_FLAG, C.PERIOD_YEAR, TO_CHAR (C.START_DATE, N'MON-YY') AS PERIOD, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3) As ACCOUNT, B.SEGMENT4, B.SEGMENT5, A.CURRENCY_CODE, (SUM (A.BEGIN_BALANCE_DR) + SUM (A.PERIOD_NET_DR) - SUM (A.BEGIN_BALANCE_CR) - SUM (A.PERIOD_NET_CR)) As YTD_BALANCE FROM GL.GL_BALANCES A, GL.GL_CODE_COMBINATIONS B, GL.GL_PERIODS C, GL.GL_LEDGERS D WHERE 1 = 1 And A.LEDGER_ID = D.LEDGER_ID And A.PERIOD_NUM = C.PERIOD_NUM And C.PERIOD_YEAR = A.PERIOD_YEAR And A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID And B.SUMMARY_FLAG = N'N' AND C.PERIOD_SET_NAME = D.PERIOD_SET_NAME And (B.SEGMENT1 = 001 And A.CURRENCY_CODE = N'USD' And D.LEDGER_ID = 2022) And C.END_DATE = TO_DATE (TO_DATE (N'30/12/1899',N'dd/mm/yyyy')+40724) And B.CHART_OF_ACCOUNTS_ID = D.CHART_OF_ACCOUNTS_ID And A.ACTUAL_FLAG = N'A' And ((A.BEGIN_BALANCE_DR) + (A.PERIOD_NET_DR) - ((A.BEGIN_BALANCE_CR) + (A.PERIOD_NET_CR))) <> 0 GROUP BY A.CODE_COMBINATION_ID, D.NAME, A.CURRENCY_CODE, TO_CHAR (C.START_DATE,N'MON-YY'), C.PERIOD_YEAR, A.ACTUAL_FLAG, B.SEGMENT1, (B.SEGMENT2 || B.SEGMENT3), B.SEGMENT4, B.SEGMENT5 ORDER BY B.SEGMENT4) EBS
Procedure........................................ clsDataManipulation.fExecuteDML
Component........................................ upsWDataWindowDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
ERROR:
Code............................................. -2147217865
Description...................................... Data access error.
At line: 33
Procedure........................................ clsImpProcessMgr.fExecuteImpScript
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
** Begin FDM Runtime Error Log Entry [2012-01-23 11:37:31] **
ERROR:
Code............................................. -2147217865
Description...................................... Data access error.
At line: 33
Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
Component........................................ upsWObjectsDM
Version.......................................... 1112
Thread........................................... 4424
IDENTIFICATION:
User............................................. ibisons
Computer Name.................................... HOU-HYSDEV02
App Name......................................... SWNFDMRC
Client App....................................... WebClient
CONNECTION:
Provider......................................... ORAOLEDB.ORACLE
Data Server......................................
Database Name.................................... FDMDEV
Trusted Connect.................................. False
Connect Status.. Connection Open
GLOBALS:
Location......................................... EBSINTEGRATION
Location ID...................................... 772
Location Seg..................................... 25
Category......................................... EBS2
Category ID...................................... 28
Period........................................... Jun - 2011
Period ID........................................ 6/30/2011
POV Local........................................ False
Language......................................... 1033
User Level....................................... 1
All Partitions................................... True
Is Auditor....................................... False
I really think the issue is that I am not telling the script where to find the Oracle tables at. I left the code in where we were using the UDL to call in the opening of the record set, but since we are doing away with the record set how do I let FDM know where to find the Oracle tables?
Thanks in advance - I've been wrestling with this for several days.
Thanks you,
SarahHere's a script with INSERT INTO that works fine if FDM back-end is SQL DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
Problem is when FDM back-end is Oracle DB and it's pulling from FDMHarris data warehouse which is on SQL Server.
I'm assuming the INSERT INTO statement needs to be written differently, syntax wise?
Here's the error message displayed.
** Begin FDM Runtime Error Log Entry [2012-06-03 21:18:15] **
ERROR:
Code............................................. -2147217900
Description...................................... ORA-00933: SQL command not properly ended
INSERT INTO tWadmin476032843931 (PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) SELECT 752, 12, N'30-Apr-2012', N'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount FROM FDMHarris.dbo.tdataseg4;
Procedure........................................ clsDataManipulation.fExecuteDML
Component........................................ upsWDataWindowDM
Version.......................................... 1112
Thread........................................... 3284
Function INSERTINTO(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM IMPORT Integration Script:
'Created By: admin
'Date Created: 2012-06-03 11:31:39
'Purpose:
Dim objSS 'ADODB.Connection
Dim strSQL 'SQL String
Dim rs 'Recordset
Dim rsAppend 'tTB table append rs Object
Dim strPeriod
Dim strYear
'Period
'strPeriod=MonthName(Month(RES.PdtePerKey))
a=CStr(FormatDateTime(RES.PdtePerKey,1))
'Tuesday,January 30, 2012
b=Right(a,(Len(a)-Len(DW.Utilities.fParseString(a,1,1,",")))) '7
c=DW.Utilities.fParseString(b,2,2,",")
strPeriod=Left(c,3)
'Year
'strYear=Year(RES.PdtePerKey)
strYear=Right(b,4)
DW.DBTools.mLogError 1, CStr(strPeriod), CStr(strYear), Nothing
'Initialize objects
Set cnSS = CreateObject("ADODB.Connection")
'Connect To SQL Server database
cnss.open "Provider=SQLOLEDB.1;Password=datafusion;Persist Security Info=True;User ID=sa;Initial Catalog=FDMHarris;Data Source=dfv11122"
'DW.DBTools.mLogError 1, CStr(strSQL), CStr(strSQL), Nothing
'Initialize common SQL statement
strSQL = "INSERT INTO " & _
strWorkTableName & " " & _
"(PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) " & _
"SELECT " & RES.PlngLocKey & ", " & RES.PlngCatKey & ", " & _
"'" & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & "', " & _
"'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount " & _
"FROM FDMHarris.dbo.tdataseg4;" '& _
' "WHERE Month = '" & strPeriod & "' And CalYear = '" & strYear & "'"
DW.DBTools.mLogError 1, CStr(strSQL), CStr(strWorkTableName), Nothing
DW.DataManipulation.fExecuteDML(strSQL)
'cnss.Execute strSQL
'Records loaded
RES.PlngActionType = 6
RES.PstrActionValue = "SQL Import successful!"
'Assign Return value
INSERTINTO = True
cnss.Close
Set cnss = Nothing
End Function
Edited by: user12152138 on Jun 3, 2012 6:43 PM -
SQL Insert Into error on import in FDM
Hi,
I am struggling to run a FDM Integration script to import data from SQL table to send to HFM. Error on import -
Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'openquery'. Error during data import
Below is the script:
strSQL = "insert into " & strWorkTableName & "("
strSQL = strSQL & "PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType,DataValue, Account,Entity,ICP)"
strSQL = strSQL & "Select " & RES.PlngLocKey & "," & RES.PlngCatKey & ","
strSQL = strSQL & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & ","
strSQL = strSQL & "YTD,9,Value,Account,Entity,Inter_Company_Entity_HFM"
strSQL = strSQL & "from openquery(dw_foundation.dbo.FOU_GL_ACTUAL_MTO,"
strSQL = strSQL & "Select Amount, Account, Entity,Event,Period"Hi
The SAP Tables are on another server, after changing the script i now get the following error:
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'. Error during data import
strSQL = "INSERT INTO " & strWorkTableName
strSQL = strSQL & "(PartitionKey,CatKey,PeriodKey,DataView,CalcAcctType,DataValue,Account,Entity,ICP)"
strSQL = strSQL & "Select " & RES.PlngLocKey & "," & RES.PlngCatKey & ","
strSQL = strSQL & " Year,Period,Entity,Account,Inter_Company_Entity_HFM,'YTD',Value, 9, "
strSQL = strSQL & " from ODI_WORK_MARS.dbo.TMP_HFM_DATA_EXTRACT_TIN1 " -
Hy,
i have a little question. Try this:
create table strangetab (
id varchar2(20),
textfield varchar2(200)
CREATE OR REPLACE PROCEDURE writestrangetab
id VARCHAR2,
textfield varchar2 default null)
IS
pragma autonomous_transaction;
BEGIN
INSERT INTO strangetab
(id, textfield
) VALUES
(id, textfield
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(sqlerrm);
rollback;
END;
After table and procedure creation, try to run this script (simple insert into in autonompus_transaction):
set serveroutput on
declare
vstr varchar2(10000);
begin
for i in 1..2000
loop
vstr := vstr||'r';
end loop;
dbms_output.put_line('write a');
writestrangetab( 'idx' , 'a');
dbms_output.put_line('write big string');
writestrangetab( 'idx' , vstr);
dbms_output.put_line('write b');
writestrangetab('idx' , 'b');
end;
The script generate this output:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
write a
write big string
ORA-12899: value too large for column "STRANGETAB"."TEXTFIELD" (actual:
2000, maximum: 200)
write b
As i expect, the second write goes wrong but first and third no and it put string a and b into srangetable.
Now try to run this:
set serveroutput on
declare
vstr varchar2(10000);
begin
for i in 1..5000
loop
vstr := vstr||'r';
end loop;
dbms_output.put_line('write a');
writestrangetab( 'idx' , 'a');
dbms_output.put_line('write big string');
writestrangetab( 'idx' , vstr);
dbms_output.put_line('write b');
writestrangetab('idx' , 'b');
end;
The only difference from the previous is the vstr dimension: first 2000 now 5000.
In my db (10.2.0.4 on linux) the output of this, is:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
write a
write big string
ORA-01461: can bind a LONG value only for insert into a LONG column
write b
ORA-01001: invalid cursor
If i query the strangetable i am non able to find string b (Only string a was registered)!
As if that were not enough, If you try to insert others writestrangetab, anything after wath that produce the error will be stored!
It is normal?
By
StefanoTanks for your reply Jhon, but:
1) "The second run you are trying to pass 5000 characters to a varchar, which caused your error when trying to call your procedure"
Why you say "which caused". When i call a procedure can't pass more than 4000 Chars? I know that pl/sql varchar2 is up to 32000 Chars even in procedure calls!
2) "That is why your cursor because invalid"
Witch cursor? The strange thing is that there isn't any cursor in the autonomous procedure! The anly statement is an insert into!
The problem of the second miss in the second run is ok: that wont register the string. The main problem is the miss of the third in the seconf run.
Why it not register the third writestrangetab? In that case i pass only a 'b' char. Writestarngetab Is an autonomous transaction so i expect a miss if it fail, but the next, if ok, will be registerd. why not?
By
Stefano -
Creating the Script to insert the table.
Hi Team
I have object type like
emp_obj(
empno number,
empname varchar2(22)
Refer to the Table Type
TYPE EmpTabTyp IS TABLE OF emp_obj
By using this below SP who to pepare the script to insert into the emp table.
create or replace procedure spi_emp(
in_emp emptabtype)
as
begin
for i in in_emp.first..in_emp.last
loop
insert into emp (empno,empno) values(in_emp.emp_obj.empno(i),in_emp.emp_obj.empname(i));
end loop;
end;Your question is rather vague, but I guess you want something like this:
declare
l_nt EmpTabTyp;
begin
l_nt.extend(3);
l_nt(1) := emp_obj(1111, 'MR KNOX');
l_nt(2) := emp_obj(2222, 'FOX IN SOCKS');
l_nt(3) := emp_obj(3333, 'THE LORAX');
spi_emp(l_ent);
end;
/Cheers, APC -
HOW TO EXECUTE TWO "INSERT INTO" IN ONE SQL QUERY?????
i have try the following:
INSERT INTO tab VALUES('a','b');
INSERT INTO tab VALUES('c','d');
and
INSERT INTO tab VALUES('a','b');
INSERT INTO tab VALUES('c','d');
but does not work in ORACLE 10G XE
please help!!It is working fine in Oracle 10g.
SQL> desc emp_t;
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)And the script is --
insert into emp_t values(7799,'Ani','CLERK');
insert into emp_t values(2233,'Rupak','SW'); --File Name is a_a.sql
commit;And, now from command prompt --
SQL> set serveroutput on
SQL>
SQL>
SQL> set lin 1000
SQL>
SQL> select * from emp_t;
EMPNO ENAME JOB
7777 Avik CLERK
6666 prithwi CLERK
7639 Roni CLERK
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7566 JONES MANAGER
7654 MARTIN SALESMAN
7698 BLAKE MANAGER
7782 CLARK MANAGER
7788 SCOTT ANALYST
7839 KING PRESIDENT
EMPNO ENAME JOB
7844 TURNER SALESMAN
7876 ADAMS CLERK
7900 BARRY CLERK
7902 FORD ANALYST
7934 MILLER CLERK
5639 Atul CLERK
17 rows selected.
SQL> @C:\Personal\RND\Oracle\Misc\a_a.sql;
1 row created.
1 row created.
Commit complete.
SQL>
SQL>
SQL> select * from emp_t;
EMPNO ENAME JOB
7799 Ani CLERK
2233 Rupak SW
7777 Avik CLERK
6666 prithwi CLERK
7639 Roni CLERK
7499 ALLEN SALESMAN
7521 WARD SALESMAN
7566 JONES MANAGER
7654 MARTIN SALESMAN
EMPNO ENAME JOB
7698 BLAKE MANAGER
7782 CLARK MANAGER
7788 SCOTT ANALYST
7839 KING PRESIDENT
7844 TURNER SALESMAN
7876 ADAMS CLERK
7900 BARRY CLERK
7902 FORD ANALYST
7934 MILLER CLERK
5639 Atul CLERK
19 rows selected.Regards.
Satyaki De. -
Insert into entering into infinite loop
Hi All,
I am using below query to insert into one of my table because of the tty_eff_dt date conversion its entring into infinte loop,
INSERT INTO tablename
(col1, col2 tty_eff_dt, col3,
col4)
SELECT val1, val2,TO_CHAR (TO_DATE(tty_eff_dt,'MM-DD-YYYY'),'YYYYMMDDHH12MISS') as tty_eff_dt ,
val3,val4
FROM tablename
WHERE col1 = cursorval
AND TO_CHAR (TO_DATE(tty_eff_dt,'MM-DD-YYYY'),'YYYYMMDDHH12MISS') = summ_statis_rec.tty_eff_dt
AND col2 = cursorval
AND col3= cursorval
and when I remove the date conversion it works fine.
I am using Toad.
Please help me out.
Best regards,
PavanHi pavan,
Please provide your table structure and sample insert scripts.
There should be Comma between col2 and tty_eff_dt columns in your insert script.
"INSERT INTO tablename
(col1, col2, tty_eff_dt, col3, col3)..."
Regarding
AND TO_CHAR (TO_DATE(tty_eff_dt,'MM-DD-YYYY'),'YYYYMMDDHH12MISS') = summ_statis_rec.tty_eff_dtYou are converting CHAR to DATE and then again to CHAR, no need as the Time part is not present in tty_eff_dt.
Directly writing
AND tty_eff_dt = summ_statis_rec.tty_eff_dtshould work.
Regards
Imran -
Error when inserting into dynamically created filename-file
Howry
Am am receiving the following error when i am trying to insert into a file that have a dynamic filename (through declared variable, as date etc.).
I presume it is trying to look for the target file with the same name as the dynamic value passed through by the variable, but cannot find it- can anyone tell me how i can rather create the file as appose to insert into an already created file..?
Your help in this regard is much appreciated.
Here is the error:
ODI-1217: Session SAPO_hlr_suburbs (1577001) fails with return code 7000.
ODI-1226: Step 6_Ins_final fails after 1 attempt(s).
ODI-1240: Flow 6_Ins_final fails while performing a Integration operation. This flow loads target table #l_date.unl.
ODI-1228: Task 6_Ins_final (Integration) fails on the target FILE connection SAPO_HLR_SUBURBS.
Caused By: java.sql.SQLException: File C:\Files\Gero work\ODI In Files\SAPO_HLR_SUBURBS/2012-01-24 12:06:13.463.unl was not found
at com.sunopsis.jdbc.driver.file.FileConnection.prepareForWriting(FileConnection.java:339)
at com.sunopsis.jdbc.driver.file.impl.commands.CommandInsert.execute(CommandInsert.java:50)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeUpdate(FilePreparedStatement.java:138)
at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java:68)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)What operating system are you using?
The name of your file has the time within it , you cant have a filename with ':' in it on Windows.
Try using ALPHANUMERIC datatype for the variable and pull the current datetime as a char with something like :
select to_char( sysdate ,'YYYY-MM_DD HHMISS') from dual -
Can a script manually insert a delete (or backspace) into a text area?
I'm new to action script, so this may have a simple answer, sorry if that's the case.
I have a little movie created with a simple purpose of trying to mimic a system like cell phones have for character input.
There are two text areas, one hidden off the screen that accepts the input from the user; a second text area in on screen and displays what the user had entered after some basic processing on the input.
The hidden text area is pretty basic with listener that is responsible for grabbing the input keys and then mangling them to be inserted into the displayed text area based on the cell phone text entry multi-tap rules. Example user press 2-2-2 and the hidden input accepts 222 and then appends 'C' to the display text area. That's working great, but I have a problem if the user wants to delete from the display text area. I can't find a way to insert a delete or backspace key into the display text area. I've tried using StringFromCharCode (8) // Key.BACKSPACE, but that doesn't work. That just displays one of those undefined glyphs. I figure that things like clear, and delete are handled somewhere higher in the input chain and that's where I'm having a problem.
I've looked, but I can't find a way to delete a single character from the text area. I was thinking if I could find the cursor location that I could just use some delete character method to get the job done, but I couldn't find how to do that.
Any ideas on how to pull off manual delete function in a text area?Ned, I do really want to manually (by method of code) trigger a delete in a text area. The delete (or backspace) that I want added to the text area isn't directly entered by the user, it's the result of several key presses by the user. That's why I called it "manual" because it's done by the code, not by the user's direct input.
Think about how text entry works on most phones... if you want to enter a letter you have to cycle through all the letters on a single key until you get to the character desired. As I stated before, if you want a 'c' you need to press 2 button 3 times. This is basically what I'm trying to do, but I want to add the ability to delete a character too if the correct sequence in entered, for example a sequence of ### would equal a backspace.
Rothrock, I think you were thinking the same thing that a single key is used to do a backspace.
I was thinking that I could possibly insert key event into the event queue for the text area to process, but I wasn't sure about that.
Sorry, if this is confusing, I know it's not a straight forward design. I need onscreen and offscreen text areas with the onscreen one acting as a slave of the offscreen one.
The way the code currently works is hidden text area had a listner that responds to changes, and that handler processes the key entered and deletes that character from the hidden text area. After the full sequence of characters (say 2 button has been pressed 3 times) the handler then sends the resulting character into the display text area. This part of the code works great. I can add any character including some specials like tab and newline. However if I want the text area to delete a character I don't have a way to do that. That's why I tried to insert the backspace key (0x08 or ^H, for other oldschoolers), but using that as a char code or string from char code doesn't work.
I had also tried to create to set the focus to the display text area then create and dispatch a backspace keydown and keyup events to the visible text area and then return the focus back to the hidden textarea, but... no luck. -
I need a script that copies the filename into the file
I need a script that copies the filename into 4th column of each line in the text doc file.
I have over 2000 different file names each containing 6 columns and ~50-100 rows.
I can do this manually using this script:
awk '{print $1"\t"$2"t\"$3"\t <name> \t"$6}'
But I would like an automation command or script. Is there any command that I can use instead of <name> that will copy the filename into the column?
Thanks
MonicaOops, I forgot the redirect to a file. It's not a good idea to edit files in place. A script could fail and you're left with at least one file ruined. It's better to create new files then delete the old files.
for file in *; do
while read col1 col2 col3 col4 col5 col6; do
printf "%s\t%s\t%s\t%s\t%s\n" $col1 $col2 $col3 $file $col6
done < $file > n$file
done
You could narrow the files listed such as
for file in *.tsv
and redirect the new files to another directory. Such as
done < $file > /absolute/path/to/directory/$file -
Hi everyone,
I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*.MYURL"/>
<allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
</cross-domain-policy>
I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
Any thoughts would be greatly appreciated.Use a network monitor to see if the Flex app is truly requesting the right URL.
-Alex -
Problem with using INSERT INTO script
Hi guys,
I was trying to duplicate a table with the following script:
CREATE TABLE TAB3(
KEYATTR NUMBER(3) NOT NULL,
BODY1 CHAR(1000) NOT NULL,
BODY2 CHAR(1000) NOT NULL,
BODY3 CHAR(1000) NOT NULL,
CONSTRAINT TAB3_PKEY PRIMARY KEY(KEYATTR) )
INSERT INTO TAB3
SELECT *
FROM system.table3
ORDER BY DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DESC, KEYATTR DESC
However, when I execute the script, I keep getting a 'missing right parenthesis' error. Any idea what went wrong?You don't need braces.
Just
INSERT INTO TAB3
SELECT *
FROM system.table3
ORDER BY DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DESC, KEYATTR DESCshould work.
Maybe you are looking for
-
Why can't I setup iCloud mail on my MacBook Pro?
Context: I had two accounts configured in my Mail.app - an Exchange account for work, and a personal iCloud account. I've had the iCloud account since it was .me, and it has worked fine until recently. It also continues to work fine on my iPad and iP
-
Hi, We wish to transfer and edit our VHS tapes to a Canon MVX 350i, transfer it to iMovie and then burn DVDs. We bought this Canon because we were told it would allow us to do as described. (Analogue Digital Converter). However we do not have a cable
-
Bus powered Firewire devices crashes
I have a Macbook Pro (June 2009) and a Western Digital Passport hard disk with a Firewire 800 connection, bus powered. It has an optional USB 2.0 connection It keeps crashing the system with firewire, not with USB. Especially when I move large files
-
Create Mail account by AppleScript - Authentication problem
Hi everyone, For two day, I try to create a new email account in Apple Mail by using Apple Script. Actually, my script works fine except for the declaration of SMTP informations. To my side, my SMTP server requires *authentication by password*. -----
-
When I try to transfer the songs (that I've purchased from iTunes) on my iPod to my computer I get an eerro that my computer is not authorized, but I've already authorized it. What am I doing wrong?