How to validate totall character in a file using the extrnal table

Hi all

I have an external as table below

CREATE TABLE 'WE_INT '. "" XTB_INVADJ_FROM_POS ".

("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

VARCHAR2 (2 BYTE) "LOCATION_TYPE."

VARCHAR2 (4 BYTE) "LOCATION_VALUE."

VARCHAR2 (3 BYTE) "ITEM_TYPE."

VARCHAR2 (13 BYTE) "ITEM_VALUE."

VARCHAR2 (5 BYTE) "UPC_SUPPLEMENT."

VARCHAR2 (2 BYTE) "INVENTORY_STATUS."

VARCHAR2 (2 BYTE) "ADJUSTMENT_REASON."

VARCHAR2 (1 BYTE) "ADJUSTMENT_SIGN."

"SET AMOUNT" VARCHAR2 (8 BYTE).

VARCHAR2 (4 BYTE) "ADJ_QTY_DECIMAL_VALUE".

)

EXTERNAL ORGANIZATION

(TYPE ORACLE_LOADER

DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

ACCESS SETTINGS

(RECORDS DELIMITED BY NEWLINE

CHARACTERSET WE8MSWIN1252

STRING SIZES ARE IN BYTES

WHEN LOAD)

((1:5) = "TDETL")

)

BADFILE "XTB_INVADJ_FROM_POS.bad."

DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

LOGFILE "XTB_INVADJ_FROM_POS.log".

FIELDS

LTRIM

(

"TRANSACTIONDATE" POSITION (30:43) DATE,

"LOCATION_TYPE" POSITION (44:45) TANK,

"LOCATION_VALUE" POSITION (46:49) TANK,

"ITEM_TYPE" POSITION (50:52) TANK,

"ITEM_VALUE" POSITION (53:65) TANK,

"UPC_SUPPLEMENT" POSITION (66:70) TANK,

"INVENTORY_STATUS" POSITION (71:72) TANK,

"ADJUSTMENT_REASON" POSITION (73:74) TANK,

"ADJUSTMENT_SIGN" POSITION (75) TANK,

"SET AMOUNT" POSITION (76:83) TANK,.

CHAR POSITION (84:87) "ADJ_QTY_DECIMAL_VALUE".

)

)

LOCATION

("inv.txt"

)

)

REJECT LIMIT UNLIMITED;

If you see my conetent file that it will be as below.

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400000

I want to validate the chracters total if this line is to have more or less of 87 87 he must raise the error.

You can use a column in the external table that contains all characters and a view that selects in the outer table, limiting the lines based on the length of the column that contains all characters, such as shown below.  You can create a separate view for those! = 87 if you want a list of releases.

Scott@orcl12c > c:\my_oracle_files\inv.txt TYPE of HOST

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000040086

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-000000400087

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-0000004000088

Scott@orcl12c > CREATE or REPLACE DIRECTORY LOC_SOURCE_POS2RMS_INVADJ AS 'c:\my_oracle_files '.

2.

Created directory.

Scott@orcl12c > external_table CREATE TABLE

2 ("TRANSACTIONDATE" VARCHAR2 (14 BYTE),

VARCHAR2 (2 BYTE) 3 'LOCATION_TYPE. "

VARCHAR2 (4 BYTE) 4 "LOCATION_VALUE."

VARCHAR2 (3 BYTE) 5 'ITEM_TYPE. "

VARCHAR2 (13 BYTE) 6 "ITEM_VALUE."

VARCHAR2 (5 BYTE) 7 "UPC_SUPPLEMENT."

VARCHAR2 (2 BYTE) 8 "INVENTORY_STATUS."

VARCHAR2 (2 BYTE) 9 "ADJUSTMENT_REASON."

10 'ADJUSTMENT_SIGN' VARCHAR2 (1 BYTE),

11 "SET AMOUNT" VARCHAR2 (8 BYTE).

VARCHAR2 (4 BYTE) 12 "ADJ_QTY_DECIMAL_VALUE."

13 total_characters VARCHAR2 (255)

14)

15 EXTERNAL ORGANIZATION

16 (TYPE ORACLE_LOADER

17 DEFAULT DIRECTORY 'LOC_SOURCE_POS2RMS_INVADJ '.

18 ACCESS SETTINGS

19 (RECORDS DELIMITED BY NEWLINE

CHARACTERSET 20 WE8MSWIN1252

21 STRING SIZES ARE IN BYTES

22 LOAD WHEN)

23 ((1:5) = "TDETL")

24)

25 BADFILE "XTB_INVADJ_FROM_POS.bad."

26 DISCARDFILE 'XTB_INVADJ_FROM_POS.dis '.

27 LOGFILE "XTB_INVADJ_FROM_POS.log".

28 FIELDS

LTRIM 29

30        (

31 "TRANSACTIONDATE" POSITION (30:43) DATE,

32 'LOCATION_TYPE"POSITION (44:45) TANK,

33 "LOCATION_VALUE" POSITION (46:49) TANK,

34 'ITEM_TYPE"POSITION (50:52) TANK,

35 'ITEM_VALUE' POSITION (53:65) TANK,

36 "UPC_SUPPLEMENT" POSITION (66:70) TANK,

37 "INVENTORY_STATUS" POSITION (71:72) TANK,

38 "ADJUSTMENT_REASON" POSITION (73:74) TANK,

39 'ADJUSTMENT_SIGN' POSITION (75) TANK,

40 "SET AMOUNT" POSITION (76:83) TANK,.

41 'ADJ_QTY_DECIMAL_VALUE' POSITION (84:87) TANK,

42 total_characters POSITION(1:255) TANK

43        )

44                  )

LOCATION 45

46 ("inv.txt"

47         )

48)

RELEASE 49 UNLIMITED LIMIT

50.

Table created.

Scott@orcl12c > SELECT * from external_table

2.

TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

-------------- -- ---- --- ------------- ----- -- -- - -------- ----

TOTAL_CHARACTERS

--------------------------------------------------------------------------------

20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 086

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

040086

20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

0400087

20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0008

TDETL00000000020000000000000120100127181611ST6009SKU75001056 0023-00000

04000088

3 selected lines.

Scott@orcl12c > external_table FROM SELECT LENGTH (total_characters)

2.

LENGTH (TOTAL_CHARACTERS)

------------------------

86

87

88

3 selected lines.

Scott@orcl12c > xtb_invadj_from_pos VIEW to CREATE or REPLACE AS

2. SELECT "TRANSACTIONDATE"

3 "LOCATION_TYPE."

4 'LOCATION_VALUE. "

5 "ITEM_TYPE."

6 "ITEM_VALUE."

7 "UPC_SUPPLEMENT"

8 "INVENTORY_STATUS"

9 "ADJUSTMENT_REASON."

10 "ADJUSTMENT_SIGN."

11 "QUANTITY ADJUSTMENT."

12 'ADJ_QTY_DECIMAL_VALUE '.

13 FROM external_table

14 WHERE the LENGTH (total_characters) = 87

15.

Created view.

Scott@orcl12c > SELECT * FROM xtb_invadj_from_pos

2.

TRANSACTIONDAT LO LOCA ITE ITEM_VALUE UPC_S IN AD AN ADJ_ ADJUSTME

-------------- -- ---- --- ------------- ----- -- -- - -------- ----

20100127181611 ST 6009 SKU 75001056 00 23 - 00000040 0087

1 selected line.

Tags: Database

Similar Questions

  • How to find if there is a file using the FrameMaker API?

    How do we find such a file (with pdf / GST file given path) is in force in a folder given using the FrameMaker API?

    You can use the function F_FilePathProperty() FDK to check if there is a way (as a FilePathT). It also provides information about whether the path is writable, readable, is a directory or a file.

    .. .Scott

  • How to find a specific voice memo file in the backup from my iPhone to my Mac? I know where to find the backup, but not how to recover specific files. Thank you.

    How to find a specific voice memo file in the backup from my iPhone to my Mac? I know where to find the backup, but not how to recover specific files. Thank you.

    You can't look "inside" a backup. Just use iTunes to sync with your iPhone, then you'll see a separate category for voice memos in the sidebar.

  • How to read/write tdms 2.0 files with the TDM C DLL?

    Hello

    How to read/write tdms 2.0 files with the TDM C DLL?

    How consequently the datas in interlaced with the TDM C DLL mode?

    Thank you

    Confirmation: TDM C DLL always wrote the file in TDMS version 2.0.

  • I saved my adobe files temporarily muse in my computer when I restart my PC I see not the mt files, please tell me how to recover my files and how to record my entire Web site file using save option.

    I saved my adobe files temporarily muse in my computer when I restart my PC I see not the mt files, please tell me how to recover my files and how to record my entire Web site file using save option.

    When you talk about 'temporarily' as record files in the temporary folder and then by restarting the machine will lose files. You can save the file in any location stored as reader or office and then reopen the case should show all of the content without any loss.

    If the files are deleted or lost there's no way to recover those, sorry if this is the case.

    Thank you

    Sanjit

  • How to create a button to download files in the form?

    How to create a button to download files in the form?

    Hello

    Please refer to the link below with a similar discussion.

    Download file button

    Kind regards

    Vivek

  • How to split a PDF into smaller files using Acrobat XI

    How to split a PDF into smaller files using Acrobat XI?

    Hi laforcej

    Open the PDF in Acrobat...

    Go to tools-> Pages-> extract

    Now, select the Page number, you want to extract and save

  • How to pass parameters in local html files using InDesign?

    How to pass parameters in local html files using InDesign, or how to pass info environment, such as the image, the html code is sitting on top in local html files in InDesign?  I try to use the code html-javascript, then simply pass parms to behave differently depending on where the code is placed in the folios of InDesign.  I don't know how to do it.  If I could read in some environment of the folio InDesign info by using html or javascript, which might work as well.  Please advise, thank you!

    In indesign, you can draw a box and connect the html code to display in this box, if you do it this way you don't let the application in browser.  In the control panel overlays folio, its web called overlays.

    I suggest you download Bringhursts ipad Bob application called DPS tips, it will give you a quick overview of all different overlays and basic opportunities.

    https://iTunes.Apple.com/us/app/Digital-Publishing-Suite-tips/id436199090?Mt=8

    Joe

  • How to open the pdf file using the LabVIEW program

    I want to open the pdf file using the system exe, but this isn't the case. Can you help me?

    Thanks for your help.

  • How to send a mail with attachment no matter what file use the invoke in os 6.0?

    Hello

    There is some issue that how to send a mail with attachment to use the invoke method in os 6.0?

    "I use the Transport at this time mail send successfully, but I use the invoke to throw this error time these error ismail service does not support these tyes of change of parts joined the send using field or remove attachments ' so how do?

    Thank you

    Hi, rishabh

    Thanks.i got the solution and super work Super-Duper hit.

    Thnaks,

    Umang.

  • Creation Waveform TDMS file using the functions DDC_ in C 6.0?

    I'm trying to implement an export written in C 6.0. I can make the TDMS files using the DDC_ controls without any problem. But I can't understand how waveform TDMS files. I thought that if I added properties wf_ I should be able to define the waveform = Yes. But it seems to be more complicated than that.

    Here's what I work until now... (with the exception of the error handling to make it easier to see)

    DDC_CreateFile (sDestFileName, "TDMS", gszinfoline1, gszinfoline2, gszinfoline3, gszinfoline4, & hOutputFile);

    DDC_AddChannelGroup (hOutputFile, szGROUP_NAME, szGROUP_DESC, & hgroup)

    DDC_CreateChannelGroupPropertyTimestampComponents (hgroup,
    szCHANNEL_NAME,
    year (unsigned int),
    months (unsigned int).
    days (unsigned int).
    hours (unsigned int).
    minutes (unsigned int).
    wholeseconds (unsigned int),
    (double) fractionseconds);

    DDC_AddChannel (hgroup, DDC_Double, szCHANNEL_NAME, szCHANNEL_DESC, szCHANNEL_UNITS, & lphchannel);

    DDC_CreateChannelProperty (lphchannel, "wf_increment", DDC_Double, dInterval);
    DDC_CreateChannelProperty (lphchannel, 'wf_xname', DDC_String, 'Time');
    DDC_CreateChannelProperty (lphchannel, "wf_xunit_string", DDC_String, "s");
    DDC_CreateChannelProperty (lphchannel, "wf_start_offset", DDC_Double, 0,0);

    Any suggestions? (Details of this aid are intended for LV or completely absent)

    Thank you very much

    Don

    Hi Don,

    Thanks for the additional information.  After doing research a bit more, it seems that there are 3 required properties so that the property of waveform to be set to yes.  These are wf_start_offset, wf_increment and wf_samples.  If you add in a call such as the following, this should solve the problem:

    DDC_CreateChannelProperty (lphchannel, "wf_samples", DDC_Int32, 5);

    Just replace with the length of your table 5.

    Kind regards

  • Transfer files using the Personal Communicator

    All,

    Can I transfer files using the cell phone?

    Someone at - it a user guide and Administrator's guide on how to configure and use this installation?

    Thank you

    Lucian Medeiros

    No, you can't. You would need for this jabber.

    Q.

    Cisco Unified Personal Communicator and Cisco Jabber for Windows can interact?

    A.

    Yes, these two clients can interact.   Note Although features that are not part of the Cisco Unified Personal Communicator client. like the screenshot, video, desktop sharing and file transfer; are not interoperable between two clients.

    http://www.Cisco.com/en/us/partner/docs/voice_ip_comm/Jabber/Windows/9_0_1/b_jabber_win_faq_chapter_01.html

    HTH

    Java

    If it helps, please note

    www.Cisco.com/go/pdihelpdesk

  • Can I add watermarks to PDF files using the PDF package?

    Can I add watermarks to PDF files using the PDF package?

    Hi Susannah,

    Adobe PDF Pack does not allow to edit a PDF file. To do this, you would need Acrobat. We invite you to try Acrobat free for 30 days: see http://www.adobe.com/products/acrobat.html for more information.

    This help document describes how to watermark a PDF in Acrobat: add watermarks to PDF

    Best,

    Sara

  • Opening files using the InCopy layout

    How configure you a default to open all files using the InCopy layout? (CS5)

    Without any document open, go to the 'View' menu and select the Mode of disposal. On all of the files will be open in the corresponding mode.

  • How to extract information from tree logical structure using the PDF Library?

    How to extract information from tree logical structure using the PDF Library?

    Adobe's PDF Library has PDSEdit APIs to extract information of the logical structure of a tagged PDF file.

    But I couldn't find any example code to demonstrate the C API on PDSEdit layer.

    I google search using different keywords, find none.

    I contact datalogics (which gives me the evaluation of adobe PDF library copy), no code sample on APIs PDSEdit yet.

    Everyone knows any code example can demonstrate extract structure logic tree information PDSEdit APIs (in C/C++ or Java)

    from a tagged PDF file? And is there any sample to demonstrate that connects a tagged logical tree contained in the content stream?

    I thank very you much in advance!

    logicaltree

    Did you look at the code snippets in the SDK?  There are a bunch of samples to work with PDSEdit and structure/marking.

Maybe you are looking for

  • My HP 14 laptop is not recognizing the usb ports and wifi at startup.

    During the last few days I been dealing with the issue that my laptop does not recognize the usb ports and wifi. After several reboots, it works fine. My drivers are up to date, so I don't know why, I'll have this terrible problem.

  • Achi mode on HP HDX X16T - 1200 CTO Premium

    ACHI mode is available on the HP HDX X16T-1200 CTO Premium? W7-64 Ultimate running. Running on a Crucial M4 256 ssd. Have a 512 ssd on the way, would use ACHI id is available in the BIOS. Don't see an option in the CMOS.

  • Analysis during the generation of deployment errors

    Ok I was rrting to understand this for hours... but I just don't understand. I'm trying to created a build of my project of TestStand. However, I get the following warnings when you perform the analysis. This also happens when I try to use the parall

  • HP F2480 Macbook printing problems

    I have connected my Macbook Pro to my F2480 printer HP all-in-one. It recognizes the printer and used the parameters 'generic PLC', as the F2480 is not on the list. It sets up very well, but when it will print the paper goes through the print queue,

  • Active executives Z30 blackBerry disappearing randomly on Z30

    Hello My active frames apps sometimes close without reason.  Most of the apps I have open at the same time is usually 4-6.  I usually close apps when I'm done with it.  Is it possible that my BlackBerry learned my habits and stop my frames active app