Creating a script to purge particular cursor in shared pool
hi Guys, not good in scripting need help
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
SQL> !uname -a
SunOS 5.10 Generic_142909-17 sun4u sparc SUNW,SPARC-Enterprise
SQL>
we want to purge the cursor for particular sql id if the version_count exceeds more than 100 in shared pool.
So the action plan is
create a script and put in cron that will
select sql_id, version_count from v$sqlarea where sql_id ='32543gwegfdsg';
1 if version_count >100
then
select address, hash_value from v$sqlarea
where sql_id = '32543gwegfdsg';
ADDRESS HASH_VALUE
00000004FBDBE8D8 455331075
execute the procedure
exec sys.dbms_shared_pool.purge('&address, &hash_value','c')
Edited by: ricky on 19-Aug-2011 12:43 PM
Edited by: ricky on 19-Aug-2011 12:43 PM
Edited by: ricky on 19-Aug-2011 1:00 PM
exec sys.dbms_shared_pool.purge('&address, &hash_value','c')is V11.1 that much different from V11.2 for PURGE arguments?
SQL> desc dbms_shared_pool
PROCEDURE ABORTED_REQUEST_THRESHOLD
Argument Name Type In/Out Default?
THRESHOLD_SIZE NUMBER IN
PROCEDURE KEEP
Argument Name Type In/Out Default?
NAME VARCHAR2 IN
FLAG CHAR IN DEFAULT
PROCEDURE PURGE
Argument Name Type In/Out Default?
NAME VARCHAR2 IN
FLAG CHAR IN DEFAULT
HEAPS NUMBER IN DEFAULT
PROCEDURE SIZES
Argument Name Type In/Out Default?
MINSIZE NUMBER IN
PROCEDURE UNKEEP
Argument Name Type In/Out Default?
NAME VARCHAR2 IN
FLAG CHAR IN DEFAULT
Similar Messages
-
To create a script and schedule which purge 30 days old files
Hi Friends,
Very new in Unix and i got a requirement like writing a script and schedule it, so that it removes 30 days old files from all the log locations of a unix box.
Suppose i have a unix server ltbamdev1 and in this server i have a mount point opt/bam. In this mount point i have 3 different folders like
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/opmn/logs
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/default/logs
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/support/logs
Please help me in writing a script which runs once a week and removes all 30 days old files from these three folder locations.
Thanks in advance
DuosModerator Action:
The discussion is in the duplicate cross-post:
To create a script and schedule which purge 30 days old files
@O.P.
For the future, only make one post.
If it is in the wrong forum, it will likely get relocated by moderators.
This duplicate is now locked to prevent responses getting fragmented all over the place. -
Ihave created a script, i need to email in pdf format.
Hi Experts,
There are 2 criterias...
1. criteria
I have created a script, i need to mail it. Please give me a step by step guide to perform it .. . Please give the comments in all the functional module to be used.
Do we have to write a separate program to send email or in the same program. i'll post my program along with this mail. I'm using this program to display report after delivery on that particular date.
REPORT ZREPORTTOEMAIL LINE-SIZE 400.
data : count, i type i.
TABLES : VBFA, "Sales Document Flow
VBAK,
KNA1,
VBKD,
VBAP,
LIPS,
LIKP,
KONP,
KOMK,
KOMP,
zkna1,
konv.
data : l_vbeln like vbfa-vbeln,
l_posnr like vbfa-posnn,
l_KNUMV like vbak-KNUMV,
L_BILL_ITEM LIKE vbfa-posnn ,
l_netwr like vbrp-netwr,
l_MWSBP like vbrp-mwsbp.
DATA: BEGIN OF TKOMV OCCURS 50.
INCLUDE STRUCTURE KOMV.
DATA: END OF TKOMV.
DATA: BEGIN OF TKOMVD OCCURS 50.
INCLUDE STRUCTURE KOMVD.
DATA: END OF TKOMVD.
TYPE-POOLS: SLIS.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
HEADING TYPE SLIS_T_LISTHEADER,
LAYOUT TYPE SLIS_LAYOUT_ALV,
EVENTS TYPE SLIS_T_EVENT,
REPNAME LIKE SY-REPID,
F2CODE LIKE SY-UCOMM VALUE '&ETA',
G_SAVE(1) TYPE C,
G_EXIT(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT.
DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
DATA: BEGIN OF itab occurs 0,
kunnr like likp-kunnr, "ship to party
NAME2 LIKE KNA1-NAME1, "text
ORT01 LIKE KNA1-ORT01, "City
BSTNK LIKE VBAK-BSTNK, "customer P O
BSTDK LIKE VBAK-BSTDK, "date
vbeln like likp-vbeln, "delivery
ernam like likp-ernam, "person
vstel like likp-vstel, "shipping point
vkorg like likp-vkorg, "sales org
lfdat like likp-lfdat, "delivery date
kunag like likp-kunag, "sold to party
NAME1 LIKE KNA1-NAME1, "text
bil_to like VBAK-KUNNR,
name3 like kna1-name1,
traid like likp-traid, "transport/vehicle no
BOLNR LIKE LIKP-BOLNR,
wadat_ist like likp-wadat_ist, "good mov. date
posnr like lips-posnr, "item
matnr like lips-matnr, "material
arktx like lips-arktx, "item text
matkl like lips-matkl, "mat group
werks like lips-werks, "plant
lgort like lips-lgort, "stoage location
lfimg like lips-lfimg, "del qty
MEINS LIKE LIPS-MEINS,
vrkme like lips-vrkme, "sales unit
UMVKZ LIKE LIPS-UMVKZ,
UMVKN LIKE LIPS-UMVKN,
charg like lips-charg, "batch
vgbel like lips-vgbel, "reference doc
mtart like lips-mtart, "mat type
vkbur like lips-vkbur, "sales office
vkgrp like lips-vkgrp, "sales group
vtweg like lips-vtweg, "Distribution Channel
spart like lips-spart, "division
billno like vbak-vbeln,
basic like komvd-kwert,
budat like bkpf-budat,
fin_amt like vbrp-NETWR,
END OF itab.
data : begin of jtab occurs 0,
kunnr like likp-kunnr,
name2 like kna1-name2,
vbeln like likp-vbeln,
zkunnr like zkna1-zkunnr,
zname like zkna1-zname,
end of jtab.
SELECTION-SCREEN SKIP 1 .
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS : ABC FOR LIKP-WADAT_IST DEFAULT SY-DATUM
NO INTERVALS .
SELECT-OPTIONS : S_MATNR FOR LIPS-MATNR NO INTERVALS .
SELECT-OPTIONS : S_VKORG FOR LIKP-VKORG NO INTERVALS.
SELECT-OPTIONS : S_VSTEL FOR LIKP-VSTEL NO INTERVALS.
SELECT-OPTIONS : S_VKBUR FOR LIKP-VKBUR NO INTERVALS.
SELECT-OPTIONS : S_VKGRP FOR LIPS-VKGRP.
SELECT-OPTIONS : S_SPART FOR LIPS-SPART.
SELECT-OPTIONS : S_VBELN3 FOR LIKP-VBELN.
SELECT-OPTIONS : S_MATKL FOR LIPS-MATKL NO INTERVALS,
S_KUNAG FOR LIKP-KUNAG.
SELECTION-SCREEN END OF BLOCK BLOCK1.
select * from likp into corresponding fields of itab
WHERE WADAT_IST IN ABC
AND VBELN IN S_VBELN3
AND VKORG IN S_VKORG
and VSTEL in S_VSTEL
AND VKBUR IN S_VKBUR
and lfart like 'Z%'
AND VBTYP = 'J'
AND KUNAG IN S_KUNAG.
select * from lips into corresponding fields of itab
WHERE VBELN = ITAB-VBELN
AND MATNR IN S_MATNR
AND MATKL IN S_MATKL
AND VKBUR IN S_VKBUR
AND VKGRP IN S_VKGRP
AND SPART IN S_SPART.
IF ITAB-VRKME = 'RM' AND ITAB-MEINS = 'KG'.
ITAB-LFIMG = ITAB-LFIMG * ( ITAB-UMVKZ / ITAB-UMVKN ).
ITAB-VRKME = 'KG'.
ENDIF.
SELECT SINGLE BSTNK BSTDK INTO (ITAB-BSTNK,ITAB-BSTDK) FROM VBAK
WHERE VBELN = ITAB-VGBEL.
SELECT SINGLE NAME1 ORT01 FROM KNA1 INTO (ITAB-NAME2,ITAB-ORT01)
WHERE KUNNR = ITAB-KUNNR.
SELECT SINGLE NAME1 FROM KNA1 INTO ITAB-NAME1
WHERE KUNNR = ITAB-KUNAG.
*select single vbeln POSNN into (itab-billno,L_BILL_ITEM) from vbfa where VBELV = itab-vbeln
*and POSNV = itab-posnr and VBTYP_N in ('M','U').
select vbeln POSNN from vbfa up to 1 rows into (itab-billno,L_BILL_ITEM) where VBELV = itab-vbeln
and POSNV = itab-posnr and VBTYP_N in ('M','U') order by vbeln DESCENDING .
endselect.
select single * from vbfa where vbelv = itab-billno and posnv = l_bill_item and
vbtyp_n = 'N'.
if sy-subrc = 0.
clear : itab-billno, l_bill_item.
endif.
select single budat from bkpf into itab-budat where xblnr = itab-billno and
blart = 'RV'.
select single NETWR MWSBP into (l_netwr, l_MWSBP) from vbrp where vbeln = itab-billno
and posnr = l_bill_item.
itab-fin_amt = l_netwr + l_MWSBP.
clear : l_netwr, l_MWSBP.
select single kunnr from vbpa into itab-bil_to where
vbeln = itab-BILLNO and PARVW = 'RE'.
select single name1 into itab-name3 from kna1
where kunnr = itab-bil_to.
*select single VBELV POSNV from vbfa into (l_vbeln,l_posnr)
*where VBELN = itab-vbeln and
*POSNN = itab-posnr and VBTYP_N = 'J'.
*select single VBELN POSNN from vbfa into (l_vbeln,l_posnr)
*where VBELV = itab-vbeln and
*POSNV = itab-posnr and VBTYP_N = 'M'.
select VBELN POSNN from vbfa up to 1 rows into (l_vbeln,l_posnr)
where VBELV = itab-vbeln and
POSNV = itab-posnr and VBTYP_N = 'M' order by vbeln DESCENDING.
endselect.
select single * from vbfa where vbelv = l_vbeln and posnv = l_posnr and
vbtyp_n = 'N'.
if sy-subrc = 0.
clear : l_vbeln, l_posnr.
endif.
if sy-subrc = 0.
*select single KNUMv into l_KNUMv from vbak where vbeln = l_vbeln
select single KNUMv into l_KNUMv from vbRk where vbeln = l_vbeln
select * from konv where knumv = l_knumv and kposn = l_posnr and
kschl in ('ZR00','ZR01','ZR02','ZOBC').
itab-basic = itab-basic + KONV-KBETR.
ENDSELECT.
else.
*select single KNUMv into l_KNUMv from ekko where ebeln = itab-vgbel.
*select single KBETR from konv into itab-basic where knumv = l_knumv
*and kposn = itab-posnr and kschl = 'P101'.
select single KNUMv into l_KNUMv from VBRK where VBELN = itab-BILLNO.
select * from konv where knumv = l_knumv and kposn = l_BILL_ITEM AND
kschl in ('ZR00','ZR01','ZR02','ZOBC').
itab-basic = itab-basic + KONV-KBETR.
ENDSELECT.
*zkna1-zkunnr = itab-kunnr.
*insert zkna1.
endif.
clear : l_vbeln, L_BILL_ITEM, L_POSNR.
APPEND ITAB.
clear : itab-basic, itab-lfimg.
ENDSELECT.
clear : itab.
ENDSELECT.
<b>perform zscript.</b>
*& Form zscript
text
--> p1 text
<-- p2 text
FORM zscript .
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZREPORT2EMAIL'
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
SPONUMIV =
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MANU'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " zscript
The above one is first criteria just to understand how to send mail to the customers.
<b>Second criteria</b> is i have to send the mail to the particular customer with only their details, the process should continue until it sends to all the customers with their details for that particular date.
Please help me out.
I have seen so many posts in the sdn but not able to understand the functional modules, how they declare that and how does it works...
Please provide me a good material to understand the functional module and to declare them.
Please solve this query i'll reward them with very good points.
Thanks in advance.
A.Rafique.Hi babar haroon,
Thanks for the link.....
I went through that link, i created smart form but i was not able to get the results because the pgm gets terminated after executing. I'll show u the code, the code is active. Please check out and tell me if i have missed anything in the code...
*& Report ZZZ_TEST3
REPORT ZZZ_TEST3.
*internal table declarations
data: i_otf type itcoo occurs 0 with header line,
i_tline type table of tline with header line,
i_receivers type table of somlreci1 with header line,
i_record like solisti1 occurs 0 with header line,
*Objects to send mail.
i_objpack like sopcklsti1 occurs 0 with header line,
i_objtxt like solisti1 occurs 0 with header line,
i_objbin like solisti1 occurs 0 with header line,
i_reclist like somlreci1 occurs 0 with header line,
*workarea declaration.
w_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
*call function '/1BCDWB/SF00000105'
exporting
formname = 'ZZZ_TEST2'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION '/1BCDWB/SF00000105'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB = itab1
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = wa
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING '~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~'.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Refresh: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear w_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Object with main text of the mail.
i_objtxt = 'Find attached the output of the smart form.'.
APPEND i_objtxt.
DESCRIBE TABLE i_objbin LINES v_lines_txt.
i_objtxt = 'Regards,'.
APPEND i_objtxt.
i_objtxt = 'J.Jayanthi'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = v_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Smartform_output' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = '[email protected]'.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'. "Internet address
APPEND i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_hex = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please reply me back, it is very urgent..
Thanks and regards.
A.Rafique -
Is there a system table that stores the "create table" scripts
Does a Oracle system table exist that contains the "create table" scripts for tables defined under a schema?
I know I can build this with SQL by querying the user_tab_columns, but I was wondering whether the entire DML
statement is already stored in some other system table. In the Quest Toad software you can simply go to the "Schema Brower", "Tables",
then select the "Script" tab and it shows you the "create table" statement for the particular table that you are
looking at. I'm wondering whether Toad behind the scenes is building this "create table" script via the user_tab_columns
table or using another system table.
Thank you in advance,
Wesyou can use the DBMS_METADATA.GET_DDL procedure to obtain the details regarding the ddl statement used to create the table.
-
Create table script by passing value from table
I Have a procedure to check if the table exists, if yes drop and re-create else create table.
CREATE OR REPLACE
PROCEDURE test_proc authid current_user
AS
v_cnt NUMBER:=0;
BEGIN
SELECT COUNT(*)
INTO v_cnt
FROM all_tables
WHERE table_name='T1'
AND owner = 'WORKSPACE';
IF v_cnt = 1 THEN
EXECUTE immediate 'DROP TABLE WORKSPACE.T1';
END IF;
EXECUTE immediate 'CREATE TABLE WORKSPACE.T1
ITM_NBR NUMBER ,
LCT_NBR NUMBER
SELECT COUNT(*)
INTO v_cnt
FROM all_tables
WHERE table_name='T2'
AND owner = 'WORKSPACE';
IF v_cnt = 1 THEN
EXECUTE immediate 'DROP TABLE WORKSPACE.T2';
END IF;
EXECUTE immediate 'CREATE TABLE WORKSPACE.T2
LCT_NBR NUMBER(5, 0) NOT NULL ,
PRY_CD NUMBER(5, 0) NOT NULL )';
END;
Requirement: Instead of passing the Owner,tablename & the create table scripts directlyin the query, it should be passed from a database table which will be in given format.
TableName Query Owner
T1 CREATE TABLE WORKSPACE.T1(ITM_NBR NUMBER, LCT_NBR NUMBER) WORKSPACE
T2 CREATE TABLE WORKSPACE.T2(LCT_NBR NUMBER(5, 0) NOT NULL ,PRY_CD NUMBER(5, 0) NOT NULL) WORKSPACEuser12276240 wrote:
Excuse all. The database columns are yet to be finalized and every time changes come in we are currently dropping and re-creating the tables which leads in changing the script, hence we are going in for this approach.
Moreover if i am going to have this script everytime i have to drop and re-create all the tables which can be elimated by this way.So why not have a SQL script as follows?
drop table emp purge;
create table emp(
create index .. on emp( .. );
..It drops the existing table (if exists). It then creates the table with constraints and indexes. This script is now the master definition of the table. You can slap a change log header to it. Any changes that needs the table to be redefined and recreated are done via this script. Which means it is also checked into the source code repository as it is part of the code of that system/application.
I would however remove the drop table from it in case some developer accidentally run it at the wrong time and trash the table.
The bottom line is that DDL code is part and parcel of the installation, configuration and setup code - and that this is as important as the source code. This code also needs to be "formalised" in proper scripts, checked into SVN/CVS/etc, and used to bootstrap the system (or parts of it), as and when needed. -
[Solved] 27.8.4 How to Create a VO on a REF CURSOR - Missing first row
Searching the forum I found: BC4J - Get one less row from view object.
Dive into BC4J related --REF CURSOR (Resultset)
The first message did not have any answers, and the second had a follow up question - still no answers though - and I thought I would try a different title.
(This is off topic, but it would be a great help if the search results also displayed the number of replys in the thread. That way, I wouldn't have to view the messages that don't have responses.)
(This will be deployed on a server that has the ADF for JDeveloper 10.1.2 installed, so using that version of JDeveloper to develop the app.)
Okay, back to the problem ==>
I created a VO from a ref cursor, using the manual as a guide. When I run a page that displays a read only table of the view object, I am missing the first row. (Always the first row!) I don't have any order set, and if I call the ref cursor in a Java program for testing, I see all rows and the count is correct.
One other point, when I call the page, I get the following validation error:
Validation Error
You must correct the following error(s) before proceeding:
* JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=null
* null
I still see the table, it is just missing the first row of data.
In my form I have first, previous set, next set , and last
navigation buttons. If I press last then first, the error goes away. I still don't see the missing row though.
Any guidance would be appreciated! I can post my code, but it is pretty much the same code in the AdvancedViewObjectExamples.zip in the ViewObjectOnRefCursor example. I just substituted my two package calls (getRefCursor and getRefCursorCount).
Thanks, KenWent back to a backup copy of the source. Fixed the error. Now I'm back to just not being able to see the first row of data.
Additional Note: I had removed fields in the display. Once I truncated the ps_txn table in the schema defined by the model, the data would display (Still without the first record.)
Are there any examples that are more in depth than the few pages in the developer guide?
Here is the code for my VOImpl class:
package newslinearchive.model.datamodel;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import oracle.jbo.InvalidParamException;
import oracle.jbo.JboException;
import oracle.jbo.domain.Date;
import oracle.jbo.domain.Number;
import oracle.jbo.server.DBTransaction;
import oracle.jbo.server.QueryCollection;
import oracle.jbo.server.SQLBuilder;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.jdbc.driver.OracleTypes;
// --- File generated by Oracle ADF Business Components Design Time.
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
public class SearchRefCursorImpl extends ViewObjectImpl {
* This is the default constructor (do not remove)
public SearchRefCursorImpl() {
* Overridden framework method.
* Executed when the framework needs to issue the database query for
* the query collection based on this view object. One view object
* can produce many related result sets, each potentially the result
* of different bind variable values. If the rowset in query is involved
* in a framework-coordinated master/detail viewlink, then the params array
* will contain one or more framework-supplied bind parameters. If there
* are any user-supplied bind parameter values, they will PRECEED the
* framework-supplied bind variable values in the params array, and the
* number of user parameters will be indicated by the value of the
* numUserParams argument.
protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
storeNewResultSet(qc,retrieveRefCursor(qc,params));
super.executeQueryForCollection(qc, params, numUserParams);
* Overridden framework method.
* Wipe out all traces of a built-in query for this VO
protected void create() {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
* Overridden framework method.
* The role of this method is to "fetch", populate, and return a single row
* from the datasource by calling createNewRowForCollection() and populating
* its attributes using populateAttributeForRow().
protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
* We ignore the JDBC ResultSet passed by the framework (null anyway) and
* use the resultset that we've stored in the query-collection-private
* user data storage
rs = getResultSet(qc);
* Create a new row to populate
ViewRowImpl r = createNewRowForCollection(qc);
try {
* Populate new row by attribute slot number for current row in Result Set
// populateAttributeForRow(r,0, rs.getLong(1));
// populateAttributeForRow(r,1, rs.getString(2));
// populateAttributeForRow(r,2, rs.getString(3));
// MASTERID NOT NULL NUMBER
populateAttributeForRow(r,0, rs.getBigDecimal(1));
//ID NOT NULL NUMBER
populateAttributeForRow(r,1, rs.getBigDecimal(2));
// CAID NOT NULL NUMBER
populateAttributeForRow(r,2, rs.getBigDecimal(3));
// LANGUAGE NOT NULL VARCHAR2(30)
populateAttributeForRow(r,3, rs.getString(4));
// IS_CURRENT_VERSION NOT NULL NUMBER(1)
populateAttributeForRow(r,4, rs.getBigDecimal(5));
// FOLDER_ID NOT NULL NUMBER
populateAttributeForRow(r,5, rs.getBigDecimal(6));
// FOLDER_REGION_ID NOT NULL NUMBER
populateAttributeForRow(r,6, rs.getBigDecimal(7));
// NAME NOT NULL VARCHAR2(256)
populateAttributeForRow(r,7, rs.getString(8));
// DISPLAY_NAME VARCHAR2(256)
populateAttributeForRow(r,8, rs.getString(9));
// ITEMTYPE NOT NULL VARCHAR2(30)
populateAttributeForRow(r,9, rs.getString(10));
// SUBTYPE VARCHAR2(40)
populateAttributeForRow(r,10, rs.getString(11));
// SUBTYPE_CAID NUMBER
populateAttributeForRow(r,11, rs.getBigDecimal(12));
// PARENT_ITEM_ID NUMBER
populateAttributeForRow(r,12, rs.getBigDecimal(13));
// CATEGORY_ID NUMBER
populateAttributeForRow(r,13, rs.getBigDecimal(14));
// CATEGORY_CAID NUMBER
populateAttributeForRow(r,14, rs.getBigDecimal(15));
// AUTHOR VARCHAR2(50)
populateAttributeForRow(r,15, rs.getString(16));
// DESCRIPTION VARCHAR2(2000)
populateAttributeForRow(r,16, rs.getString(17));
// PUBLISH_DATE NOT NULL DATE
populateAttributeForRow(r,17, rs.getDate(18));
// EXPIREMODE VARCHAR2(90)
populateAttributeForRow(r,18, rs.getString(19));
// EXPIRENUMBER NUMBER
populateAttributeForRow(r,19, rs.getBigDecimal(20));
// EXPIREDATE DATE
populateAttributeForRow(r,20, rs.getDate(21));
// IMAGE VARCHAR2(350)
populateAttributeForRow(r,21, rs.getString(22));
// KEYWORDS VARCHAR2(2000)
populateAttributeForRow(r,22, rs.getString(23));
// URL VARCHAR2(4000)
populateAttributeForRow(r,23, rs.getString(24));
// FILENAME VARCHAR2(350)
populateAttributeForRow(r,24, rs.getString(25));
// TEXT CLOB()
populateAttributeForRow(r,25, rs.getClob(26));
// FOLDER_LINK_ID NUMBER
populateAttributeForRow(r,26, rs.getBigDecimal(27));
// FOLDER_LINK_CAID NUMBER
populateAttributeForRow(r,27, rs.getBigDecimal(28));
// ACTIVE NOT NULL NUMBER(1)
populateAttributeForRow(r,28, rs.getBigDecimal(29));
// CAN_BE_CHECKEDOUT NUMBER(1)
populateAttributeForRow(r,29, rs.getBigDecimal(30));
// IS_ITEM_CHECKEDOUT NUMBER(1)
populateAttributeForRow(r,30, rs.getBigDecimal(31));
// CHECKER_USERNAME VARCHAR2(256)
populateAttributeForRow(r,31, rs.getString(32));
// CHECKOUT_DATE DATE
populateAttributeForRow(r,32, rs.getDate(33));
// FULLSCREEN NOT NULL NUMBER(1)
populateAttributeForRow(r,33, rs.getBigDecimal(34));
// INPLACE NOT NULL NUMBER(1)
populateAttributeForRow(r,34, rs.getBigDecimal(35));
// CREATEDATE NOT NULL DATE
populateAttributeForRow(r,35, rs.getDate(36));
// CREATOR NOT NULL VARCHAR2(256)
populateAttributeForRow(r,36, rs.getString(37));
// UPDATEDATE DATE
populateAttributeForRow(r,37, rs.getDate(38));
// UPDATOR VARCHAR2(256)
populateAttributeForRow(r,38, rs.getString(39));
// SECURITY VARCHAR2(25)
populateAttributeForRow(r,39, rs.getString(40));
// VISIBLE NOT NULL NUMBER(1)
populateAttributeForRow(r,40, rs.getBigDecimal(41));
// SEQUENCE NOT NULL NUMBER
populateAttributeForRow(r,41, rs.getBigDecimal(42));
// CATEGORY_SEQUENCE NOT NULL NUMBER
populateAttributeForRow(r,42, rs.getBigDecimal(43));
// AUTHOR_SEQUENCE NOT NULL NUMBER
populateAttributeForRow(r,43, rs.getBigDecimal(44));
// CREATE_DATE_SEQUENCE NOT NULL NUMBER
populateAttributeForRow(r,44, rs.getBigDecimal(45));
// ITEMTYPE_SEQUENCE NOT NULL NUMBER
populateAttributeForRow(r,45, rs.getBigDecimal(46));
catch (SQLException s) {
throw new JboException(s);
return r;
* Overridden framework method.
* Return true if the datasource has at least one more record to fetch.
protected boolean hasNextForCollection(Object qc) {
ResultSet rs = getResultSet(qc);
boolean nextOne = false;
try {
nextOne = rs.next();
* When were at the end of the result set, mark the query collection
* as "FetchComplete".
if (!nextOne) {
setFetchCompleteForCollection(qc, true);
* Close the result set, we're done with it
rs.close();
catch (SQLException s) {
throw new JboException(s);
return nextOne;
* Overridden framework method.
* The framework gives us a chance to clean up any resources related
* to the datasource when a query collection is done being used.
protected void releaseUserDataForCollection(Object qc, Object rs) {
* Ignore the ResultSet passed in since we've created our own.
* Fetch the ResultSet from the User-Data context instead
ResultSet userDataRS = getResultSet(qc);
if (userDataRS != null) {
try {
userDataRS.close();
catch (SQLException s) {
/* Ignore */
super.releaseUserDataForCollection(qc, rs);
* Overridden framework method
* Return the number of rows that would be returned by executing
* the query implied by the datasource. This gives the developer a
* chance to perform a fast count of the rows that would be retrieved
* if all rows were fetched from the database. In the default implementation
* the framework will perform a SELECT COUNT(*) FROM (...) wrapper query
* to let the database return the count. This count might only be an estimate
* depending on how resource-intensive it would be to actually count the rows.
public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
Long result = (Long)callStoredFunction(NUMBER,
"PORTAL.SEARCH_REFCURSOR.getRefCursorCount",
viewRowSet.getParameters(true));
return result.longValue();
// ------------- PRIVATE METHODS ----------------
* Return a JDBC ResultSet representing the REF CURSOR return
* value from our stored package function.
* new Object[]{getNamedBindParamValue("Email",params)}
private ResultSet retrieveRefCursor(Object qc, Object[] params) {
ResultSet rs = (ResultSet)callStoredFunction(OracleTypes.CURSOR,
"PORTAL.SEARCH_REFCURSOR.getRefCursor",
null);
return rs ;
private Object getNamedBindParamValue(String varName, Object[] params) {
Object result = null;
if (getBindingStyle() == SQLBuilder.BINDING_STYLE_ORACLE_NAME) {
if (params != null) {
for (Object param : params) {
Object[] nameValue = (Object[])param;
String name = (String)nameValue[0];
if (name.equals(varName)) {
return (String)nameValue[1];
throw new JboException("No bind variable named '"+varName+"'");
* Store a new result set in the query-collection-private user-data context
private void storeNewResultSet(Object qc, ResultSet rs) {
ResultSet existingRs = getResultSet(qc);
// If this query collection is getting reused, close out any previous rowset
if (existingRs != null) {
try {existingRs.close();} catch (SQLException s) {}
setUserDataForCollection(qc,rs);
hasNextForCollection(qc); // Prime the pump with the first row.
* Retrieve the result set wrapper from the query-collection user-data
private ResultSet getResultSet(Object qc) {
return (ResultSet)getUserDataForCollection(qc);
* Return either null or a new oracle.jbo.domain.Date
private static Date nullOrNewDate(Timestamp t) {
return t != null ? new Date(t) : null;
* Return either null or a new oracle.jbo.domain.Number
private static Number nullOrNewNumber(BigDecimal b) {
try {
return b != null ? new Number(b) : null;
catch (SQLException s) { }
return null;
//----------------[ Begin Helper Code ]------------------------------
public static int NUMBER = Types.NUMERIC;
public static int DATE = Types.DATE;
public static int VARCHAR2 = Types.VARCHAR;
public static int CLOB = Types.CLOB;
* Simplifies calling a stored function with bind variables
* You can use the NUMBER, DATE, and VARCHAR2 constants in this
* class to indicate the function return type for these three common types,
* otherwise use one of the JDBC types in the java.sql.Types class.
* NOTE: If you want to invoke a stored procedure without any bind variables
* ==== then you can just use the basic getDBTransaction().executeCommand()
* @param sqlReturnType JDBC datatype constant of function return value
* @param stmt stored function statement
* @param bindVars Object array of parameters
* @return function return value as an Object
protected Object callStoredFunction(int sqlReturnType, String stmt,
Object[] bindVars) {
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement("begin ? := " + stmt +
"; end;", 0);
st.registerOutParameter(1, sqlReturnType);
if (bindVars != null) {
for (int z = 0; z < bindVars.length; z++) {
st.setObject(z + 2, bindVars[z]);
st.executeUpdate();
return st.getObject(1);
catch (SQLException e) {
throw new JboException(e);
finally {
if (st != null) {
try {
st.close();
catch (SQLException e) {}
/**Gets the bind variable value for Email
public String getEmail() {
return (String)getNamedWhereClauseParam("Email");
/**Sets <code>value</code> for bind variable Email
public void setEmail(String value) {
setNamedWhereClauseParam("Email", value);
/**getEstimatedRowCount - overridden for custom java data source support.
public long getEstimatedRowCount() {
long value = super.getEstimatedRowCount();
return value;
Thanks, Ken -
Hello,
i am trying to perform my first manual creation of a database. Initially was always receiving error;
ORA-01092: ORACLE instance terminated. Disconnection forced
I think this was because the UNDO element in the init.ora file did not match UNDO element in the Create DB script. But now that i think i have them matching i continously receive the error;
'Invalid Create Command'
The UNDO element in the init.ora file is;
undo_tablespace=UNDOTBS
The Create script is;
CREATE DATABASE Customers
USER SYS IDENTIFIED BY CUSTSYS
LOGFILE GROUP 1 ('F:\oracle\oradata\Customers\redo01.log') SIZE 100M REUSE,
GROUP 2 ('F:\oracle\oradata\Customers\redo02.log') SIZE 100M REUSE,
GROUP 3 ('F:\oracle\oradata\Customers\redo03.log') SIZE 100M REUSE
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
ARCHIVELOG
CHARACTER SET WE8MSWIN1252
NATIONAL CHARACTER SET AL16UTF16
DATAFILE 'F:\oracle\oradata\Customers\system01.dbf' SIZE 200M REUSE
UNDO TABLESPACE UNDOCUST
DEFAULT TEMPORARY TABLESPACE tempcust_ts;
Also, when i have created the service for the database using ORADIM the alert log gives the following near the bottom;
ORA-00202: controlfile: 'F:\oracle\oradata\Customers\CUSTCONTROL01.CTL'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
Thanks in advanceI just about give up!!!
Thanks for everyone’s advice, but nothing so far seems to create the database. I could initially create a database with the Database Configuration Assistant no problem but have been asked to learn to create one manually as it supposedly gives better control of the parameters etc.
I am using Oracle 9i.
Next here is the undo elements in init file. (I don't think i can put whole init file up)
undo_management=AUTO
undo_retention=10800
undo_tablespace=UNDOTBS1
I manage to create the database service okay using ORADIM.
The alert log file is there at this point but with this error at the bottom.
ORA-00202: controlfile: 'F:\oracle\oradata\Customers\CUSTOMERSCONTROL01.CTL'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
Tue Aug 22 11:07:51 2006
ORA-205 signalled during: alter database mount exclusive...
Shutting down instance (abort)
I then attempt to create a password file using ORAPWD;
But i am given an error at command prompt;
OPW-00001: Unable to open password file
I then change ORACLE_SID to the new database.
I then log onto Oracle as sysdba. Says ‘connected to an idle instance’.
I call start up to init file. I am given following information;
ORACLE instance started.
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
I then call the SQL script containing the following;
CREATE DATABASE Customers
USER SYS IDENTIFIED BY CustSYS
USER SYSTEM IDENTIFIED BY CustSYSTEM
CONTROL FILE REUSE
LOGFILE GROUP 1 ('F:\oracle\oradata\Customers\redo01.log') SIZE 100M REUSE,
GROUP 2 ('F:\oracle\oradata\Customers\redo02.log') SIZE 100M REUSE,
GROUP 3 ('F:\oracle\oradata\Customers\redo03.log') SIZE 100M REUSE
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
ARCHIVELOG
CHARACTER SET WE8MSWIN1252
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE 'F:\oracle\oradata\Customers\system01.dbf' SIZE 200M REUSE
UNDO TABLESPACE UNDOTBS1 DATAFILE 'F:\oracle\oradata\Customers\UNDOTBS1.dbf'
DEFAULT TEMPORARY TABLESPACE temp_ts TEMPFILE 'F:\oracle\oradata\Customers\temp01.dbf';
Error says:
CONTROL FILE REUSE
ERROR at line 4:
ORA-02165: invalid option for CREATE DATABASE
Also in the alert log more information has been added with the last appending being;
starting up 1 shared server(s) ...
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Oracle Data Guard is not available in this edition of Oracle.
I remove the line CONTROL FILE REUSE from script and run again, then receive this message;
CREATE DATABASE Customers
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
Also, now after all these attempts I tried making a new database again using DB Configuration Assistant and it now asks me to specify a template of type data_warehousing when I clicked on General_purpose. It states template file specified does not exist, supplying the following information;
{ORACLE_HOME}\assistants\dbca\templates\Data_Warehouse.dfj
Thanks to all for input on this but I am running out of time and have to move on to next part of project. -
Help creating a script for backup
Hi everybody,
I would like to make some backups using rman and recovery flash area on oracle10g on my Debian.
I would like to make a full backup level 0 on Sunday and make incremental backups from Monday to saturday.The best would be to have one for hot backup and one for cold backups.
But I am wondering how to schedule a task using rman. For example is it possible to write a script that would make the backups at a desired time executed by oracle?
Or do I have to create a script on unix that should be executed by cron?
You know I am really bad at scripting, but it would really help me if you could help me creating a script that would make the backup automatically on sunday at midnight and incremental eveydays until sunday.Here is the information I need to put in a script:
#flash recovery area creation under sqlplus
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 10g SCOPE=BOTH SID='*';
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/home/oracle/flash_recovery_area' SCOPE=BOTH SID='*';
#setting the default variable
ORACLE_SID=iscream;
#connect to target database:
rman TARGET SYS/oracle@iscream NOCATALOG
#set the defaults values for rman
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION ON;
Any help will be appreciated
synthese
hot backup
using rman
using flash_recovery_area
full backup set compressed on sunday
incremental backup set compressed from mondy to saturday
using disk
policy retenttion 7 days
redondance 2You can backup using some unix shell scripts.
rman is not really good one. -
How to create a scripting language in java?
Hello,
All that I want to do is to create a scripting language in java. I�m familiar with javacc, jsr223 and other things but don�t know how to start. The language syntax is java 5 syntax with some change and I want to generate java source code from small scripts. In fact I don�t know how other languages (like groovy) are created.
I hope you can show me the required steps.
Looking forward to hear from you.
Thanks.That's all, huh?
For a start, generally when I hear "scripting language" I'm thinking interpretter, not a system which creates compiled (or compilable) code.
I get the impression that what you're talking about is what I'd call a "preprocessor" language, some extra syntax added to java which the preprocessor renders into ordinary java.
As far as complexity is concerned, much depends on how deeply involved the extra syntax is with the embedded ordinary Java. Does you preprocessor need to understand the java, or is it just embedded as text? How easilly identified are your preprocesor statments? It's a lot easier to do this if preprocessor lines are instantly identifiable from Java code (e.g. start with a #).
Basically the stages are always the same;
1) Lexical analysis i.e. picking out words, operators, numbers, quoted strings.
2) Construct a syntax tree.
3) Generate code (in this case Java).
Now, in this case, some of the nodes in the syntax tree may simply be chunks of undigested Java. -
How do I create a script to do this?
I have a photoshop file with several layers...about 100. I want to put each layers into it's own group. The name of the group must be the same as the name of the layer.
I tried creating a action to do this but it did not work right. It only works for one layer selected individually. If I select multiple layers, then it forms nested groups.
I was told that I can't do this using an action and I would need a script for this.
How do I create this script?
I am using adobe photoshop cs6 ( I think) , windows 7.This assumes that none of the layer are already in layerSets( group ) and none have layer locking.
if(app.documents.length>0){
var doc = app.activeDocument;
while(!doc.artLayers[0].isBackgroundLayer && doc.artLayers.length>0 ){
var newSet = doc.layerSets.add();
newSet.name = doc.artLayers[0].name;
doc.artLayers[0].move(newSet,ElementPlacement.INSIDE); -
Create a script to save multiple groups into seperate png files
Hello,
I want to use a script to save every group I made into a '.PNG. I'm visualizing something like this, but the outputformat/name doesn't matter, as long it is a output from a group:
group1 -> 1.png
group2 -> 2.png
group3 -> 3.png
group4 -> 4.png
etc.
I noticed that someone create a script like that, but it isn't using for me anymore. Find here the script that isnt working for me:
Re: Export Groups to Files?
I am using Photoshop CC 2014 on Windows 7 (64bit).
Looking forward to your reply! Thanks.
Kind regards,
JoostWhich code cpu you use and what does
but it isn't using for me anymore.
mean exactly? -
Would like to create a script for list all elements and structure of an indesign document
Hello everybody,
I'm a very beginner in indesign scripting.
I would like to create a script in order to list all elements and the inner structure of a n indesign document.
The aim for me is to understand how elements are sorted and arranged into indesign, and be able to find an specific element by its item name.
The output document could be an xml or txt document with a treeview structure.
I would like have a rough idea of which kind of javascript code I should use for that.
Thanks for answers.Hi Ossydoc,
You can use Muse to create such a website. All you need to do is, create links in Muse for the sermons and select " link to File " in the hyperlink option and link to those Mp3 files.
Please refer to this screenshot :- http://prntscr.com/4xvdup
Now, when you publish your site, Muse would automatically upload those files onto the server and the users would then be able to listen as well as download those sermons using the links on your site.
Hope this helps
Regards,
Rohit Nair -
Why do vector lines appear different in my Photoshop document compared to the PDF that was created using "Scripts > Layer Comps to PDF"? And how do I get them to look the same?
BOILERPLATE TEXT:
If you give complete and detailed information about your setup and the issue at hand, such as your platform (Mac or Win), exact versions of your OS, of Photoshop and of Bridge, machine specs, what troubleshooting steps you have taken so far, what error message(s) you receive, if having issues opening raw files also the exact camera make and model that generated them, etc., someone may be able to help you.
Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
http://forums.adobe.com/thread/419981?tstart=0
Thanks! -
Creating a script for inserting images
I am new to the scripting concept, so please forgive me when I use incorrect terminology.
I would like to create a script that will automatically place images in my InCopy document. Basically I want to type the names of image files in an InCopy document then run a script that will replace the name of the file with the actual image (either as an embedded image or as an image in a graphics frame, although the graphics frame might not work if the document isn't linked to an InDesign document.)
I'm assuming I'd have to identify the image name in some way (slashes or something before and after) and during the script I'd have to identify where to find the given images, such as which folder they are in.
Is this possible in InCopy?
Eventually, these InCopy documents will be used in InDesign. Would it be better/faster to use a script to import these images into InDesign instead of InCopy?
(In case the information is important, the images are all either .tif files or .eps files.)
Also, how do I find someone who can write this script for me? I'm assuming there are freelance programmer people out there... how do I find one?
Thanks for any advice/help you can give me!senza wrote:
this is ok, this i understand now. But where to tell which schema for which user?I don't understand this question. You create a synonym in your own schema for the object you want a synonym for...
so instead of referencing
select * from scott.empyou would create a synonym for scott.emp, so you can do
select * from emp -
Unable to create post script file in framemaker.
I installed TCS 4.0 licensed suite. Due to some reason I need to delete Adobe PDF from Devices and Printers. Since then I am unable to create post script file using framemaker. I have tried uninstalling and installing TCS 4.0 again, but all in vain. What should I do now?
If you delete critical parts of Acrobat there will be problems. Try doing a REPAIR of Acrobat Pro (from the Programs Control Panel), maybe it can undo the damage.
Maybe you are looking for
-
How to find out the list of workflows with active event linkage?
Hi All, I want to find out the list of workflows whoe event linkage is activated in the system. Through SWU0, we can get a list of workflows attached to a particular event of a business object. Thanks, Sivagami
-
How can i delete my icloud account but not the password to turn off the find my phone
how can i delete my icloud account but not the password to turn off the find my phone setting
-
Windows 7 " Adobe Photoshop CS3 has stopped working "
Okay let me stir up a whole new kettle of fish WINDOWS 7 VS CS3 PHOTOSHOP. I have Windows 7 Ultimate Edition 64bit. I am running (or trying) CS3 Master suite. Most all progams function except Photoshop. I try to load it and I get "Adobe Photoshop CS3
-
AppleTV no longer appearing in iTunes. Suggestions?
Let me start off this post by saying that I work as a computer programmer, so I'm not unfamiliar with following support guides, etc. So with that said, please don't tell me to follow Apple Support for this, as I've done every single step out there. I
-
BAPI_DOCUMENT_CHANGE2 and delete link
Hi, I am trying to delete the document's link. But I can not do this operation. My code is; ls_doc-documenttype = 'VD2'. ls_doc-documentnumber = '0000000100000000000000344'. ls_doc-documentversion = '00'. ls_doc-documentpart = '000'. ls_doc