Create table dynamically with concatanated sysdate
Hello,
i am trying to create a table dynamically using a sysdate concatanated i am getting an error. could anyone point me where i am doing wrong in scripts.
here is the script.
decalre
x varchar2(200)
begin
x:='CREATE table test_'||sysdate (pname varchar2(10), pnum number(9))''';
execute immediate x;
end;
appreciate any help.
EdStevens wrote:
Rodriguez wrote:
Yes, of course .
But unfortunately it is not good practice in real production systems :)Of course, the OP's entire approach, his entire design, is profoundly flawed, so why stop here?About using "interesting" identifier names in Oracle...
An interesting problem in doing basic o-o development in PL/SQL is that all classes (object types) need to have properties. So if you want a pure abstract class with static methods, you cannot create that without defining at minimum, a single property.
Work-around? Define a property that most PL/SQL developers will be unable to call and use even if they tend to abuse o-o classes. Define the property as a single space. E.g.
create or replace type TSomeAbstractClass is object(
" " smallint,
static method function Foo1 ...
) not final not instantiable;:-)
Similar Messages
-
How to create table view with reference table
Hi experts,
How to create table view with reference table in SE11, plz gve me stp by stp procedure.
pints grnded for hlp.Hi
Go to Tcode se11 choose view and enter the name and create a popup opens up choose database view option
enter the description
On the left hand side choose the table name.
Click on view fields tab and choose your table fields.Here you can choose which fields you want in your view.
Save and then activate.
Hope this helps.
Regards,
Harish -
Is it possible to create a dynamic(with a select) check constraint?
create table a (col_to_be_coded_fora number);
create table b (col_to_be_coded_forb number);
create table c (col_name varchar2(20), col_code number, col_desc varchar2(20));
insert into c values ('col_to_be_coded_fora', 1, 'active');
insert into c values ('col_to_be_coded_fora', 2, 'de-active');
insert into c values ('col_to_be_coded_fora', 3, 'pending');
insert into c values ('col_to_be_coded_forb', 10, 'school');
insert into c values ('col_to_be_coded_forb', 20, 'hospital');
insert into a values ( 1); -- meaning 'active' for table a, column col_to_be_coded_fora, can go in
insert into a values (10); -- meaning nothing for table a, column col_to_be_coded_fora, must give error
insert into b values ( 1); -- meaning nothing for table b, column col_to_be_coded_forb, must give error
insert into b values (10); -- meaning 'school' for table b, column col_to_be_coded_fora, can go in
I know i can handle this problem with dividing table c into to tables and creating foreign key relationship.
in this demo case i have only a and b, 2 tables but i want to encode thousands of tables with a table like c.
İs it possible to create a dynamic check constraint on a table which selects c table for the inputs that have permision?
Or do i have to use after insert, update triggers on table a and b to ensure this functionality?
Is there a smarter implementation for this need, may be a design change?
Thank you,
Kind regards.
TonguçHi Tonguç,
A small design change makes it possible to do this with simple foreign key constraints.
I would do something like:
ual303@ORKDEV01> CREATE TABLE c (
2 col_name VARCHAR2(20),
3 col_code NUMBER,
4 col_desc VARCHAR2(20),
5 PRIMARY KEY (col_name, col_code)
6 );
Tabel is aangemaakt.
ual303@ORKDEV01> CREATE TABLE a (
2 col_to_be_coded_fora NUMBER PRIMARY KEY,
3 col_name VARCHAR2(20) DEFAULT 'col_to_be_coded_fora' CHECK (col_name = 'col_to_be_coded_fora'),
4 FOREIGN KEY (col_name, col_to_be_coded_fora) REFERENCES c
5 );
Tabel is aangemaakt.
ual303@ORKDEV01> CREATE TABLE b (
2 col_to_be_coded_forb NUMBER PRIMARY KEY,
3 col_name VARCHAR2(20) DEFAULT 'col_to_be_coded_forb' CHECK (col_name = 'col_to_be_coded_forb'),
4 FOREIGN KEY (col_name, col_to_be_coded_forb) REFERENCES c
5 );
Tabel is aangemaakt.
ual303@ORKDEV01> insert into c values ('col_to_be_coded_fora', 1, 'active');
1 rij is aangemaakt.
ual303@ORKDEV01> insert into c values ('col_to_be_coded_fora', 2, 'de-active');
1 rij is aangemaakt.
ual303@ORKDEV01> insert into c values ('col_to_be_coded_fora', 3, 'pending');
1 rij is aangemaakt.
ual303@ORKDEV01> insert into c values ('col_to_be_coded_forb', 10, 'school');
1 rij is aangemaakt.
ual303@ORKDEV01> insert into c values ('col_to_be_coded_forb', 20, 'hospital');
1 rij is aangemaakt.
ual303@ORKDEV01> -- meaning 'active' for table a, column col_to_be_coded_fora, can go in
ual303@ORKDEV01> insert into a(col_to_be_coded_fora) values ( 1);
1 rij is aangemaakt.
ual303@ORKDEV01> -- meaning nothing for table a, column col_to_be_coded_fora, must give error
ual303@ORKDEV01> insert into a(col_to_be_coded_fora) values (10);
insert into a(col_to_be_coded_fora) values (10)
FOUT in regel 1:
.ORA-02291: integrity constraint (UAL303.SYS_C0033537) violated - parent key not found
ual303@ORKDEV01> -- meaning nothing for table b, column col_to_be_coded_forb, must give error
ual303@ORKDEV01> insert into b(col_to_be_coded_forb) values ( 1);
insert into b(col_to_be_coded_forb) values ( 1)
FOUT in regel 1:
.ORA-02291: integrity constraint (UAL303.SYS_C0033540) violated - parent key not found
ual303@ORKDEV01> -- meaning 'school' for table b, column col_to_be_coded_fora, can go in
ual303@ORKDEV01> insert into b(col_to_be_coded_forb) values (10);
1 rij is aangemaakt.
ual303@ORKDEV01>Cheers,
Colin -
I need help creating a table dynamically. i have a view in one database. i would like to create a table in another instance using the view structure of a view which is in another instance. the problem i am having is that some columns in the view are always null so they appear as a varchar2 datatype without lenght.
when i do an insert/select it does not create the table because of this problem. so i would like to know if anybody know how to create a script to handle this case and create my table dynamically.
there was a script in the code tips section in oracle site but i lost that script. please provide code on how to do this. thanksHi,
SQL> create or replace view v as
2 select null a, to_number(null) as b, to_date(null) as c,
3 to_nchar(null) as d,
4 11 as e, 1.11 as f,
5 'fff' as g, to_nchar('cvfgfg') as h, sysdate as i
6 from dual;
View created.
SQL> DECLARE
2 vCreate_Sql VARCHAR2(32000);
3 vFirst_Col BOOLEAN;
4 BEGIN
5 vCreate_Sql := 'CREATE TABLE T (';
6 vFirst_Col := TRUE;
7 FOR cRec IN (
8 SELECT Column_Name, Data_Type, Data_Precision, Data_Scale, Char_Col_Decl_Length
9 FROM User_Tab_Columns
10 WHERE Table_Name = 'V'
11 ) LOOP
12 IF vFirst_Col THEN
13 vFirst_Col := FALSE;
14 ELSE
15 vCreate_Sql := vCreate_Sql || ',';
16 END IF;
17
18 vCreate_Sql := vCreate_Sql || cRec.Column_Name || ' ' || cRec.Data_Type ||
19 CASE
20 WHEN cRec.Data_Type IN ('CHAR', 'VARCHAR2', 'NCHAR', 'NVARCHAR2') THEN
21 '(' || TO_CHAR(GREATEST(1, cRec.Char_Col_Decl_Length)) || ')'
22 WHEN cRec.Data_Type = 'NUMBER' THEN
23 CASE
24 WHEN cRec.Data_Precision IS NULL THEN ''
25 WHEN cRec.Data_Precision IS NOT NULL AND cRec.Data_Scale IS NULL THEN
26 '(' || TO_CHAR(cRec.Data_Precision) || ')'
27 WHEN cRec.Data_Precision IS NOT NULL AND cRec.Data_Scale IS NOT NULL THEN
28 '(' || TO_CHAR(cRec.Data_Precision) || ', ' || TO_CHAR(cRec.Data_Scale) || ')'
29 END
30 /* ... Possibly other datatypes */
31 ELSE
32 ''
33 END;
34 END LOOP;
35 vCreate_Sql := vCreate_Sql || ')';
36
37 EXECUTE IMMEDIATE vCreate_Sql;
38 END;
39 /
PL/SQL procedure successfully completed.
SQL> desc v
Name Null? Type
A VARCHAR2
B NUMBER
C DATE
D VARCHAR2
E NUMBER
F NUMBER
G CHAR(3)
H NVARCHAR2(6)
I DATE
SQL> desc t
Name Null? Type
A VARCHAR2(1)
B NUMBER
C DATE
D VARCHAR2(1)
E NUMBER
F NUMBER
G CHAR(3)
H NVARCHAR2(6)
I DATERegards,
Dima -
Hi,
Anybodys know how to create a table(Item Layout is "table") dynamically in processRequest.
Pls help
regards
SajuHi Shiv,
<p>
My code seems right :D hehehe But please do help me debug.. my codes below... I have already the <b>MyQueryRN</b> in Pagelayout and 1rowlayout with fields. I need to add more rows by clicking add button.
<br><br>
<b>processRequest:</b>
<br>
<i>
String searchAction = (String) pageContext.getTransactionValue("searchAction");<br>
if (searchAction != null && searchAction.equalsIgnoreCase("Add")) {<br>
// add a rowlayout
String count = (String) pageContext.getTransactionValue("rowCount");<br>
OAWebBean table = webBean.findChildRecursive("MyQueryRN");<br>
OAWebBean row = pageContext.getWebBeanFactory().createWebBean(pageContext,
ROW_LAYOUT_BEAN, null,
"row".concat(count));
table.addIndexedChild(row);<br>
for (int i=1; i<3; i++) {<br>
OAWebBean cell = pageContext.getWebBeanFactory().createWebBean(
pageContext, CELL_FORMAT_BEAN, null,
"cell".concat(count).concat("_").concat(String.valueOf(i)) );<br>
row.addIndexedChild(cell);<br>
if (i==1) {<br>
OAWebBean msgText = pageContext.getWebBeanFactory().createWebBean(
pageContext, MESSAGE_TEXT_INPUT_BEAN, null,
"text".concat(String.valueOf(i)).concat("_").concat(count) );<br>
cell.addIndexedChild(msgText);<br>
} else {<br>
OAWebBean msgChoice = pageContext.getWebBeanFactory().createWebBean(
pageContext, MESSAGE_CHOICE_BEAN, null,
"text".concat(String.valueOf(i)).concat("_").concat(count) );<br>
cell.addIndexedChild(msgChoice);<br>
}<br>
}<br>
}<br>
</i>
<br>
<b>processForm:</b>
<br>
<i>
String event = pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM);<br>
if (event != null && event.equals("Add")) {
pageContext.putTransactionValue("searchAction", event);<br>
String count = (String) pageContext.getTransactionValue("rowCount");<br>
if (count != null) {<br>
count = String.valueOf(Integer.parseInt(count) + 1);<br>
} else {<br>
count = "2";<br>
}<br>
pageContext.putTransactionValue("rowCount", count);<br>
pageContext.forwardImmediatelyToCurrentPage(null, true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);<br>
}<br>
</i>
</p> -
Hi,
I need to create a number of tables (with the same number of fields for each table) depending on my data.
E.g. If I input 6 at the selection screen,
I need to create GT_1, GT_2.... GT_6 with LINE1 TYPE C and LINE2 TYPE C as the fields.
How to do that? Thanks.
Regards,
JanetHi Lee,
The following code shoul help the purpose.
This code explains about the dynamic creation of internal table according to the input database table and displaying it in an ALV Grid. Works with all sort of database tables (even huge number of records).This concept can be expanded to work with tables that have very large number of fields.
By: Siva Subramanian Kalaiselvan
Company: Wipro Technologies
Date: 21 Jan. 2005
Code Sample
REPORT ZC3_DYNITABDISPALV MESSAGE-ID zmsgdynamic.
Description : Dynamic internal table creation and
displaying in ALV Grid.
Technical Contact : SivaSubramanian Kalaiselvan
Technical Spec. Number: ZC3_DYNITABDISPALV.
Created on : 21/01/05.
Transport request : PDCK902348.
Development Class : zc3_sivdev.
TABLES : tadir. " table in which the obj_name field stores all the
" database table names
TYPE-POOLS : slis.
TYPES ztab LIKE dcobjdef-name .
DATA : dyntab LIKE dntab OCCURS 0 WITH HEADER LINE,
dref TYPE REF TO data,
i_fcat TYPE lvc_t_fcat ,
wa_fcat TYPE lvc_s_fcat ,
w_pgm LIKE sy-repid,
count TYPE i VALUE 0,
w_obj_name LIKE tadir-obj_name.
DATA : wa_fieldcat TYPE slis_fieldcat_alv, "ALV FIELD CATALOG TABLE
i_fieldcat TYPE slis_t_fieldcat_alv, "ALV FIELD CATALOG STRUCTURE
i_event TYPE slis_t_event, "ALV EVENT HANDLING TABLE
wa_event TYPE slis_alv_event, "ALV EVENT HANDLING STRUCT
i_listheader TYPE slis_t_listheader, "ALV LIST HEADER TABLE
wa_listheader TYPE slis_listheader, "ALV LIST HEADER STRUCT
i_layout TYPE slis_layout_alv.
FIELD-SYMBOLS :<newtab> TYPE table.
INITIALIZATION.
w_pgm = sy-repid.
****************SELECTION-SCREEN 2000
SELECTION-SCREEN BEGIN OF SCREEN 2000 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE tit1.
PARAMETERS: tab_name TYPE ztab . " Enter database table name
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 2000.
***************END OF SELECTION-SCREEN 2000
tit1 = 'Enter Table Name?'.
START-OF-SELECTION.
CALL SELECTION-SCREEN 2000 STARTING AT 10 10.
PERFORM occurcheck.
*********CHECKING WHETHER THE DATABASE TABLE EXISTS
FORM occurcheck.
SELECT obj_name FROM tadir INTO w_obj_name WHERE obj_name = tab_name.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE i003."Table not found in the database .
CALL SELECTION-SCREEN 2000 STARTING AT 10 10.
PERFORM occurcheck.
ELSE.
PERFORM startprocess.
EXIT.
ENDIF.
ENDFORM.
**********GETTING THE FIELD NAMES OF THE INPUT DATABASE TABLE
FORM startprocess.
CALL FUNCTION 'NAMETAB_GET'
EXPORTING
langu = sy-langu
tabname = tab_name
TABLES
nametab = dyntab. "dntab now contains the field names
**********FILLING THE CATALOG OF NEW DYNAMIC INTERNAL TABLE
LOOP AT dyntab.
wa_fcat-fieldname = dyntab-fieldname.
wa_fcat-ref_field = dyntab-fieldname.
wa_fcat-ref_table = dyntab-tabname.
APPEND wa_fcat TO i_fcat .
ENDLOOP.
***********CREATING A POINTER (FIELD SYMBOL) TO THE INTERNAL TABLE
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fcat
IMPORTING
ep_table = dref.
ASSIGN dref->* TO <newtab>.
SELECT * FROM (dyntab-tabname) INTO TABLE <newtab>.
**********CHECKING WHETHER DATA HAS BEEN UPLOADED.
DESCRIBE TABLE <newtab> LINES sy-tfill.
DESCRIBE TABLE <newtab> LINES count.
IF sy-tfill = 0 .
MESSAGE i001. "Internal table is not filled
ELSE.
MESSAGE i002 WITH count. "Internal table is filled
ENDIF.
****************EVENTS USED IN ALV
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0 " 0-simple list, 1-hierarchial list.
IMPORTING
et_events = i_event.
SORT i_event.
READ TABLE i_event
WITH KEY name = slis_ev_top_of_page "TOP_OF_PAGE event
INTO wa_event.
IF sy-subrc = 0.
MOVE 'IAM_TOP_OF_PAGE' TO wa_event-form. "IAM_TOP_OF_PAGE will
"call subroutine automatically
MODIFY i_event FROM wa_event INDEX sy-tabix.
ENDIF.
****************DISPLAYING ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_pgm
i_structure_name = dyntab-tabname
it_events = i_event
TABLES
t_outtab = <newtab>.
ENDFORM.
**********FORM TOP_OF-PAGE.
******FILLING OF LIST HEADER TABLE
FORM iam_top_of_page.
CLEAR wa_listheader.
wa_listheader-typ = 'H'. "HEADING
wa_listheader-info = 'ALV CREATED DYNAMICALLY'.
APPEND wa_listheader TO i_listheader.
CLEAR wa_listheader.
wa_listheader-typ = 'S'. "SUB-HEADING
wa_listheader-key = 'PGM NAME:'.
wa_listheader-info = w_pgm.
APPEND wa_listheader TO i_listheader.
CLEAR wa_listheader.
wa_listheader-typ = 'S'.
wa_listheader-key = 'USER:'.
wa_listheader-info = sy-uname.
APPEND wa_listheader TO i_listheader.
CLEAR wa_listheader.
wa_listheader-typ = 'S'.
wa_listheader-key = 'DATE:'.
wa_listheader-info = sy-datum.
APPEND wa_listheader TO i_listheader.
CLEAR wa_listheader.
wa_listheader-typ = 'S'.
wa_listheader-key = 'TABLE NAME:'.
wa_listheader-info = dyntab-tabname.
APPEND wa_listheader TO i_listheader.
********FUNCTION TO WRITE THE TITLE AND SUB-TITLE OF THE ALV.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader.
ENDFORM.
Reward if found usefull......!
Regards,
Ram. -
Error While creating Table dynamically
Hello gurus,
I am trying to create a table dynamically in OA Page. For this I have added an Empty TableLayoutBean called "TestTableLayoutRN" in My PG. and In the controller's process request I have added following Code
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
System.out.println("TableBeanCO:ProcessRequest");
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
Serializable[] parameters = null;
//am.invokeMethod("rollbackSupplier");
OATableLayoutBean tableLayoutBean = (OATableLayoutBean)webBean.findIndexedChildRecursive("TestTableLayoutRN");
OARowLayoutBean row = (OARowLayoutBean)createWebBean(pageContext,
OAWebBeanConstants.ROW_LAYOUT_BEAN,null,"rowHeader");
tableLayoutBean.addIndexedChild(row);
OACellFormatBean cell = (OACellFormatBean)createWebBean(pageContext,
OAWebBeanConstants.CELL_FORMAT_BEAN,null,"cellHeader");
row.addIndexedChild(cell);
System.out.println("TableBeanCO:End ProcessRequest");
But I am getting null pointer exception on the Line tableLayoutBean.addIndexedChild(row);
when I am trying to add the row to this table..
Can you please help why I am getting this error?
Exception Details.
oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:597)
at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest(OAWebBeanTableHelper.java:2084)
at oracle.apps.fnd.framework.webui.beans.table.OATableBean.processRequest(OATableBean.java:1030)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1095)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2298)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1711)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.lang.NullPointerException
at xx.oracle.apps.fnd.webui.TableBeanCO.processRequest(TableBeanCO.java:79)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:581)
at oracle.apps.fnd.framework.webui.OAWebBeanTableHelper.processRequest(OAWebBeanTableHelper.java:2084)
at oracle.apps.fnd.framework.webui.beans.table.OATableBean.processRequest(OATableBean.java:1030)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1095)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:932)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:899)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:640)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2298)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1711)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
at OA.jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)I am not very sure - but I seem to remember that you need to call tableBean.prepareForRendering() before you start altering it... well - dont count on my suggestion to work.. I had tried something similar 3 years ago... and speaking from what little i remember from then...
-
SQL Synatx error while creating table dynamically
I am getting error when I am trying to create table on runtime
Declare @FileName varchar(100)
Declare @File varchar(100)
set @FileName='brkrte_121227102828'
SET @File = SUBSTRING(@FileName,1,CHARINDEX('_',@FileName)-1)
--=select @File
Declare @table_name varchar(100)
Declare @ssql varchar(1000)
SET @table_name = 'DataStaging.dbo.Staging_'+ @File
SET @sSQL = 'CREATE TABLE ' + @table_name + ' ( ' +
' [COL001] VARCHAR (4000) NOT NULL, ' +
' [Id] Int Identity(1,1), ' +
' [LoadDate] datetime default getdate() ' +
Exec @sSQL
Error massage:-
Msg 203, Level 16, State 2, Line 16
The name 'CREATE TABLE DataStaging.dbo.Staging_brkrte ( [COL001] VARCHAR (4000) NOT NULL, [Id] Int Identity(1,1), [LoadDate]
datetime default getdate() )' is not a valid identifier.
Please help me to resolve above error
Thankx & regards, Vipin jha MCPGot the answer
issue with the Exec (@sSQL)
thanks
Thankx & regards, Vipin jha MCP -
How To Create Table View With Same Column name But Different Table?
Hi All,
I have the problem to create a tableview with same column name but in different table.
The Table that i have:-
Table - PAC051MPROFORMA
Column - mrn,visitid
Table - PAC051TPROFORMA
Column - mrn,visitid
Table - PAC052MTRANSBILL
Column - mrn,visitid
Then i want to create a table view to view that table. This is my SQL
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
That SQL Return this error = ORA-00957: duplicate column name
Then I modify that SQL to
CREATE VIEW pacviewproforma (mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
This time this error return = ORA-01730: invalid number of column names specified
What should i do?
Thanks...Hi,
SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
ERROR at line 1:
ORA-00957: duplicate column namePlease give different names to each column.
Something like this..
SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
_visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
View created.
SQL> DESC pacviewproforma;
Name Null? Type
MPROFORMA_MRN NUMBER
MPROFORMA_VISITID NUMBER
TPROFORMA_MRN NUMBER
TPROFORMA_VISITID NUMBER
MTRANSBILL_MRN NUMBER
MTRANSBILL_VISITID NUMBER
ORA-01730: invalid number of column names specifiedThe list of column nmae you specified during the CREATE VIEW should match with the SELECT list of the view.
Twinkle -
Create table as with append hint
All,
This is part of my oracle plsql procedure.
EXECUTE IMMEDIATE 'create table inventory_stg
TABLESPACE users
PARALLEL 6
AS
SELECT DISTINCT /*+ parallel(stg,6) */
orders.order_sid,
ORDERS.order_doc,
stg.ref_doc_num quote_num
FROM stg,
ORDERS,
QUOTE
WHERE
stg.DOC_doc=ORDERS.order_doc AND
stg.ref_doc_num=QUOTE.quote_num AND
QUOTE.s_no = ORDERS.s_no';
This query is running for ever.
If i create a table and insert with append hint, it will complete in 10 min.
I know, the append hint will bypass redolog and insert above HWM.
But my above code also a direct load and why it is taking this much time?
My db is running in archive log mode. But i don't want to log the info in redo.
Regards
GovindI don't think so. /*+ APPEND */ is probably what you are thinking of. But even if it isn't direct load, inserting into a tablespace that isn't totally fragged might not be too slow for you. I'm just suggesting a test since you weren't getting any direct answers.
I actually haven't done any testing on parallel with execute immediate either. I don't know if EI imposesl certain limitations on that or not.
Anyone?
Update: Actually, you are correct. Append is the default mode for a parallel insert. So that would make me start looking at side affects of the Execute Immediate.
Message was edited by:
Gaff -
Need to create Table Maintenance with more than 400 characters
I need to create table maintenance in which one filed have more than 400 characters. CHAR type support between 1-255 & STRING type not supported by Table Maintenance. Is there any alternative type or solution for that?
Hi,
If you assign TMG to the table, it will throw error as unable to display the field on screen. why because it can able to display upto 255 char length only.
For this requirement you have 2 solutions :
1) Create multiple fields and your Z table, split the data and store them as required.
2) Create a TEXT ID and store it as a long text using FM CREATE_TEXT.
or
This type of text should be treated as Long Text.
And the steps are:
1. Create Text Object Using SE75.
2. Create Text ID Using SE75.
3. Now you have to Save the text with FM SAVE_TEXT.
For example:
The Most simple solution for it can be that Divide the field REMARKS of size 1000 in multiples of 200 characters like REMARK1, REMARK2....REMARKn.
Now you can create two FMs :
zset_data: To Store 1000 char long data in Table
Here you will divide the data of Variable (type char1024) in multiples of 200 and will store in REMARK1, REMARK2.....
zget_data: To Get 1000 char long data back from Table
Here you will concatenate REMARK1, REMARK2..... and will store in Variable of Type char1024.
This is the best solution if Table is not going to be maintained by Table Maintenance Generator.
regards,
ravi -
URGENT!!!!How to CREATE TABLE dynamically
HI all
i want to create a table in a pl/sql procedure
where requirement is to create a table dynamically.
can anybody suggest me the solution.Why is this urgent? creating a table dynamically ought to be a rare event, required only by certain kinds of rather specialised applications.
When people ask us how to do it in these forums, it's often because they are coming from an MS SQL background and haven't understood Oracle's concept of global temporary tables.
Cheers, APC -
Problem while creating table dynamically using stored procedure
Hi all
When i try to execute the following lines get insufficient privilege error.
FYI: i m able to create table statically.(i.e without using stored procedure)
CREATE OR REPLACE PROCEDURE pcalling IS
str varchar2(60);
BEGIN
str:='create table t15(tno number,tname varchar2(5))';
execute immediate str;
END;
Thanks in advance
Satyahi
SQL> CREATE OR REPLACE PROCEDURE runddl (ddl_in in VARCHAR2)
2 AUTHID CURRENT_USER
3 IS
4 BEGIN
5 EXECUTE IMMEDIATE ddl_in;
6 END;
7 .
SQL> /
Procedure created.AUTHID CURRENT_USER clause before the IS keyword which runddl executes, it should run under the authority of the invoker, or current user not the authority of the definer.
if you omit it then it will no longer will be run if the creator doesnt have privelege to run this ddl regardless invoker has or not.
i hope you got it
Khurram Siddiqui
[email protected] -
How to create objects dynamically (with dynamic # of parameters)
I need to create a set of objects based on a definition from an XML file (obtained from the server) and add them to my scene.
I understand how to create the object using getDefinitionByName (and the limitations regarding classes needing to be referenced to be loaded into the SWF).
But some objects require parameters for the constructor, and some don't. The XML can easily pass in the required parameter information, but I can't figure out how to create a new object with a dynamic set of arguments (something akin to using the Function.call(obj, argsArray) method.
For example, I need something like this to work:
var mc=new (getDefinitionByName(str) as Class).call(thisNewThing, argsArray)
Currently this is as far as I can get:
var mc=new (getDefinitionByName(str) as Class)(static, list, of, arguments)
Thoughts?I think what Dave is asking is a bit different.
He's wanting to know how to invoke the constructor of an object dynamically (when he only knows the # of constructor arguments at runtime).
This class I know will do it but seems to be a hack:
http://code.google.com/p/jsinterface/source/browse/trunk/source/core/aw/utils/ClassUtils.a s?spec=svn12&r=12
See the 'call' method, which first counts the # of arguments then invokes one of 'n' construction methods based on the number of constructor args.
I've yet to find a clean AS3 way of doing things ala 'call' though.
-Corey -
Create table as with partitions
Hi,
Is there a way to create table1 same as table2 with the exact partition and subpartition names? I need to exchange the partitions between the tables. Move the data from table1 to table2 and drop the subpartition from table1.Any help is appreciated.
Thanks
SCHi,
Thanks for reply. I tried dbms_metadata.get_ddl and it worked but lists all the partitions and subpartitions. table2 is partitioned by date and serviceid. Is there a way to generate the ddl for specific partitions of table2 and not all the partitions and subpartitions?
Thank You
SC
Maybe you are looking for
-
This is the full question since I couldn't get it all in the box. I have some complex questions regarding an iMac, a Time-Machine backup, and iTunes on an iPod. I live about halfway up an extinct volcano about 12 miles north of San Jose Costa Rica.
-
Uploading data from flat file to table control
HI All, I want to upload data to OVKK tcode using BDC. For this I wrote Z program as shown below: REPORT ZSD_BDC_OVKK_UPLOAD NO STANDARD PAGE HEADING LINE-SIZE 255. *INCLUDE bdcrecx1. DATA : BEGIN OF T_DUMMY OCCURS 0, VAR(100) TYPE C,
-
Dear Expert, Please correct if i am wrong. We always run payroll with Log only.It does not matter,we are running in test mode or in live run. Now in my current situation,, when i am running payroll for 2500 emp, system is giving dump stating that no
-
Why won't imovie '11 finalize or prepare my project??
why won't imovie '11 finalize or prepare my project?? Just an error message. I've made many videos before with NO issues.
-
So after some problems with the install of PS CS6 this is now solved. But what a surprise, no bridge available. Not as download in the adobe application manager nor as a download on the website. what happend? In PS there is a menu item called "open i