Sign of an integer external
Hello,
I use an external table to load some signed amount. As a test, we loaded a file with field defined as integer external without the sign.
The data in the database is therefore positive.
What I want is that when this field is loaded , if the sign is not there (replace by a space), then the line should be rejected.
-55 -> -55
+55 -> 55
55 -> line rejected.
can we do that without having a specific field for the sign ?
This is a possibility only if the field is in VARCHAR2, which is not the case. My field is in INTEGER EXTERNAL and the aim is to reject the line in the .bad file if the sign is not there.
Similar Messages
-
Is there a BAPI function module which reverses the sign of an integer
Hi Friends,
Could u plz tell me a BAPI function module which can reverse the
sign of an integer ?
For example:
if i get the integer value in work area as <number> <sign> , i need to change it to <sign><number>.
i.e if i get the integer value in work area as "248-" ("-" indicates minus sign) to " -248 ".
i.e if i get the sign after the value , my requirement is to get the sign before the value.
The actual ABAP query is:
data: QTY_1 TYPE CHAR10,
QTY_2 TYPE CHAR10,
WA_DISTK_PORTLET-QUANTITY TYPE INT4.
QTY_1 = WA_DISTK_PORTLET-QUANTITY.
SEARCH QTY_1 FOR '-'.
IF SY-SUBRC = 0 AND SY-FDPOS <> 0.
SPLIT QTY_1 AT '-' INTO QTY_1 QTY_2.
CONDENSE QTY_1.
CONCATENATE '-' QTY_1 INTO QTY_1.
CONDENSE QTY_1.
ELSE.
CONDENSE QTY_1.
ENDIF.
CLEAR: WA_DISTK_PORTLET-QUANTITY.
MOVE : QTY_1 TO WA_DISTK_PORTLET-QUANTITY.
when i move this QTY_1 to work area quantity field The sign is coming after the numeric value.
Note: There is no possibility to change the datatype of quantity field.
I have tried my level best with 'CLOI_PUT_SIGN_IN_FRONT' function module.
I will assign full points to the correct function module.Hi Ram,
try this ang look into fields.
data: fields type table of SVAL with header line.
fields-tabname = 'MARA'. fields-fieldname = 'MATNR'. append fields.
fields-tabname = 'BKPF'. fields-fieldname = 'BUDAT'. append fields.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
POPUP_TITLE = 'Value Insert'
TABLES
FIELDS = fields.
Regards, Dieter -
Can you use a self signed certificate on an external Edge Server interface?
Hi,
I have a small lab deployment for evaluation purposes. The Lync FE server works great for internal users. I have now added an Edge server. For the internal interface, I have a self signed certificate from our internal CA. (no problem there) For the external
interface, I have a self signed certificate from our own external CA. I have installed the cert on the client machine of the external user and installed it for trusted operation. I have used the RUCT and digicert tools to prove that the external self signed
cert is valid (root and intermediate have been checked for validity).
At first, when logging in from the Lync 2013 client on the external users machine, I would get an error from Lync about the cert being untrusted. I have now fixed that error by adding it as trusted. At this point, there are no errors or warnings in the Event
Viewer (in the application or system logs) However, I receive the following error from the Lync client, "Were having trouble connecting to the server... blah, blah".
Here is my question. Does the Microsoft Lync 2013 client and/or the "testconnectivity.microsoft.com" tool specifically prevent or forbid the use of self signed certificates on the external interface of an Edge server? They seem too.
I can tell if the certificate is my problem or something else. Any ideas on how to trouble shoot this?
ThxDrago,
Thanks for all your help. I got it working.
My problem with the Lync client error, "Were having trouble connecting to the server... blah, blah", was NOT a certificate error. It was a problem with my Lync Server Topology. (My sip default domain needed to match my user login domain.)
Let me update everyone about self-signed certificates:
YES, you can self-sign a certificate on your external edge server. It is a pain, but possible.
I have a self signed certificate from our own external CA. I have installed the cert on the client machine of the external user for trusted operation. I have used the RUCT and digicert tools to prove that the external self signed cert is valid (root and
intermediate have been checked for validity).
Here are my notes:
Create/enable your own external Certificate Authority (CA) running on a server with internet access.
On the Lync Edge Server, run the "Lync Server 2013 - Development Wizard".
Click "Install or Update Lync Server System". (Lync will automatically determine its deployment state)
You should have already completed: Step1 and Step 2.
Run or Run Again "Step 3: Request, Install or Assign Certificates".
Install the "Edge internal" certificate.
Click "Request" button to run the "Certificate Request" wizard.
You use can "Send the request immediately to an online certificate authority" option to connect to your internal CA, and create the certificate.
Once the certificate has been created, use "Import Certificate" to import it.
Once imported, on the Edge Server, go to: (Control Panel -> Administrative Tools -> Internet Information Services (ISS) Manager -> Server Certificates -> Complete Certificate Request...
In the Lync deployment wizard - Certificate Wizard, "Assign the newly imported "edge internal" certificate.
Install the "Edge External" certificate (public Internet).
Click the "Request" button to run the "Certificate Request" wizard.
Press "next"
Select "Prepare the request now, but send it later (offline certificate request).
Supply the "Certificate Request File" name and location. (You will need the file later. It should have the file extension ".req").
Click next on the "Specify Alternate Certificate Template". (which means you are using the default options)
Give it a Friendly Name. Bit Length = 2048. I selected "Mark the certificate's private key as exportable" option.
Fill in the organization info.
Fill in the Geographical Information.
The wizard should automatically fill-in the "Subject name:" and "subject alternative name:' fields.
Select your "Configured SIP domains"
"Configure Additional Subject Alternative Names" if you want. Otherwise, next.
Verify the "certificate Request Summary". Click next.
Run the wizard script to "Complete". The wizard will create a file containing the certificate request with the file extension ".req". (Let's assume the file name is "myCert.req")
Move your myCert.req file to your external CA. Have your CA issue the cert (based on myCert.req) and export the new cert to a file. I save it as a P7B certificate. (Let's call it "ExternalCert.p7b")
In the Lync Deployment wizard - Certificate Wizard, click on "Import Certificate" for ExternalCert.p7b.
Once imported, on the Edge Server, go to: (Control Panel -> Administrative Tools -> Internet Information Services (ISS) Manager -> Server Certificates -> Complete Certificate Request... (assign it a friendly name. Let's say "EXTERNAL-EDGE")
For the "External Edge certificate (public Internet), click "Assign".
The "Certificate Assignment" wizard will run.
Click next.
From the list, select your cert "EXTERNAL-EDGE".
Finish the wizard to "complete".
You are finished on the server.
Move the "ExternalCert.p7b" file to the machine running the lync client. Install the cert via the "Certificate Import Wizard".
When installing it to a particular Certificate Store, select the "Place all certificates in the following store" option.
Browse
Select "Trusted Root Certification Authorities"
Finish the wizard. -
I have gone through multiple forums and just about everyone states install the Root CA on the machine trying to connect.
I have installed the Root CA on this machine as it is not on the domain and is not inside the domain. It is installed in the Trusted Root CA folder.
I run the test connectivity microsoft tester and this is what i receive:
Testing remote connectivity to Microsoft Lync server through the Lync Access Edge server sip.netrixit.com on port 5061 to verify user [email protected] can connect remotely.
Specified remote connectivity test(s) to Microsoft Lync server failed. See details below for specific failure reasons.
<label for="testSelectWizard_ctl12_ctl06_ctl03_tmmArrow">Tell
me more about this issue and how to resolve it</label>
Additional Details
Couldn't sign in. Error: Error Message: Unknown error (0x80131500).
Error Type: TlsFailureException
Any insight would be helpful.Here is certificate you have your edge server external interface for sip.netrixit.com
Common name: *.netrixit.com
SANs: *.netrixit.com, netrixit.com
Valid from January 30, 2014 to January 30, 2015
Issuer: Go Daddy Secure Certification Authority
As per Wildcard certificate support in Lync Server 2013
http://technet.microsoft.com/en-us/library/hh202161.aspx
Server roles that are not support for WildCard Certificate
Internal server roles (including, but not limited to the Mediation Server, Archiving and Monitoring Server, Survivable Branch Appliance, or Survivable Branch Server)
External Edge Server interfaces
Internal Edge Server
Please change the certificate on edge server external interface
Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer"
Regards Edwin Anthony Joseph -
Can anybody please tell me what is escapse sign ( check box) external data
Hi ,
Can anybody please tell me , What is Escape Sign (check Box) in external data tab in infopackage
Thanks
PPHi PP,
If you are loading data from an Excel CSV file, specify the data separator and the escape character.
Specify the separator that your file uses to divide the fields in the Data Separator field.
If the data separator character is a part of the value, the file indicates this by enclosing the value in particular start and end characters. Enter these start and end characters in the Escape Charactersfield.
Example:
You chose the; character as the data separator. However, your file contains the value 12;45 for a field. If you set u201C as the escape character, the value in the file must be u201C12;45u201D so that 12;45 is loaded into BI. The complete value that you want to transfer has to be enclosed by the escape characters.
If the escape characters do not enclose the value but are used within the value, the system interprets the escape characters as a normal part of the value. If you have specified u201C as the escape character, the value 12u201D45 is transferred as 12u201D45 and 12u201D45u201D is transferred as 12u201D45u201D.
Hope this information helps u.........
Assigning Points is the way of saying Thanks in SDN
Regards
Ramakrishna Kamurthy -
Iteration a signed integer and not an unsigned integer, why?
i was just wondering if there is a reason for keeping the iteration variable/indicator of a loop a signed 32 bit integer.
it is never going to take a negative value.. then why signed; unsigned could have served the purpose
Message Edited by Ujjval Shah on 07-08-2009 09:21 AM
Solved!
Go to Solution.Remember that array sizes are limited to I32 (the "size" input to initialize array is I32, the output of Array size is I32, etc), so running a FOR loop more than 2^21 times is not even possible (N is also I32).
While loops can of course run forever, so if you need to increment a counter more than 2^31 times, you can use a shift register with U64, for example. However, don't even try to autoindex an output tunnel of such a loop, you're almost guaranteed to run out of memory before you reach the limits of I32.
Using array indices as I32 has several advantages. For example sometimes you need an invalid index (Integers don't have NaN!), so having a negative number is very useful. For example if you use "search array" and no match is found, the output is -1.
I suspect in the very long run these things will change. In another decade, all OSs will be 64bit or more and RAM will be mesured in TB. LabVIEW will need to evolve too to keep up.
LabVIEW Champion . Do more with less code and in less time . -
Sqlloader to_number - signed numbers
We have a sqlloader control file that will sucessfully load signed numbers coming from mainframe into oracle table using the following:
Amount POSITION (68:78) "to_number(:Amount, '9999999.99MI')")
for a COBOL FD:
05 COST-AMOUNT-OUT PIC 9(7).99.
05 COST-AMT-SIGN-OUT PIC X.
Now they come to us with the following new COBOL FD:
05 COST-AMOUNT-SIGN-OUT PIC X(01).
05 FILLER PIC X(01) VALUE ';'.
05 COST-AMOUNT-OUT PIC 9(17).
The sign preceeds the number, but there is this pesky semicolon that is part of a new "It is a semicolon delimited TSO text file" format.
Any ideas about how to get this into the database column -
AMOUNT NUMBER(15,2)
Any suggestions will be greatly appreciatedHello,
Can you post your sqlldr control file? You said now it's semicolon delimited TSO text file format or ";" just at the very end of amount field.
If is ';' delimited then you need to change your sqlldr control file, see if this example helps you out.
load data
Truncate into table employee
fields terminated by ";"
optionally enclosed by '"'
TRAILING NULLCOLS
empId INTEGER EXTERNAL,
FName char(20),
LName char(20),
FullName char(30)
{code}
If that's not the case then you can write simple function to strip off ';' from the field
Regards -
Hi,
I am using OWB 10.1.0.2 and using the file module. In the flat file structure i want to pick the data type -
INTEGER(8) however it has no Integer type but has INTEGER EXTERNAL.
I want to use INTEGER(8) how can I use it. OWB dows have that type in file mod.
Thanks
HBNo Integer & Integer External are not the SAME.
INTEGER specifies binary data, while INTEGER EXTERNAL specifies character data that represents a number. I am loading Large Binary data.
So basically, INTEGER(n) is full-word binary integer, where n is an optionally supplied length of 1, 2, 4, or 8. Other imp thing is by default, INTEGER is treated as a SIGNED quantity
When using the INTEGER(8) - it instruct SQL*Loader to process the integers as 8-byte quantities, as oppose to the default 4-byte quantities. Integer(8) support was introduced in Oracle 9i.
So basically I need - INTEGER(8) to process large binary integers I8 and I don't see them in OWB 10.
Any help is appreciated.
Thanks
Harman -
SSO to external website from portal
We want to do a single sign on to an external website (non-sap). I know for SAP we can do a logontickets. But for non-sap external websites are there ways to do a SSO? Please help.
please don't cross-post, see SSO to external website from portal
kr, achim -
Using MISSING FIELD VALUES ARE NULL for external table
I want to place a null for values missing in the sub_account field. Here is my external table:
CREATE OR REPLACE DIRECTORY INCOMING_ORDERS_log_dir
AS 'c:\starpubs\starpubs\dataformats\logs\INCOMING_ORDERS\log';
CREATE OR REPLACE DIRECTORY INCOMING_ORDERS_bad_dir
AS 'c:\starpubs\starpubs\dataformats\logs\INCOMING_ORDERS\bad';
create table ext_INCOMING_ORDERS_table (
Account varchar(5),
Sub_Account varchar(1),
Override_Code varchar(1),
Nomenclature varchar(28),
chg_nbr varchar(3),
quantity integer,
U_I varchar(5),
zipcode varchar(5),
type_reject varchar(2)
organization external
type oracle_loader
default directory user_dir
access parameters
records delimited by newline
missing field values are null
badfile INCOMING_ORDERS_bad_dir:'INCOMING_ORDERS%a_%p.bad'
logfile INCOMING_ORDERS_log_dir:'INCOMING_ORDERS%a_%p.log'
fields
Account(1:5) char(5),
Sub_Account(7:7) char(1),
Override_Code(10:10) char(1),
Nomenclature(11:38) char(28),
chg_nbr(40:42) char(3),
quantity(44:48) integer external,
U_I(50:54) char(5),
zipcode(56:60) char(5),
type_reject(61:62) char(2)
location('PTCLICK.MANUAL.NOMEN.TXT','PTCLICK.ORDERS.TXT', 'EUR_RES.TXT', 'MQ.TXT', 'BPRO.TXT')
reject limit unlimited;
How can I place the MISSING FIELD VALUES ARE NULL for missing values for the sub_account?made the change I received this error:
SQL> select * from ext_INCOMING_ORDERS_table;
select * from ext_INCOMING_ORDERS_table
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "no": expecting one of: "comma, date_format,
defaultif, enclosed, ltrim, lrtrim, ldrtrim, notrim, nullif, optionally, ),
rtrim, terminated"
KUP-01007: at line 7 column 26
CREATE OR REPLACE DIRECTORY INCOMING_ORDERS_log_dir
AS 'c:\starpubs\starpubs\dataformats\logs\INCOMING_ORDERS\log';
CREATE OR REPLACE DIRECTORY INCOMING_ORDERS_bad_dir
AS 'c:\starpubs\starpubs\dataformats\logs\INCOMING_ORDERS\bad';
create table ext_INCOMING_ORDERS_table (
Account varchar(5),
Sub_Account varchar(1),
Override_Code varchar(1),
Nomenclature varchar(28),
chg_nbr varchar(3),
quantity integer,
U_I varchar(5),
zipcode varchar(5),
type_reject varchar(2)
organization external
type oracle_loader
default directory user_dir
access parameters
records delimited by newline
badfile INCOMING_ORDERS_bad_dir:'INCOMING_ORDERS%a_%p.bad'
logfile INCOMING_ORDERS_log_dir:'INCOMING_ORDERS%a_%p.log'
fields
Account(1:5) char(5),
Sub_Account(7:7) char(1) NO PRESERVE BLANKS,
Override_Code(10:10) char(1),
Nomenclature(11:38) char(28),
chg_nbr(40:42) char(3),
quantity(44:48) integer external,
U_I(50:54) char(5),
zipcode(56:60) char(5),
type_reject(61:62) char(2)
location('PTCLICK.MANUAL.NOMEN.TXT','PTCLICK.ORDERS.TXT', 'EUR_RES.TXT', 'MQ.TXT', 'BPRO.TXT')
reject limit unlimited; -
How to read specific lines from a text file using external table or any other method?
Hi,
I have a text file with delimited data, I have to pick only odd number rows and load into a table...
Ex:
row1: 1,2,2,3,3,34,4,4,4,5,5,5,,,5 ( have to load only this row)
row2: 8,9,878,78,657,575,7,5,,,7,7
Hope this is enough..
I am using Oracle 11.2.0 version...
ThanksThere are various ways to do this. I would be inclined to use SQL*Loader. That way you can load it from the client or the server and you can use a SQL*Loader sequence to preserve the row order in the text file. I would load the whole row as a varray into a staging table, then use the TABLE and MOD functions to load the individual numbers from only the odd rows. Please see the demonstration below.
SCOTT@orcl12c> HOST TYPE text_file.csv
1,2,2,3,3,34,4,4,4,5,5,5,,,5
8,9,878,78,657,575,7,5,,,7,7
101,201
102,202
SCOTT@orcl12c> HOST TYPE test.ctl
LOAD DATA
INFILE text_file.csv
INTO TABLE staging
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(whole_row VARRAY TERMINATED BY '/n' (x INTEGER EXTERNAL),
rn SEQUENCE)
SCOTT@orcl12c> CREATE TABLE staging
2 (rn NUMBER,
3 whole_row SYS.OdciNumberList)
4 /
Table created.
SCOTT@orcl12c> HOST SQLLDR scott/tiger CONTROL=test.ctl LOG=test.log
SQL*Loader: Release 12.1.0.1.0 - Production on Tue Aug 27 13:48:37 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
Path used: Conventional
Commit point reached - logical record count 4
Table STAGING:
4 Rows successfully loaded.
Check the log file:
test.log
for more information about the load.
SCOTT@orcl12c> CREATE TABLE a_table
2 (rn NUMBER,
3 data NUMBER)
4 /
Table created.
SCOTT@orcl12c> INSERT INTO a_table (rn, data)
2 SELECT s.rn,
3 t.COLUMN_VALUE data
4 FROM staging s,
5 TABLE (s.whole_row) t
6 WHERE MOD (rn, 2) != 0
7 /
17 rows created.
SCOTT@orcl12c> SELECT * FROM a_table
2 /
RN DATA
1 1
1 2
1 2
1 3
1 3
1 34
1 4
1 4
1 4
1 5
1 5
1 5
1
1
1 5
3 101
3 201
17 rows selected. -
External Table - Issues With Special Character.
I have an external table that reads from a fixed length file. The file is expected to contain special characters. In my case the word containing special character is "Göteborg". Because "ö" is a special character, looks like Oracle is considering it as 2 bytes. That causes the trouble. The subsequent fields in the files get shifted by 1 byte thereby messing up the data. Has anyone faced the issue before. So far we have tried the following solution:
Changed the value of NLS_LANG to AMERICAN_AMERICA.WE8ISO8859P1
Tried Setting the Database Character set to UTF-8
Tried changing the NLS_LENGTH_SYMMANTIC to CHAR instead of BYTE using ALTER SYSTEM
Tried changing the External table characterset to: AL32UTF8
Tried changing the External table characterset to: UTF-8
Nothing works. Other details include:
• File is UTF-8 encoded
• Operating System : RHEL
• Database: Oracle 11gR2
Any thing else that I might be missing? Any help will be appreciated. Thanks in advance!
GaneshCREATE TABLE "APP_XXX_XX_XXXX"(
"KEY_NO" NUMBER,
"XXX_XXX_XXXXX" VARCHAR2(1 CHAR),
"XXX_XXX_XXXXX" NUMBER(9,0),
"XXX_XXX_XXXXX" NUMBER(4,0),
"XXX_XXX_XXXXX" NUMBER(2,0),
"XXX_XXX_XXXXX" NUMBER(3,0))
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY "DIR"
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
CHARACTERSET 'UTF8'
LOGFILE APP_XXX_XX_XXXX_%A_%P.LOG'
BADFILE 'APP_XXX_XX_XXXX_%A_%P.BAD'
DISCARDFILE 'APP_XXX_XX_XXXX_%A_%P.DSC'
FIELDS(
KEY_NO POSITION(1:9) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(10:10) CHAR,
XXX_XXX_XXXXX POSITION(11:19) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(11:14) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(15:16) INTEGER EXTERNAL,
XXX_XXX_XXXXX POSITION(17:19) INTEGER EXTERNAL)
LOCATION
( 'FILE1.TXT')
REJECT LIMIT UNLIMITED
PARALLEL 4;
The data forms part of a major driver table, which I may not be able to provide as per the NDA with my company.
The Script I have shared is standard template for creating external table as part of our applications.
We majorly cater for EU regions with this project.(European Characterset needed to be supported)
Thanks
Ganesh
Edited by: RGRAM on Feb 11, 2011 12:44 PM -
Hi there!
Got this problem that are driving me quite mad.
I'm working on a Oracle 9.2.0.7, Unix is a hp-ux.
The problem is:
using an external table, record in variable format, with '^' as separetor, if file size is an exact power of 1024 (i.e. 1K, 2k, 1M etc) I get the error:
reject limit reached
The strange thing is that the file is correct, anc other files are loaded with no problem at all.
For now the "work around" is to edit the file (vi on file so we check that there aren't strange chars) and then add a space at the end of it.
After this the file is loaded!
Anyone have an idea?
Thank you,
AntonioSorry guys, I was a bit busy.
I've talked with a coworker, we got an example of a table and a more precise idea: it's not "power of 1K" but "power of 1M"
This is the example table:
CREATE TABLE ext_table
c_field_1 CHAR(1),
v_field_2 VARCHAR2(15),
v_field_3 VARCHAR2(24),
v_field_4 VARCHAR2(24),
v_field_5 VARCHAR2(14),
v_field_6 VARCHAR2(14),
n_field_7 NUMBER(6,0),
n_field_8 NUMBER(6,0),
n_field_9 NUMBER(10,0),
v_field_10 VARCHAR2(79),
v_field_11 VARCHAR2(12),
c_field_12 CHAR(1),
v_field_13 VARCHAR2(2),
v_field_14 VARCHAR2(7),
v_field_15 VARCHAR2(30),
v_field_16 VARCHAR2(14),
d_field_17 DATE,
n_field_18 NUMBER(8,0),
d_field_19 DATE,
n_field_20 NUMBER(8,0),
v_field_21 VARCHAR2(191),
d_field_22 DATE,
n_field_23 NUMBER(8,0),
v_field_24 VARCHAR2(2),
n_field_25 NUMBER(6,0),
n_field_26 NUMBER(10,0))
ORGANIZATION EXTERNAL (
DEFAULT DIRECTORY DR_LOAD
ACCESS PARAMETERS(records delimited by newline
badfile 'DR_ERROR':'EXT_TABLE_LOAD.error'
logfile 'DR_LOG':'EXT_TABLE_LOAD.log'
fields (
c_field_1 POSITION(2:2) CHAR(1)
,v_field_2 POSITION(3:17) CHAR(15)
,v_field_3 POSITION(18:41) CHAR(24)
,v_field_4 POSITION(42:65) CHAR(24)
,v_field_5 POSITION(66:79) CHAR(14)
,v_field_6 POSITION(80:93) CHAR(14)
,n_field_7 POSITION(94:99) INTEGER EXTERNAL(6)
,n_field_8 POSITION(100:105) INTEGER EXTERNAL(6)
,n_field_9 POSITION(106:115) INTEGER EXTERNAL(10)
,v_field_10 POSITION(116:194) CHAR(79)
,v_field_11 POSITION(195:206) CHAR(12)
,c_field_12 POSITION(207:207) CHAR(1)
,v_field_13 POSITION(208:209) CHAR(2)
,v_field_14 POSITION(210:216) CHAR(7)
,v_field_15 POSITION(217:246) CHAR(30)
,v_field_16 POSITION(247:260) CHAR(14)
,d_field_17 POSITION(261:274) DATE YYYYMMDDHH24MISS
,n_field_18 POSITION(261:268) INTEGER EXTERNAL(8)
,d_field_19 POSITION(275:288) DATE YYYYMMDDHH24MISS
,n_field_20 POSITION(275:282) INTEGER EXTERNAL(8)
,v_field_21 POSITION(289:479) CHAR(191)
,d_field_22 POSITION(480:493) DATE YYYYMMDDHH24MISS
,n_field_23 POSITION(480:487) INTEGER EXTERNAL(8)
,v_field_24 POSITION(494:495) CHAR(2)
,n_field_25 POSITION(496:501) INTEGER EXTERNAL(6)
,n_field_26 POSITION(502:511) INTEGER EXTERNAL(10)
LOCATION (
DR_LOAD:'EXT_TABLE_LOAD'
and a row
2T0123456789 11111111 2008091008264220080910092642020202020304000000000200613359956 0006133599560L2*************************************999912310000002008091008264220080910092642L2061335995620202203042008091008264220080910092642 20090319112538000808291000021162
If you replicate the row, that is 512 byte, 2048 times so you will have a file that is exactly 1MB, then any select on the external table will fail.
The error log EXT_TABLE_LOAD.log says:
KUP-04021: field formatting error for field C_FIELD_1
KUP-04023: field start is after end of record
KUP-04101: record 2049 rejected in file <file>
(NOTE: it's not true, the file is correct! if you try to load the single row it will load nicely)
and you'll have an empty EXT_TABLE_LOAD.error
Hope this will help.
Bye,
Antonio -
How can an external table handle data with line feed between delimiters?
I have defined an external table as below. My data is pipe delimited and comes from a DOS system.
I already remove any carriage returns before putting the file into the DATA_DIR for reading. But
I have found that some of my VARCHAR fields have embeded line feeds.
Is it possible to have a definition that would remove any line feed characters between the delimiters?
Below I also threw together a sample data set there ID #2 has that extra character. Yes, I could
write an awk script to pre-process all my data files. But I am hoping there is a way for Oracle
to also do this.
I understand the LDTRIM to remove any leading and trailing spaces in the delimited field. Is there a
REPLACE or TRANSLATE option. I did a bit of searching but I must be asking the wrong things.
Thanks for any help
Eric
CREATE TABLE table_ext
id NUMBER,
desc1 VARCHAR2(64 CHAR),
desc2 VARCHAR2(255 CHAR),
add_date DATE
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY data_dir
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
CHARACTERSET WE8ISO8859P1
BADFILE log_dir:'table_ext.bad'
DISCARDFILE log_dir:'table_ext.dis'
LOGFILE log_dir:'table_ext.log'
FIELDS TERMINATED BY '|' LDRTRIM
MISSING FIELD VALUES ARE NULL
id INTEGER EXTERNAL(38),
desc1 CHAR(64),
desc2 CHAR(255),
add_date CHAR DATE_FORMAT DATE MASK "yyyy-mm-dd hh24:mi",
LOCATION( 'data.txt' )
PARALLEL
REJECT LIMIT UNLIMITED;
1|short desc|long desc|2001-01-01 00:00
2|short desc| long
desc |1999-03-03 23:23
3|short desc| long desc | 2011-02-02 02:02Thanks for looking. But that relates to the record delimiter which in my case is the pipe character '|'. In my various data sets this is consistent. I expect each record to be one per line. But between two delimiters some data has a line feed. So I'm looking for a method that will "cleanup" the field data as it gets imported.
I was hoping there was an option that would ignore any embedded line feeds (\n) characters. I.e., those not at the end of the line.
Eric -
IGNORE COMMENTS IN EXTERNAL TABLE FILE
I currently have a partitioned table, split by month going back some 7 years.
The business have now agreed to archive off some of the data but to have it
available if required. I therefore intend to select month by month, the data
to a flat file and make use of external tables to provide the data for the
business if required. Then to remove the months partition thus releaseing
space back to the database. Each months data is only about 100bytes long, but
there could be about 15million rows.
I can successfully create the external table and read the data.
However I would like to place a header in the spooled file but the only method
I have found to ignore the header is to use the "SKIP" parameter. I would
rather not use this as it hard codes the number of lines I reserve for a
header.
Is there another method to add a comment to a external tables file and have the
selects on the file ignore the comments?
Could I use "LOAD WHEN ( column1 != '--' )" as each comment line begins with a
double dash?
Also, is there a limit to the size of an external tables file?When I added the lines to attempt to
exclude the Header lines to be:
RECORDS DELIMITED BY newline
NOBADFILE
NODISCARDFILE
NOLOGFILE
SKIP 0
LOAD WHEN ( cvt_seq_num LIKE '--%' )
FIELDS
TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
( cvt_seq_num INTEGER EXTERNAL(12)
I got:
select * from old_cvt_external
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPENcallout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "identifier": expecting one of: "equal,notequal"
KUP-01008: the bad identifier was: LIKE
KUP-01007: at line 6 column 33
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
When I moved the line I got:
RECORDS DELIMITED BY newline
NOBADFILE
NODISCARDFILE
NOLOGFILE
SKIP 0
FIELDS
TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
LOAD WHEN ( cvt_seq_num LIKE '--%' )
I got:
select * from old_cvt_external
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "load": expecting one of: "exit, ("
KUP-01007: at line 11 column 11
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
So it appears that the "LOAD WHEN" does not work.
Can you please suggest anything else?
Maybe you are looking for
-
Create public facing web site of SharePoint intranet portal with Public IP Address
Hi, I did below steps to create public facing URL and to access outside domain network (Internet). 1. Got a public IP Address. 2. Created an extending web application to existing Web Application (default zone - intranet) and Zone selected to Internet
-
Photoshop CS6 trial error 4960
Photoshop cs6 trial has been extracting for hours, So i deleted adobe download assistant, then downloaded it again and I'm at the same position as before, its saying extracting this may take a while. Please help!?
-
OID Provisioning issue on OIM 11g
Hi, I have ran the target user recon for OID and noticed from the events that users are not linked. I tried assigning OID User resource from the provisioning workflow on the admin console but I am seeing the following the issue: DOBJ.ORC_NO_ORDER An
-
Using a purchased song as default ringtone on i phone
This might seem a simple question, but I have downloaded Detroit Emeralds (Feel the Need in Me) as I used to have it as my default ringtone on my old Samsung Tocco. I want to have it on my new i phone 3G - how can I do it? Cheers
-
Lost Apps with new Device update
Hello, I have lost some apps following the download of the latest OS - Most importantly is my password safe, any suggestions as to how I can recover it? Solved! Go to Solution.