File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes creating table and  appending current date in table name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "creating table and  appending current date in table name" Watch "creating table and  appending current date in table name" New topic
Author

creating table and appending current date in table name

nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
Hi ,

Iam using below code to creating table and appending current date in table name,But it's giving error :

COLUMN today_col NEW_VALUE today;
SELECT TO_CHAR ( SYSDATE, 'DDMMYYYY') AS today_col FROM dual;
CREATE TABLE VALID_NUMBE_&today AS (SELECT * FROM VALID_NUMBER);

it giving error "object allready exist"
Please guide hw we can clear the variable value before declaring.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Please do take out time to CarefullyChooseOneForum
This forum is for Tomcat questions. Moving...


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

I personally would use PL/SQL, not SQL*plus scripts, for this kind of functionality. Probably a stored procedure that would check that the table doesn't exist yet and then created it. The SQL*plus scripting language makes it quite difficult to correctly catch and handle all kinds of possible errors.

In Oracle, it is not quite common to create daily tables. Partitioning is usually used for that, which allows practically the same functionality without exposing the fact that the table is physically organized on daily basis to the application(s). However, partitioning is a feature that has to be bought extra, you can see whether it is supported in your database by running:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating table and appending current date in table name