Sequence number problem in control file
hI,
I have table called mast_route which contains route,seq_no fields.
I need to load the data using sql loader.while loading i have to reset the sequence based on the route.
that means whenevr a different route is encountered the sequence number should be set 1.
I have to load the data as shown below.
ROUTE SEQ_NO
10B, 1
10B, 2
10B, 3
10B, 4
10B, 5
10B, 6
10B, 7
10B, 8
10B, 9
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10C, 1
10C, 2
10C, 3
10C, 4
10C, 5
10C, 6
10C, 7
10C, 8
10C, 9
10C, 1
10D, 1
10D, 2
I used the following loader script,but its not working
load data
infile 'routedest_master.csv'
append into table mast_route
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
( route,
seq_no ?? here i need to insert the sequence number based on route ,
any idea pls
cheers
RRK
hi,
I have another field called "Destination" in my table.
under one route there may be several destinations.
Here the sequence number indicates the unique destination number under a route.
the sample data looks as follws.
ROUTE, DEST, SEQ_NO
10B, 204, 1
10B, 223, 2
10B, 242, 3
10B, 290, 4
10B, 303, 5
10B, 513, 6
10B, 521, 7
10B, 539, 8
10B, 577, 9
10B, 60,1 0
10B, 626, 11
10B, 725, 12
10B, 839, 13
10C, 1011, 1
10C, 369, 2
10C, 377, 3
10C, 384, 4
10C, 388, 5
10C, 56, 6
10C, 689, 7
10C, 87, 8
10C, 888, 9
10D, 354, 1
10D, 360, 2
10D, 398, 3
10D, 495, 4
10D, 501, 5
10D, 66, 6
10D, 66, 7
10D, 765, 8
10D, 765, 9
10D, 837, 10
10D, 899, 11
10D, 906, 12
10E, 205, 1
10E, 306 2
10E, 34, 3
10E, 348 ,4
I guess ,now u can understand the prob.
cheers
RRK
Similar Messages
-
Our requirement is to generate file sequence number using FTP adaptor so that we acheive the following pattern
for eg.,
VAP001.xml
VAP002.xml
VAP003.xml
VAP010.xml
VAP011.xml
i.e., the sequence number will be a fixed length and it should be lpadded with zeroes.
We tried to the following
VAP%SEQ%.xml
then BPEL generated as
VAP1.xml
VAP2.xml
VAP10.xml
We also tried this i.e.,
VAP00%SEQ%.xml
bpel generated
VAP001.xml
VAP002.xml
VAP0010.xml
Pls guide us with a solution. THis is very urgent and important for our business.
RegardsOur requirement is to generate file sequence number using FTP adaptor so that we acheive the following pattern
for eg.,
VAP001.xml
VAP002.xml
VAP003.xml
VAP010.xml
VAP011.xml
i.e., the sequence number will be a fixed length and it should be lpadded with zeroes.
We tried to the following
VAP%SEQ%.xml
then BPEL generated as
VAP1.xml
VAP2.xml
VAP10.xml
We also tried this i.e.,
VAP00%SEQ%.xml
bpel generated
VAP001.xml
VAP002.xml
VAP0010.xml
Pls guide us with a solution. THis is very urgent and important for our business.
Regards -
Sequence Number problem.
I have situation like this:
I am creating text files from a procedure and i am making FILE NAME as follows.
v_file_name := v_document_code || '_' || p_printer_id || '_' || p_quote_ref_id || '_' || v_reference_id;
All above values i have in my procedure, now i need to insert a sequence number ( or a Auto Number thing) for a file such that everytime when any file created it should have a different number.
I tried sequence number concept but i am not getting any result.
I have made a sequence SEQ_DAT_FILE_NUMBER and used it as follows
v_file_number := ' SELECT SEQ_DAT_FILE_NUMBER.NEXTVAL '
|| ' FROM DUAL ' ;
v_file_name := v_file_number || '_' || v_document_code || '_' || p_printer_id || '_' || p_quote_ref_id || '_' || v_reference_id;
but i didn't get any result.
Please provide any information to solve this problem.
Thanks in Advance.
Regards,
AgrawalVif you didn't get any result, what you have got.... i mean an error or an worng output or what....
there seems to be no problem in the code, except the method of fetching the sequence number in the variable,
v_file_number := ' SELECT SEQ_DAT_FILE_NUMBER.NEXTVAL '
|| ' FROM DUAL ' ; rather do like this:
SELECT SEQ_DAT_FILE_NUMBER.NEXTVAL INTO v_file_number FROM DUAL; -
File sequence number in a Flat file
Hi,
I am working on Idoc to file scenario wherein my output file will have a sequence number assigned to each level.
there are 4 levels and hence 4 sequence number to be genearted and its values should also have the same sequence number.
i am doing this just by using Counter function.
But when i am getting a multiple detail records, for each detail record(0040) level its keep incrementing.but it should have the same value what its level has.
for ex:
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000002 8765 6532 200 45 10 WE 20 AG
0040 00000003 8765 6532 200 45 10 WE 20 AG
0040 00000004 8765 6532 200 45 10 WE 20 AG
9999 99999999
It has to be like this.
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
9999 99999999
Can someone help me in achieving this.
RegardsHi there,
Just to try out from a different view, the following case could be implemented if the pre-requiisites are satisfied:
Pre-requisites:
1) The element that carries a primary factor, let us say, '8765' from your example.
2) Functionally there is an element in your header item that relates the line items under it.
My understanding of your example:
1) Line items present for 00, 10, 40
2) Line item 30 absent in the series
Proposal:
Map source field (the one that is arelating factor, here the one that carries '8765') -> INDEX (start by 0, increment by 1) -> multiply by one.
INDEX standard function property: Donot Reset for every context;
Srikanth Srinivasan
Edited by: Srikanth Srinivasan on Jan 10, 2011 11:02 AM -
Problems creating control file in RMAN duplicate database
There is so much detail involved in this operation that I don't know what might be useful, so I'll start simple. I'm attempting to clone a database on the same host using RMAN "duplicate database". I finally got all the setup done, the OS authentication hurdles hurdled, etc. and entered the command:
duplicate target database to COPYCH2M until time "to_date('March 15 2012 12:00:00', 'Mon DD YYYY HH24:MI:SS')";
The first time I got:
ORA-19504: failed to create file "/u01/app/oracle/oradata/COPYCH2M/control01.ctl"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
There was nothing in the Oracle instructions about manually creating the directory, but I did so, thinking that might be the problem. And it created the control files! But then I got the following:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 05/21/2012 15:59:25
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-00201: control file version 11.2.0.0.0 incompatible with ORACLE version 11.1.0.1.0
ORA-00202: control file: '/u01/app/oracle/oradata/COPYCH2M/control01.ctl'
Sounds straightforward, if frustrating, right? Apparently you can't duplicate a database that's not in the exact same version. But:
1) The backuppiece we got the control file from was from last November.
2) The version of Oracle has not been updated since that time.
How can a file created by this version be incompatible with this version? Where is it even getting 11.1?
Thanks, I'm hoping this is easy but I can post more info if needed.>
There was nothing in the Oracle instructions about manually creating the directory, but I did so, thinking that might be the problem. And it created the control files! But then I got the following:
>
The database is limited as to what it can create. Since you defined where you wanted the controlfiles to go (pfile/spfile), it's up to you to make sure the directory is valid and exists. :)
>
How can a file created by this version be incompatible with this version? Where is it even getting 11.1?
>
As for your controlfiles, make sure the compatible parameter is set the same on both the source and the target unless you are using the default (11.1.0.1 for you, and you aren't)
Keep going, you'll get there. RMAN duplicate is a great feature.
Good luck. -
Problems creating control file (duplicated database)
Hello,
We're duplicated database but some datafiles weren't added on controlfile creation script, so I need to recreate controlfiles again with missed data files.
I launched controlfile creation script but I get the following error:
Oracle Server Manager Release 3.1.7.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.4.0 - 64bit Production
SVRMGR> connect internal
Connected.
SVRMGR> @inicio.sql
CREATE CONTROLFILE REUSE SET DATABASE "SPT" RESETLOGS NOARCHIVELOG
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name SPC in file header does not match given name of SPT
ORA-01110: data file 205: '/oracle/SPT/sapdata8/user2d_1/user2d.data1'
SVRMGR>
Problems are just with missed datafiles.
Should I REUSE or just SET database?
Thanks in advance for your help.
Regards,
Carles>
There was nothing in the Oracle instructions about manually creating the directory, but I did so, thinking that might be the problem. And it created the control files! But then I got the following:
>
The database is limited as to what it can create. Since you defined where you wanted the controlfiles to go (pfile/spfile), it's up to you to make sure the directory is valid and exists. :)
>
How can a file created by this version be incompatible with this version? Where is it even getting 11.1?
>
As for your controlfiles, make sure the compatible parameter is set the same on both the source and the target unless you are using the default (11.1.0.1 for you, and you aren't)
Keep going, you'll get there. RMAN duplicate is a great feature.
Good luck. -
Problem in control file created through LKM File to Oracle (SQLLDR)
I have a fixed file ABC.txt & it has three fields/columns of length ,C1:= 4, C2 :=10 & C3:=6 & I have to use LKM File to Oracle (SQLLDR) to load data into oracle target table.
I recieved the following error at step CALL SQLLDR in the KM
"org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
File "<string>", line 3, in ?"
Then I checked the control file log & found that the position start value & end value was not defined in control file which is created automatically by LKM
SQL*Loader-350: Syntax error at line 14.
Expecting positive integer, found ":".
C1_C1 POSITION(:), "
The control file created by ODI is & it's missing the position value.
OPTIONS (
SKIP=0,
ERRORS=0,
DIRECT=FALSE
LOAD DATA
INFILE "C:/SNAPON/EOL.txt"
BADFILE "C:/SNAPON/ABC.bad"
DISCARDFILE "C:/SNAPON/ABC.dsc"
DISCARDMAX 1
INTO TABLE SNAPON_W.C$_0ABC
C1_C1 POSITION(:),
C2_C2 POSITION(:),
C3_C3 POSITION(:)
Does any one know why the position value is not created in the control file .
Edited by: neeraj_singh on Mar 3, 2011 1:25 AMHi Neeraj,
It is happening because you have not selected the mapping execution area as STAGUING .
Open your interface , click on each and every column of your target datastore , make sure the "Execute On" is marked on "Staging Area".
Then run your interface.
Thanks,
Sutirtha -
hi all
i created two text items in form one for sequence number and other for non sequence, i want when i add 01 in non sequence item-text so the sequence number does not change and it should remain the same? is it possible plz help me out thanks in advance.
sarah
Edited by: SarahSarahSarah on Aug 30, 2009 12:37 AMhere is the code:
on key-commit trigger
begin
if
:ins1.EDNO is null
then
SELECT sarahseq.NEXTVAL INTO :ins1.serial FROM DUAL;
end if;
:ins1.branch1 := :ins1.branch;
:ins1.class1 := :ins1.class;
:ins1.year1 := :ins1.year;
:ins1.serial1 := :ins1.serial;
:ins1.cno1 := :ins1.cno;
:ins1.edno1 := :ins1.edno;
:global.data := :branch || ' ' || :class || ' ' || :year || ' ' || :serial || ' ' || :cno || ' ' || :edno;
commit_form;
call_form ( 'c:\temp\plate no.fmx', no_hide, no_replace, no_query_only );
END;
sarah -
How to Use Sequence created in Oracle Database in SQL Ldr Control file
Hi,
I created a sequence in oracle database. How will use the sequence in SQL loader Control file.
Thanks in advanceHi,
You might get a good response to your post in the forum dedicated to data movement , including SQL*Loader . You can find it here Export/Import/SQL Loader & External Tables
Regards, -
Can I call sequence from Control file( Sql Loader)
Plz help.As an option to what Warren suggested, you can also specify an actual sequence name in the control file itself.
LOAD DATA
INFILE datafile.dat
APPEND
INTO TABLE <table_name>
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(<column_name> CHAR,
<column_name> CHAR,
<column_name> "seq_name.nextval") -
Sqlloader control file when clause
Problem 1
Lets say, I have a table x with (f1 number(2), f2 varchar(14), f3 Number(1))
datafile1
10,ls
22,st
45,tanveer
77,cool
1,not cool
requirement is to insert the first 2 columns in f1 and f2 and insert 0 in f3 only
if f2 == tanveer
Problem 2
Table is y (f4 number (2), f5 varchar (16))
datafile2
ls,xxxx
tanveer,yyyy
cool,zzzz
not cool, mmmm
given the value of the first coloumn I would like to query table x
and find the corresponding value of f1 insert it to table y's column f4
and associated string to f5.
Please let me know how to write the control files for sqlloader.Problem 1:
-- control file:
LOAD DATA
INFILE 'DATAFILE1.DAT'
APPEND
INTO TABLE x
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(f1, f2,
f3 "DECODE (:f2, 'tanveer', 0, NULL)")
Problem 2:
Create another table z,
load the data into z,
insert into y selecting
from join of x and z:
-- create staging table:
CREATE TABLE z
(f6 VARCHAR2 (14),
f7 VARCHAR2 (16));
-- control file:
LOAD DATA
INFILE 'DATFILE2.DAT'
APPEND
INTO TABLE z
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(f6, f7)
-- insert:
INSERT INTO y (f4, f5)
SELECT x.f1, z.f7
FROM x, z
WHERE z.f6 = x.f2; -
Regarding sql loader --- can we have control file to do a check on csv?
Hi,
I normally get a csv having data as
column1 ;columnb;columnc;
13 ; 12 ; 13 ;
11 ;13 ;33;
as the table where it needs to go is say table
xys( a number, b number , c number).
so the control file is fairly simple ...
But from now I need to restrict data entry if the change in format happens in the csv
say if it is like
column2;column1;column3,
12,13;12;
11;13;14;
or say the csv like
column1;column2;column3;column4;
11;13;14;15;
111;134;14;12;
in both cases sql loader should not run and throw the error saying the reason in the log.
how do i manage it in the control file `???
any ideas???
it is urgent pls help !!!
regards
SHUBH
Message was edited by:
SHUBHTry changing the following properties:
autosubmit = true;
immediate = true;
Here is a link where the user uses a transient attribute for the rows in his table:
Technology on my way...:): ADF 11g : CheckBox Demo (Select one checkbox in table, Select all/Deselect all)
Hope that helps.
Regards,
Frederico. -
Function for column validation in SQl Loader control file.
Hello Gurus,
We have an requirement to create a function to validate all date and number columns in control file, and return 0/1 accordingly to valid_column which is last column . I have developed the function which accepts the number and date type columns as parameter and return Y/N. My question is, is there any way so that the function could be created without passing any parameter to it?
If yes, then how to call the function in control file?
I have been searching since a while on Google to find out any solution but could find out.
Using Oracle 11g Enterprise Edition Release 11.2.0.1.0
Thanks!
Edited by: Sush on Jul 5, 2012 2:23 AM
Edited by: Sush on Jul 5, 2012 4:16 AM
Edited by: Sush on Jul 5, 2012 7:28 AMHi Srini,
I have gone through this document and i couldn’t find out any solution. That’s why i was seeking help from you Gurus.
Thanks for your help, i think i have learnt few new things abt SQL Loader by studying this document :)
Thanks! -
Can Aperture Read the camera's sequential number metedata when naming files
Before I started using Aperture I would use this naming convention in Bridge to batch rename files and It works great because it avoids duplicate file names and the files are in sequential order
my last name(Blake)YYYYMMDDfour digit NON RESETTING sequential number, generated by my Nikon D2X. I don't have any duplicate file names unless I shoot more that 9999 images in one day.
Has anybody found the option to use the camera's generated sequence number in Aperture's file naming scheme. I sure can't. I know that you can set a four digit sequence but that sequence doesn't start where the sequence leaves off in the previous import.
Thanks
John
G4 Powerbook Mac OS X (10.4.8)I have two workarounds
1. Rename the files in bridge after like I have always done and then import the folder as an Aperture project without changing the file names. I use photo mechanic to download the files from the card.
2. Go to the library smart folders to see what was the last project I imported and check the four digit sequence before the file name extension. Set the sequential counter in Aperture to start at the next sequential number where the last file left off.
I have to use the four digit sequence instead of using the date and Time sequence. It is very convenient for my clients to give me the four digit sequence when telling me what images they want prints from,etc. Avoids any confusion.
I did request this feature of using the camera's generated file name in Apple's feedback link for future inhancements.
thanks for your responses
John
G4 Powerbook Mac OS X (10.4.8)
G4 Powerbook Mac OS X (10.4.8) -
Who writes LOG SEQUENCE NUMBER to CONTROL FILE,whether CKPT or LGWR process
I am in confusion that,
When log switch occurs that time Log sequence no. is generated by LGWR. then after who writes that LSN to CONTROL FILE whether Checkpoint or LGWR.
Please provide me proper answer with example.....I notice by using fuser on a controlfile on hp-ux, a number of processes keep the controlfile open. So it would make sense that the one that writes logs would write log sequence numbers to the controlfile too.
$ for z in `/usr/sbin/fuser control03.ctl|awk ' {x=split($0,args); for (i=2;i<=x;i++){print args[i]}}'`
do
ps -efx|grep $z|grep -v grep
done
control03.ctl: oooooooooo
oracle 27129 1 0 Sep 5 ? 12:15 ora_arc1_TPRD
oracle 27073 1 0 Sep 5 ? 52:45 ora_dbw0_TPRD
oracle 27127 1 0 Sep 5 ? 10:52 ora_arc0_TPRD
oracle 9485 1 0 Nov 3 ? 9:14 oracleTPRD (LOCAL=NO)
oracle 22395 1 0 08:36:22 ? 0:24 oracleTPRD (LOCAL=NO)
oracle 27075 1 0 Sep 5 ? 68:53 ora_lgwr_TPRD
oracle 22116 1 0 08:33:24 ? 1:06 oracleTPRD (LOCAL=NO)
oracle 27077 1 0 Sep 5 ? 41:05 ora_ckpt_TPRD
oracle 26510 1 0 Nov 30 ? 21:26 oracleTPRD (LOCAL=NO)
Maybe you are looking for
-
I'm running a mac server with half mac half pc. I got a new pc that is running Vista Business. I need to join it with our domain, but for the life of me it won't. I can see the other pc's when I go to network & sharing and I can access public drive,
-
Dear Gurus, I am working on a scenario where vendor master is triggered from SAP-XI--FTP. when i am posting the vendor master on FTP.. i am getting the xml output with prefix as below <ns0:VENDORID>0000100000</ns0:VENDORID>at each element in vendor
-
Start up issue after upgrading to OS X Yosemite 10.10
Recently i have updated to OS X Yosemite from Maverick. I am unable to start my system normally. I need to give CTRL+R all the time when i need to start. And at half way loading (below apple icon) it is taking long time(More than 20 mins). Then i am
-
I pull up Firefox and am blasted out of my socks by a huge orange fox. I hate that. I just want a page to pull up that has a search engine in the middle of the page so I can begin surfing. The fox is attention grabbing and annoying.
-
Problème avec ios7 sur iphone4
Bonjour, Mon iphone4 ne marche plus correctement depuis que j'ai chargé l'ios7, C'est une horreur il faut attendre de 10 à 30 secondes avant qu'il valide chaque saisie, autant dire que la saisie d'un texto relève du marathon. Que faire ? quelqu'un re