Fields containing Record terminators
Hi Oracle forums,
I am trying to load a csv file into an Oracle 11gR2 database, and am having troubles with some fields that are spread over multiple 'lines'. i.e. some fields contain the record terminator.
The data files are ordinary CSV files, with fields seperated by commas (,) and enclosed by double quotes("). The files originated from Windows boxes, and vi tells me they are [dos] files, implying the records are terminated with the standard windows CR/NL pair (\r\n).
I have already tried a load using the Stream Record Format (infile 'example.dat' "str '\n'"), however this did not help.
Shown below is a simplified example of the control file and data
Does anybody know how I can load a csv file where some fields contain the record terminator?
load data
infile 'example.dat'
into table example
fields terminated by ',' optionally enclosed by '"'
(col1 char(15),
col2 char(9))
example.dat:
"Field One","Field Two"
"Field Three","Field
Four"
"Field five", "Field Six"
Hi Srini,
That has been almost perfect. Most fields that are spread over multiple lines are now loading.
I now have a new problem, however.
The new control file looks like this:
load data
infile 'example.dat'
continueif last <> '"'
into table example
fields terminated by ',' optionally enclosed by '"'
(col1 char(22),
col2 char(9)) And I have discovered some multi-line fields similar to
example.dat:
"Field One","Field Two"
"Field Three","Field
Four"
"Field five", "Field Six"
"", "Field ""number""
eight" The problem field appears to be a free text field, where users can enter comments on a particular event. On some occasions, the users have used quotes.
Do you know how I can escape the double double-quotes, without affecting the null fields?
Thanks heaps for you your help
Gavin
Similar Messages
-
Field containing a list of sizes or a table ?
Iain was kind enough to advise on using a table instead of a field containing a list of 6 comma separated items.
I did this, but can I throw a new slant on why I'd prefer to use a field ?
JEWELLERY WEB PAGE
select * from merchandise where merchandise.category = "Jewellery"
PRODUCT DETAIL PAGE
When a user clicks on any items from above page, the hyperlink sends the unique merchandise_ID in the link, to a product detail page using a new query:
select * from merchandise where merchandise.merchandise_ID = URL.merch_ID'
This jewellery comes in various sizes. These sizes were in a comma separated list in a field called 'sizes' in the merchandise table. I'd been advised to move them to a table instead. If I moved the sizes to a separate table I'd have to add a LEFT JOIN to include the sizes table or run a separate query on the sizes table (where sizes.merchandise_ID = URL.merch_ID) - which is a performance hit.
All I need to do with the sizes is produce a drop down list the user can choose from - so isn't it better I just put the sizes in a single field, separated by commas ? Then use Coldfusions inbuilt functions to parse the list into a drop-down box ?A thought experiment that might convince you.
Lets compare these two data schemas.
CSV
Item
Size
Shirt
Small,Medium,Large
Coat
Medium,Small,Large
Pants
Small,Large,Medium
Shoes
Large,Small,Medium
NORMALIZED
Size Table
Key
Size
1
Small
2
Medium
3
Large
Item - Size Join Table
ItemKey
SizeKey
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
3
3
4
1
4
2
4
3
Item Table
Key
Item
1
Shirt
2
Coat
3
Pants
4
Shoes
Now imagine these two systems extended to multiple thousands of items.
Then imaging that some marketing type decided that "Large" was an ugly description for that size so they want to change it to "Husky" and|or they want to change the "Small" size to "Petite".
In the Normalized version you make one or two updated to the size table. I don't even want to try and describe the ugly update you have to try and create that involves looping and string manipulations to try and update all the records in the CSV version. -
Searching Web Apps with Data Source fields containing multiple values
I have a Web App with a field allowing multiple values to be entered similar to the checkbox list. I need to restrict allowed values to a large, finite list of values currently stored in another Web App as the data source. I can't apply the Data Source field type as that only allows single value selection. I also need to be able to use the Web App Search form to search for items containing 1 OR more values in this field (the search functionality of a checklist field type). Here's what I've tried for field types:
Text (string) or Text (multiline) field type - By saving a list of comma separated values (the same way that checkbox list outputs) to a text input or textarea, the search logic only searches for exact string (including commas) and doesn't parse the individual values.
List (checkbox list) field type - This allows me to search multiple values using OR logic, but the web app will only store values that have been entered as options in the actual web app field setup. I tried using a checkbox list with minimal or empty options hoping that whatever values I sent over in a comma separated string value would still get stored, but because the values came from my Web App data source and not the list of options stored with the field, they were not saved.
Has anyone found a way to do this?
My other question is about how I might use a similar multi-value field as described above but return search results containing items with ALL selected values for that field (AND logic).
Can anyone enlighten me to the inner workings of BC web app search logic?Thanks Robert.
You'll need to create your own interface to the webapp database for those kind of data operations
by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
I'm curious if anyone else has tried this?
Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
Web App item field value (as recorded against the List (Checkbox List) field type:
8294877,8294878
Web App Search value (for this same field):
8294879,8294877,8294885
The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets). -
SQL LOADER - fields containing CRs
I am using SQL loader for uploading some data extracted from another database. data contains one field that has 'Carriage Return' characters. when sql loader reads this character it treats it as beginning of another record. This results in load errors.
Can anybody suggest a way to handle the fields containing Carriage Returns ?
Thanks much.
-shaileshHello,
You can load the data as in a stg table and the move from stg table to regular table concatenating both call_temp and call_date column together.
load data
infile 'Cell_Phones.dbo.Account_Details.dat' "str '<EORD>'"
into table MD_CELLPHONE.Account_Details_stg
fields terminated by '<EOFD>'
trailing nullcols
Account_Number ,
Phone_Number ,
Call_temp,
Call_Date
Convert to right date format
Insert into account_details (col1 , col2, col3, ...) select val1 , val2 , to_date ( val3 || ' ' || val4) ...
from account_details_stg;
Regards
Edited by: OrionNet on Feb 2, 2009 5:11 PM -
Query field contains backward slash
I am trying to query a field contains backward slash (for example,
"com\aaa\bbb" in database) by using kodo 2.5.2 and msde2k. If I use the
following condtion string, I am not able to get any record back.
Sring condtion = "com\\aaa\\bbb";
String filter = "aProperty == \"" + condition + "\"";
(In the log message, this condition string become "comaaabbb")
I have to use 4 slashes to get record.
Sring condtion = "com\\\\aaa\\\\bbb";
String filter = "aProperty == \"" + condition + "\"";
(In the log message, this conditon string become "com\aaa\bbb")
Any ideas or comments.
Thanks
WilliamThanks a lot for the answers.
It seems there are some problems in my sample code. Here is correct one.
(CASE I) - I use double slashes in the condition string in this case and
it doesn't work.
Sring condtion = "com\\aaa\\bbb";
String filter = "aProperty == "" + condition + """;
(In the log message, this condition string become "comaaabbb")
(CASE II) - I use forth slashes in the condition string in this case and
it works.
Sring condtion = "com\\\\aaa\\\\bbb";
String filter = "aProperty == "" + condition + """;
(In the log message, this conditon string become "com\aaa\bbb")
Thanks
William Perng wrote:
I am trying to query a field contains backward slash (for example,
"comaaabbb" in database) by using kodo 2.5.2 and msde2k. If I use the
following condtion string, I am not able to get any record back.
Sring condtion = "com\aaa\bbb";
String filter = "aProperty == "" + condition + """;
(In the log message, this condition string become "comaaabbb")
I have to use 4 slashes to get record.
Sring condtion = "com\aaa\bbb";
String filter = "aProperty == "" + condition + """;
(In the log message, this conditon string become "comaaabbb")
Any ideas or comments.
Thanks
William -
Greetings Everyone,
I am getting the follow up errors: "This field contains duplicate values. Remove all duplicate values and try the operation again."
when I tried to make the field "Claim Number" from the list in site collection library. See the screen below:
1- I selected on the "List" and I clicked on the list name
"Claim Tracking Report"
2- After I clicked on the list name then I went to the ribbon and selected list setting to choose Enforce Unique for the Field Column
"Claim Number"
3- Then I went down and selected
"Yes" to Enforced the Unique for the Field Column "Claim Number".
4- Then after I clicked "Yes" I got the error
"Sorry, something went wrong. This field contains duplicate values. Remove all duplicate values and try the operation again." But I don't have any duplicates values Items, because I had them removed before I tried
to Enforce the field column values to Unique. Can someone help or provide me a suggestions on how I can solve this issue please. Thank you
FYI: I am using a Nintex WorkflowHope this is a list, how many total items are there?
Please try to open this list as access(link in IE) and run this query in access
SELECT Claim.[Claim Number], Count(*) AS Expr1
FROM Claim
GROUP BY Claim.[Claim Number]
HAVING (((Count(*))>1));
Hope it will show something! if this does not show you dups then better to create a separate list and migrate items after configuring unique column.
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Select from table where field contains the first 3 character
The value of the field contains leading zeros like 0000000123, 0000001123, 0000011123.
Now we need to check the table for entries that contains the first three characters excluding the zeros.
If we are looking for '123' then we should be retrieving 0000000123 and not 0000001123 or 0000011123.
Is there a way to get that value in SQL statement with only the exact result?
Thanks.P156550 wrote:>
> We've tried to use LIKE in our SQL statements and filtered it but there are a bunch of data and we want to get the exact row to improve the performance.
Hello Adjhan,
Yes, you need not use LIKE.
You can use CONVERSION EXIT. I see that the length of your data is CHAR10.
So try to use the code i have suggested & revert back if any doubts.
@Soumyaprakash:
If read the original post carefully, the OP has said:
If we are looking for '123' then we should be retrieving 0000000123 and not 0000001123 or 0000011123.
So LIKE does not come into the picture.
Good Luck,
Suhas -
How to set a field as mandatory when another field contains specific values
Hi SAP Experts,
Is it possible to set the Plant Specific Material Status field as mandatory when the DChain-spec. status field contains a specific set of values? Thanks.
Regards,
Kim YongHi Kim,
I think you can achieve this using the validation tab in the field.Add a new rule for validation select the condition as test and in the value you have use formula according to your senario.Select the 'Stop execution'.This will make the field mandatory.
I hope this helps...
Naga -
Sort on field containing Hebrew description in PowerView connected to MultiDimentional Model
Hi,
We are connected to MultiDimentional via Power View in SharePoint 2013.
The Local Identifier Code is 1037 (Hebrew).
The problem is that every time you check a field containing description in Hebrew
the query is stuck, cause there is an automatic Order by clause on fetched fields
in the query generated by the PowerView. For ex:
EVALUATE
FILTER(
KEEPFILTERS(
SUMMARIZE(
VALUES('DW DIM CUSTOMERS'),
'DW DIM CUSTOMERS'[BRANCH CD.Key0],
'DW DIM CUSTOMERS'[BRANCH CD]
NOT(ISBLANK('DW DIM CUSTOMERS'[BRANCH CD.Key0]))
ORDER BY
'DW DIM CUSTOMERS'[BRANCH CD], 'DW DIM CUSTOMERS'[BRANCH CD.Key0]
If the order by on 'DW DIM CUSTOMERS'[BRANCH CD] (the desc of the branch)
removed (manually in SSMS) the query runs without any performance issues.
How this could be fixed?
TYHi Dimitri,
According to your description, did you want to improve MDX query performance?
In SQL Server, we can consider following conditions to improve SSAS query performance:
Use calculated members with Scope assignments instead of using IIF.
Remove empty tuples from MDX result.
Optimize cube and measure group design, etc.
Reference:
http://technet.microsoft.com/en-gb/library/cc966527.aspx
As per my understanding, there is no limit to the number of columns in the ORDER BY clause; however, the total size of the columns specified in an ORDER BY clause cannot exceed 8,060 bytes. It may be cause the similar issue.
If there are any misunderstanding, please feel free to let me know.
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
hi
can any one help me , i am getting frm-41214 when i pass a paramter list containing record group as data parameter to run_report_object as parameter, calling report from forms 10g, but when i dont pass the parameter list the report runs displaying no data(as it should do), otherwise it dont run and display the frm-41214
zulfiqarHi,
Try using a lexical parameter(&parm_1) for a string of values or a bind parameter(:parm_1) for a single value
Thanks,
Kimosabe -
Hi All,
I have to show one output in ALV.One of the o/p fields is "Record Type" which has possible entries as 1.Current Stock 2. Safety Stock 3. Process Order 4.Planned Order.
Is there any field in any table for record type with above mentioned possible entries.Even if a field for Order type is there please mention.
Thanks in Advance,
Saket.Hi
Please check this
/BI0/OIRECORDTP Record type
CFRECTY Record type
FE_RRCTY Record type
MAFID Record type
P106_RTYPE Record type
PAR_TIREG Record type
PES_190TIP Record type
PPT_TSREC Record type
RECNO Record type
RECTP_EBES Record type
RSART Record type
SISATZ Record type
VVISATZA Record type -
How to check whether a field contains at least one numeric value
how to check whether a field contains at least one numeric value..
Hi,
I hope that this code will works.
constants:
c_digit_grp TYPE char11 VALUE '0123456789', " Digit group
* Data Declaration
data :
str type string.
* if you want check entire string and pass entire string
if str CA c_digit_grp.
* write your logic ---this block will execute atleast one numeric value exists in the string
Endif.
Regards
Bhupal Reddy -
Packed field contains incorrect BCD format. : HELP!!
HI All ,
I have a Business Connector Error message which I am not able to resolve. When I try to pass test data to SAP from BC using "Run" function I get the following message "Packed field contains incorrect BCD format"
I know this message is related to the amount fields : I am calling a SAP Bapi /POSDW/BAPI_POSTR_CREATE .
I have tried a lot of combinations of sending the amounts but I always get this message. The SALESAMOUNT field in SAP in the BAPI is DEC with length 28 and DEC as 9.
Pl advice how should the amount fields be formatted ? if possible with an example ,,say if my amount is 100.00 then what should I mention in the test run ??
I am really new to Business Connector hence any help will be greatly appreciated.....
Thanks and RegardsDaniel,
Try moving yout total to a charcater fields.
When loading data inti IT0008 ANSAL has to be type c otherwise the data doesn't load.
So once you have your total move to L_total and use this in your BDC.
Cheers
Julie -
Error : The input field contains prohibited characters (already deleted)
Hi,
While trying to generate depreciation (Tcode AFAB), after select the Time of Print (either spool or immediate printing) this error will be displayed - "The input field contains prohibited characters (already deleted)", no error number displayed and the character ### appear in Time of Print. I m not using any special characters and i was able to generate it before. Also the test run is successful.
Please guide why this error is appear and what is the resolution for it.
Thank you,
AmalinaHi Amalina,
Please see note 382285 solution part.
Regards Bernhard -
Error in outbound queue. Packed field contains incorrect BCD format
Hi,
Can anyone please help me with this.
In the outbound queue of CRM, the queues are stuck up in SYSFAIL state.
The error is ' Packed field contains incorrect BCD format.'
Can anyone suggest what this could mean?
Regards,
PratimaHi Pratima,
In the CRM Server, the structure has more fields than in the R/3 System. Fields BAPISDIT-TAX_AMOUNT, BAPISDIT-CR_EXCHRAT_V and BAPISDIT-EXCHRATEST_V have data type 'DEC' and do not exist in the R/3 System. During the initial download, the fields receive the value '020202...' and cause the termination "The packed field does not contain a correct BCD format" in function module CRM_SALESDOC_MAP_BAPI2MBDOC.
Use Transaction SE11 to add the following fields at the end of structure BAPISDIT in the R/3 System:
PLANDLVSCH PLAVO CHAR 4
SEQUENCENO CHAR35 CHAR 35
CREDPRIC UMREFF FLTP 16
PAY_GUARAN CHAR2 CHAR 2
GURANTEED UMREFF FLTP 16
CFOP_CODE CHAR5 CHAR 5
TAXLAWICMS CHAR3 CHAR 3
TAXLAWIPI CHAR3 CHAR 3
SD_TAXCODE CHAR2 CHAR 2
VALCONTRNR CHAR10 CHAR 10
VALCONTRIT POSNV NUMC 6 *
ASSORT_MOD W_SORTK CHAR 18 *
VALSPECSTO KZBWS CHAR 1
MATGRHIE1 CHAR18 CHAR 18
MATGRHIE2 CHAR18 CHAR 18
PROMOTION KNUMA_PI CHAR 10 *
SALES_DEAL KNUMA_AG CHAR 10 *
FLGLEADUNI CHAR1 CHAR 1
FREE_GOODS CHAR1 CHAR 1
VALID_OBJ TECHS CHAR 12
TAX_AMOUNT BAPICUREXT DEC 28
MRP_AREA BERID CHAR 10
CUST_MAT35 CHAR35 CHAR 35
CR_EXCHRTV STCUR_AP DEC 9
EXCHRATSTV STCUR_AP DEC 9
or Implement SAP Note: 498317.
Thanks
Maybe you are looking for
-
Problem with changes and visualization in the forms
I have a problem with forms, the problem is the next, I do a modification in the database with a update or with form and in other station no visualized the change. The other station need close the form and open for visualize the modification. Why I h
-
Regarding TC: VL04 execution in back ground (runing delivery due lists
Dear SAP Experts, I have a query regarding delivery due lists. TC: VL04 . When I enter the shipping points ,sales area ,office and other mandatory feild and execute in foreground the deliveries are shown. But when I do the execution in background . I
-
Track public classes, interfaces and methods by ID
Hi All, I'm wondering whether there is a tool to assign a unique ID to classes, interfaces and methods (eg. within Javadoc) and track these IDs. The reason I'd need such a feature is that I'd like to do requirements tracking in an easy but complete w
-
I was wondering if there is a trick to exporting / importing pages containing OmniPortlets. I have a page that contains an SQL omniportlet that executes a stored procedure . Importing the page to the target portal completes successfully, however the
-
TCP/IP printing through 1x Extreme and 4x Express
Want to print on my Business Laser Color, Copier & Scanner through an Airport Express near that printer. (impossible to install CAT5/6 in that area) I use an Extreme as a main base and 4x Express on the same wireless network for my iTunes and want to