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 ...
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?
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...
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_...
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...
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.
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 ...
what meaning for CG$? Case-Generator. If I recall well: 'C'omputer 'A'ided 'S'ystem 'E'ngineering -> Designer 'G'enerates it. It's a 'Designer-ism'. And I still think you're using Headstart as well...but I might be wrong.
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 >= TRUNC ( ADD_MONTHS (SYSDATE, -10) , 'MONTH' ) AND shipmentdate < TRUNC ( ADD_MONTHS (SYSDATE,...
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.
"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...
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
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
Hi Alex, Maybe select trunc(36/12)/2 from dual Full example: SQL> 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...
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