Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Write text file with utl_file and file must meet certain rules

Started 1 month ago by user3357845
I have following problem and I can't figure out the best approach to solve this. I have a query that produces x number of lines and those lines must be written into a text file with utl_file. Sometimes the query produces a few lines and sometimes it can be several thousand lines. But there are several rules that must apply to that text file: 1. the ...
Site: www.oracle.com  www.oracle.com - site profile
Forum: SQL and PL/SQL   SQL and PL/SQL
 - forum profile
Total authors: 1331 author
Total thread posts: 17 posts
Thread activity: 2,135 new posts during last week
Domain info for: oracle.com

Other posts in this thread:

user8672860 replied 4 months, 2 weeks ago
Hi All, I have a java program that selects all rows from a table and also dynamically creates an order by clause that should be used with the table. However one of the tables has a columns named "ROW" and selecting this column results in ORA-00936: missing expression error. Is ROW a reserve word in oracle?

user8672860 replied 4 months, 2 weeks ago
Any help will be highly appreciated.

user8672860 replied 4 months, 2 weeks ago
The problem is I am doing a select * from <table-name>. I won't be able to use that particular column in the select.

user8672860 replied 4 months, 2 weeks ago
The program actaully calculates checksum of all the tables in the database, hence, I am looping through a list of all the tables one by one and calculating the checksum. The problem is, I need to sort the data in the tables using the order by clause to give me consistent results accross different database servers. hence - I am firing a query that gives...

Florian W. replied 4 months, 2 weeks ago
Dear yogeshyl! OK, Let's try this step by step. I assume that you want to use Oracle in a version above 9i R2. -- Please change the size x to a value that fits your needs. Every tablespace needs a datafile. -- Please change <path_and_filename>.dbf to something like C:\oracle\oradata\ORCL\primary01.dbf. CREATE TABLESPACE primary DATAFILE '<path_and_...

Alex Nuijten replied 4 months, 2 weeks ago
Florian W. wrote: CREATE TABLE GradeMaster( ID int NULL, Name varchar(25) NULL, Description varchar(25) NULL, From float NULL, To float NULL, CONSTRAINT PK_GradeMaster_ID UNIQUE NONCLUSTERED ( ID ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON PRIMARY ) ON PRIMARY END I don't know which version you're using, but the above is not...

Florian W. replied 4 months, 2 weeks ago
Hi Alex Nuijten! Did you have a bad day? Please cool down and wait a little bit. I will take some time to translate the whole code. Your sincerely Florian W.

user8652681 replied 4 months, 2 weeks ago
i want to insert a new row and make the user_id one greater than the last user_id. anyone any ideas

blushadow replied 4 months, 2 weeks ago
Depends on your usage. If you can guarantee that only one user of the application can create new users then you could simply use: select max(user_id)+1 into new_user_id from mytable; insert into mytable values (new_user_id, ....) However, in most environments you have to cater for concurrent usage by multiple users, and therefore you would ...

karthick_arp replied 4 months, 2 weeks ago
Create a sequence. Set the Start Value as the current user_id. In future use the sequence to generate User_ID

 

Top contributing authors

Name
Posts
hoek
481
user's latest post:
Sequences with tables
Published (2009-12-10 12:04:00)
what meaning for CG$? Case-Generator. If I recall well: 'C'omputer 'A'ided 'S'ystem 'E'ngineering -&gt; Designer 'G'enerates it. It's a 'Designer-ism'. And I still think you're using Headstart as well...but I might be wrong.
Frank Kulash
470
user's latest post:
Query Help
Published (2009-12-10 18:32:00)
Hi, Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful. Don't forget to post the results you want from that data. Sorry, it's not at all clear from your description. To find the latest shipmentdate in the current month or any of the 10 previous months: MAX ( CASE WHEN shipmentdate &gt;= TRUNC ( ADD_MONTHS (SYSDATE, -10) , 'MONTH' ) AND shipmentdate &lt; TRUNC ( ADD_MONTHS (SYSDATE,...
Massimo Ruocchio
362
user's latest post:
Inline Query
Published (2009-12-11 03:52:00)
Change this way: and QUOTD_QUOTH_no(+) = 7 Max
Solomon Yakobson
359
user's latest post:
SQL plis help avg
Published (2009-12-10 18:37:00)
user8865857 wrote: I want just one on the top corner . how Can I do this ? Top left or top right? Please post desired output. From where you know polish word? Ja nie rozmawia ale rozumiem. SY.
Alex Nuijten
307
user's latest post:
Converting SQL into PL/SQL
Published (2009-12-11 03:48:00)
"Trying to understand what you want to achieve with this query...." Explain what you're doing.... Post sample data... Explain what the difficulty is... ... or maybe start yet another thread with the same, obscure question...
Buga
304
user's latest post:
Problem while retriving a value...
Published (2009-12-03 06:43:00)
Deleted.... Cheers!!! Bhushan Edited by: Buga on Dec 3, 2009 3:44 PM
Centinul
244
user's latest post:
recreate index
Published (2009-12-08 04:57:00)
I recommend reading the links below and gathering the data while it's "slow" and when it's "fast" and posting it here. When your query takes too long ... HOW TO: Post a SQL statement tuning request - template posting
karthick_arp
209
user's latest post:
Can we use TCL(commit, rollback)...
Published (2009-12-10 09:19:00)
Read the oracle document. But dont forget to remember that its a very sharp knife. Use it carefully. Read the link provided above.
Justin Cave
208
user's latest post:
Materialized view - Automatic...
Published (2009-12-11 01:40:00)
1) Your NEXT definition is incorrect. If you want the refresh to happen every day at 1:00 PM, you'd want TRUNC(sysdate+1) + 13/24. SYSDATE + 13/24 is 13 hours later, so you'd have refreshes at 1 PM, 2 AM, 3 PM, 4 AM, etc. 2) When you query DBA_JOBS for this job, what do you see for NEXT_DATE, NEXT_SEC, LAST_DATE, LAST_SEC, FAILURES, and BROKEN? Justin
Peter Gjelstrup
168
user's latest post:
How retrieve the number of days...
Published (2009-12-10 04:47:00)
Hi Alex, Maybe select trunc(36/12)/2 from dual Full example: SQL&gt; with your_data as (select 10 x from dual union all select 12 x from dual union all select 24 x from dual union all select 25 x from dual union all select 34 x from dual union all select 36 x from dual union all select 37 x from dual union all select 72 x from dual union all select 70 x from dual) -- end of test data select x, trunc(x/12)/2 number_of_days from your_data...

Related threads on "www.oracle.com":

Related threads on other sites:

Thread profile page for "Write text file with utl_file and file must meet certain rules" on http://www.oracle.com. This report page is a snippet summary view from a single thread "Write text file with utl_file and file must meet certain rules", located on the Message Board at http://www.oracle.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity