Create table with variables enviroment
Hi all,
I would create a table by a schedule procedure when an event occurs.
Can I create a table with these or similar syntax:
create table acme_%s_%t as select * from a;
I would use this syntax because this event could happen more time a day and so I can check.
is it possible?
Thanx a lot
Ciao
Alberto
Albertofro wrote:
Hi all,
I would create a table by a schedule procedure when an event occurs.
Can I create a table with these or similar syntax:
create table acme_%s_%t as select * from a;
I would use this syntax because this event could happen more time a day and so I can check.
is it possible?
Thanx a lot
Ciao
AlbertoTo create a table dynamically you need to use EXECUTE IMMEDIATE. If you want your table name to be padded with timestamp you can do it with TO_CHAR and SYSDATE functions.
An example
execute immediate 'create table acme_' || to_char(sysdate, 'DDMMYYYYHH24MISS') || ' as select * from a';
Similar Messages
-
How create table with variable number of columns?
I am creating table data in Java. Number of columns is variable. How I can write <table> in UIX.
Here is code of one of my unsuccessful attempt:
<provider>
<!- get table data like DataObjectList-->
<data name="ReportTableData">
<method class="app.ReportTableData" method="getTableData"/>
</data>
<!- get names of columns like DataObjectList-->
<data name="ColumnNames">
<method class="app.ReportTableData" method="getColumnNames"/>
</data>
</provider>
<table data:tableData="@ReportTableData">
<contents data:childData="@ColumnNames">
<text data:text="nameColumn"/>
</contents>
</table>
I hoped that I can get cell data by key, where key is name of column. But cells of table contain only names of columns.
Please help me, where I mistaken?
Thank you.Hi Sergey,
The UIX table implementation relies on a childData like mechanism internally to iterate over the rows. For instance, when you databind the text attribute of the UINode used to stamp out each column, you are relying on the uix:table iterating over the table data using the data object for the current row when evaluating your column stamp.
Setting the data:childData attribute on the table's contents element conflicts with UIX's internal iteration over the tableData. For this reason, we don't support specifying a dynamic number of table columns in UIX XML.
This doesn't mean that you can't do it, there are different strategies. If you've got a finite and known set of columns, you can specify each possible column and then databind the rendered attribute of each one to hide and show it as appropriate. Another, often cleaner approach, is to build this subtree of UINodes in Java code. -
How to create table with variable
hi,
i m to create many table with same starting name but last name would be vary like
i m to create table test121 and test122 and so on
i want to set name test then any given number by variable so i can create many table.
so how to add it in create table command.
i tried create table test||:var (column names) but it didnt work.
so plz suggest me how to do it ?
thxsActually this is good.
It has nothing to do with database design. A database is not a garbage bin.
You need to do several things
a) make sure your design is normalized so you don't have identical tables.
b) In future posts specify a platform and a version and the tool you are using to create the table
c) if the tool is sql*plus learn about substitution variables aka DEFINEs.
Sybrand Bakker
Senior Oracle DBA -
How to insert a table with variable rows in smart form
Hi all,
How to insert a table with variable rows in smart form?
Any help would be appreciated.
Regards,
Mahesh.Hi,
Right click the mouse->create->table
If you want 5 columns, you need to declare 5 cells in one line type of the table
Click on Table -> Details, then do the following
Line Type 1 2 3 4 5
L1 2mm 3mm etc
Here specify the width of the columns as many as you want..
then in the header/main area of the table, click create Table Line, Rowtype is L1, automatically 5 cells will come,In each cell create a text element, display the variable to be printed there. -
Pivot table with variables columns
I need a helo to pivot table with variable columns,
I have a pivot table :
SELECT a.*
FROM (SELECT codigo_aluno,nome_aluno , id_curso,dia FROM c_frequencia where dia like '201308%') PIVOT (sum(null) FOR dia IN ('20130805' ,'20130812','20130819','20130826')) a
but I need to run the select with values for dia , getting from a other table :
SELECT a.*
FROM (SELECT codigo_aluno,nome_aluno , id_curso,dia FROM c_frequencia where dia like '201308%') PIVOT (sum(null) FOR dia IN (
select dia from v_dia_mes )) a
thank youThe correct answer should be "Use the Pivoted Report Region Plugin".
But, as far as I know, nobody has created/posted that type of APEX plugin.
You may have to use a Basic Report (not an IR) so that you can use "Function returning SELECT" for your Source.
You would need two functions:
One that dynamically generates the Column Names
One that dynamically generates the SELECT statement
These should be in a PL/SQL Package so that the later can call the former to ensure that the column data matches the column names.
i.e. -- no 'SELECT *'
MK -
OID users ( EUS) problem with grant create table with admin
Hi,
We activated enterprise users in the OID.
There is a role APP_ADMIN that has the following grants:
create user
drop user
create table with admin option
this is for an application that creates BI schemas, so it needs to be able to create other users.
I have granted these to a local role, and the user has access to the local role, thanks to the OID setup.
The create and drop user work.
however, the grant create table to another user does not work.
Is there an issue with 'with admin option' grants in Enterprise user security?
Regards,
PeterIf I grant
grant create table to test_role with admin option;
it does not work
if I grant
GRANT GRANT ANY PRIVILEGE to test_role WITH ADMIN OPTION;
it does work.
The test command as user with test_role is:
grant create table to test_usr;
very strange!
If the user is a standard user and I create role test_role
and grant create table to test_role with admin option it works.
but if I convert the user to an EUS user and the same privilege is given to the role ( role is granted to a global role to an enterprise role)
it doesnt work
Edited by: Peter on Dec 7, 2012 2:36 PM -
Unable to create table with column default value with date interval
Please help to create table with calculated date defaullt value:
CREATE TABLE emp (
birth_date DATE DEFAULT sysdate + interval '3' day NOT NULL
or
CREATE TABLE emp (
some_date DATE,
birth_date DATE DEFAULT some_date NOT NULL
or
CREATE TABLE emp (
some_date DATE,
birth_date DATE DEFAULT some_date + interval '3' day NOT NULL
below syntax error:
TT1001: Syntax error in SQL statement before or at: "+"I'm afraid this is not possible; as per the SQL Reference, TimesTen only supports 'constant expressions' for the DEFAULT clause and none of these are constant expressions.
Chris -
Problem CREATE TABLE with PRIMARY KEY Still in Trouble ! Please Help!
Hi there !
I use the orcle 8i, and i don't know why i can't create table with any primary key EXample:
SQL> CREATE TABLE O_caisses
2 (No_caisse NUMBER(3) constraint caisses_pk PRIMARY KEY,
3 NB_BILLETS NUMBER(5)
4 )
5 /
CREATE TABLE O_caisses
ERROR at line 1:
ORA-18008: cannot find OUTLN schema
***********some Debuger show me this way: *********************
Well there r certain point u got to notice when creating a table with constraints.
1) U can create table with COLUMN level constraint.
2) U can create table with TABLE level constraint.
3) In COLUMN level constraint u can't give a constraint a name
but only mention the type of constraint.
4) In TABLE level constraint u can give a name to constraint.
Following are the examples of both
--COLUMN LEVEL
CREATE TABLE O_caisses
(No_caisse NUMBER(3) PRIMARY KEY,
NB_BILLETS NUMBER(5));
--TABLE LEVEL
CREATE TABLE O_caisses
(No_caisse NUMBER(3),
NB_BILLETS NUMBER(5),
constraint pk_caisse primary key (No_caisse));
********************And this is another one:*****************
SQL>grant create any outline to username;
BUT the problem is still present, i don't know what to do now !
Please could some body help me !
Thanks alot!
Luong.The clue is in the error message: the OUTLN schema is missing.
This is something Oracle 8i introduced to help manage the CBO (or soemthing equally geeky and internal). For some reason your database no longer has this user. It ought to be created automatically during installation (or upgrade) but catproct may not have completed probably or some over zealous admin type has dropped it.
Solution is to re-install (or re-upgrade) as you cannot create this user on their own. Alas.
HTH, APC -
How to create table with dynamic rows
Hi Ppl,
I have an array lets say with length of n. I want to creata table with 2 columns and no of rows = array length.
lets say array length is 3 ( array[0] = 1, array[1] = 2, array[2] = 3) so the table should have 2 columns and 3 rows.
After creation of table I want to display each array value in each row.
Can somebody help me in this asap.
Thanks \
AshishHi, Thanks for reply... actually this is one part of rtf. I have put values from xml to an array and now I want to create a table with no of rows = length of array. so here xml will not be useful. could you pls think of it without xml.
result is like
lets says below is the array
array[0] = a
array[1] = b
array[2] = c
array length = 3
so there should be a table of 2 coulmns and 3 rows. Second column of first row will show 'a', Second column of second row wil show 'b' and Second column of third row will show 'c'.
Hope this is useful.
Thakns
Ashish -
How to create table with table description
Hi,
I would like create table with table description(like creating package or procedure with comments).
Is it possible to achieve through oracle, if possible please help me how to achieve this.
Thanks and regards,
Ibrahim Sayyed.> create table test (col1 number);
> comment on table test is 'this is a comment';
> select comments from user_tab_comments where table_name = 'TEST';
COMMENTS
this is a comment -
How to create table with row type in smart forms
How to create table with row type in smart forms with out line type
please explain me the procedureHI,
A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
A table type is defined by:
its line type, that defines the structure and data type attributes of a line of the internal table
the options for managing and accessing the data ( access mode) in the internal table
the key ( key definition and key category) of the internal table
The row type is defined by directly entering the data type, length and number of decimal places or by referencing a data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type.
<b>for more info :</b> http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
Internal table
Regards
Sudheer -
How to create table with resizable row ?
how to create table with resizable row ?
I'd suggest you start here:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
Problem on CREATING TABLES with PRIMARY KEY
Hi there !
I use the orcle 8i, and i don't know why i can't create table with any primary key EXample:
SQL> CREATE TABLE O_caisses
2 (No_caisse NUMBER(3) constraint caisses_pk PRIMARY KEY,
3 NB_BILLETS NUMBER(5)
4 )
5 /
CREATE TABLE O_caisses
ERROR at line 1:
ORA-18008: cannot find OUTLN schema
Please could some body help me !
Thanks alot!
Luong.Luong,
Your syntax is fine. It looks like you don't have the correct database privileges to create the table. The error message you're getting suggests that you don't have CREATE ANY OUTLINE privileges. You should log in as a user than can grant these privileges and give yourself the correct privileges. I think the syntax is
SQL>grant create any outline to username;
Alison -
Sorting internal table with variable no of fields
Hi ,
I want to sort the internal table with variable no of fields . Every time the report is run the number of fields as well as the sequence by which the table has to be sorted changes . How to do this .
regardsHi,
Please try this.
DATA: BEGIN OF ITAB OCCURS 0,
F1(4),
END OF ITAB.
DATA: BEGIN OF ITAB2 OCCURS 0,
F1(1),
F2(1),
F3(4),
END OF ITAB2.
ITAB-F1 = '01AC'.
APPEND ITAB.
ITAB-F1 = '02AB'.
APPEND ITAB.
ITAB-F1 = '01CD'.
APPEND ITAB.
ITAB-F1 = '02CA'.
APPEND ITAB.
LOOP AT ITAB.
ITAB2-F1 = ITAB-F1+2(1).
ITAB2-F2 = ITAB-F1+3(1).
ITAB2-F3 = ITAB-F1.
APPEND ITAB2.
ENDLOOP.
SORT ITAB2 BY F1 ASCENDING
F2 DESCENDING.
LOOP AT ITAB2.
WRITE: / ITAB2-F3.
ENDLOOP.
REWARD POINTS IF HELPFUL -
How i can create table with data
How i can create table with data from dev to production?
How i can create table with data
[url=http://en.wikipedia.org/wiki/Black_Beast_of_Aa
aaarrrrrrggghhh]from dev to production?
[url=http://img2.travelblog.org/Photos/3800/14977/t
/64816-Col-Kurtz-0.jpg]The horror, the
horror.lol, you gonna scare somebody here.
Are we helping devil?
Maybe you are looking for
-
Crash report runs a long time after startup
Crash report runs for about 1-1/2 hour after startup.
-
Auto number form field for Adobe Acrobat 9 Standard?
I'm creating an online form using Adobe Acrobat 9 Standard and need to know how create an automatic sequential system for each form. For example, if a customer prints form 1 from the website, I need the next form to be tracked as form 2, and the next
-
Reasons to hold onto my Nokia 5800???
The battery ran out on my Nokia 5800 the other day and I had my old Nokia E51 spare and it was nearly charged up so I popped in my sim card and away I went, this only started me thinking why did I give up on my E51 for a Nokia 5800. My E51 has a scre
-
Smart forms - Dynamic sizing of the windows.
Hi gurus, iam working on smartforms, i have a problem. My requirement is: Printing a table data on the smart form. Is the window which prints this table data is resized with the amount of table data, if so, what is the procedure i should follow for t
-
Download and install drivers and patches Win XP host with Solaris 10 guest
Greetings. I would appreciate your help. Solaris 10 successfully installed as guest on Win XP host. (Using Parallels Workstation). Getting fatal IO error 146 (connection refused on Xserver "0.0" ... no screens found. Cannot bring up Xorg. Research st