jQuery datatables column filter breaks due to ampersand (&) in columns - datatables

I have set up default column filtering for my table but in 1 column the td cels contains a value (e.g. "merger & aquisitions") which breaks the filtering. how can I handle this?

Related

Add New Column to Query with Default Value

I have added a blank column to my query, so when I export the results the user can use the blank column to manually input their drivepath to use for their mailmerge automation. The code below achieves that.
SELECT
NULL as WordDocPath
I want to take this one step further by adding the drive path text as the Null Column's default value so the user doesn't have to copy and paste 10k rows on the exported file.
How do I add the drivepath (C:\Users...) as a default value, text formatted?
While I'm at it.. would also like to add a FileName column the combines the text from other existing columns.
Example:
SELECT
Lastname
EmployeeID
Region
Result wanted: Doe_123456_REGION_LetterTitle
The Letter Title is not pulled from the table, it's just a text string.
How do I add the drivepath (C:\Users...) as a default value
By selecting it, instead of null:
select 'C:\Users...' as drivepath
from ...
add a FileName column the combines the text from other existing columns
That's concatenation.
select lastname ||'_'|| employeeID ||'_' || 'LetterTitle' as result
from ...

cannot filter the records where the column having hyphen in PostgreSQL

I have been using Like function to filter the records based on the user input, it works for all the characters but its not working for hyphen,below the condition where I'm using this Like function to filter the records having hyphen,
LIKE upper('%-%')

Google Refine - pull out identical values in cell

I have data in a column that looks like this
["Lymore Cottages", "Lymore Cottages", "Lymore Cottages", "Lymore Cottages", "Lymore Cottages", "Lymor Cottages"]
Its essentially the same thing multiple times, but as these are entered by users they could be different. If you notice the last one has the e missing.
What I would like to do is create a new column with just the unique names in it. So the new column would just contain "Lymore Cottages, Lymor Cottages".
I believe this is possible with Google/open Refine. I tried clustering but this also clustered all the other rows with the same details rather than per cell. (I need this for each row regardless of if there are 20 other rows with the same data)
This isn't a programming question, however a combination of splitting values in the cell, removing the duplicates and then reassembling the contents might work.
There's probably an easier way to do this. Roughly, you could
Split
Split multi-valued cells... on the column
Remove the brackets and quotes with
value.replace('[', '').replace(']','').replace('"', '')
Remove duplicates
Next, Sort... A-Z and Reorder rows permanently
Blank down on the column
Invoke the Facet by blank and select True
Remove all matching rows from All > Edit rows
Reassemble
On the column, Transpose cells in rows into columns...
Rebuild the field with brackets and quotes using
'['+ ' ' + value + ',' + ' ' + cells['Step 7 Field Name'].value + ' ' + ']'

SQL loader to load data into specific column of a table

Recently started working on SQL Loader, enjoying the way it works.
We are stuck with a problem where we have to load all the columns in csv format say (10 columns in excel)but the destination table contains around 15 fields.
filler works when you want you skip columns in source file but unsure what to do here.
using is staging table helps but is there any alternative?
Any help is really appreciated.
thanks.
You have to specify the columns in the control file
Recommended reading: SQL*Loader Control File Reference
10 The remainder of the control file contains the field list, which provides information about column formats in the table being loaded. See Chapter 6 for information about that section of the control file.
Excerpt from Chapter 6:
Example 6-1 Field List Section of Sample Control File
1 (hiredate SYSDATE,
2 deptno POSITION(1:2) INTEGER EXTERNAL(2)
NULLIF deptno=BLANKS,
3 job POSITION(7:14) CHAR TERMINATED BY WHITESPACE
NULLIF job=BLANKS "UPPER(:job)",
mgr POSITION(28:31) INTEGER EXTERNAL
TERMINATED BY WHITESPACE, NULLIF mgr=BLANKS,
ename POSITION(34:41) CHAR
TERMINATED BY WHITESPACE "UPPER(:ename)",
empno POSITION(45) INTEGER EXTERNAL
TERMINATED BY WHITESPACE,
sal POSITION(51) CHAR TERMINATED BY WHITESPACE
"TO_NUMBER(:sal,'$99,999.99')",
4 comm INTEGER EXTERNAL ENCLOSED BY '(' AND '%'
":comm * 100"
)
In this sample control file, the numbers that appear to the left would not appear in a real control file. They are keyed in this sample to the explanatory notes in the following list:
1 SYSDATE sets the column to the current system date. See Setting a Column to the Current Date.
2 POSITION specifies the position of a data field. See Specifying the Position of a Data Field.
INTEGER EXTERNAL is the datatype for the field. See Specifying the Datatype of a Data Field and Numeric EXTERNAL.
The NULLIF clause is one of the clauses that can be used to specify field conditions. See Using the WHEN, NULLIF, and DEFAULTIF Clauses.
In this sample, the field is being compared to blanks, using the BLANKS parameter. See Comparing Fields to BLANKS.
3 The TERMINATED BY WHITESPACE clause is one of the delimiters it is possible to specify for a field. See TERMINATED Fields.
4 The ENCLOSED BY clause is another possible field delimiter. See Enclosed Fields.

access 2003 query to remove the first chracter of a field into another field if it is the letter L

Exactly like my title states i need a query that removes the first chracter from [Parameter_Value] into [Parameter_Flag] if the first character is the letter L. Otherwise it remains unchanged. There are no blank values in [Parameter_Value] as they have already been removed.
i thought of a way . but it requires bring all the entires with L using the criteria Like"L*" into another table. and then removing the first characters of each field while adding an L to the [parameter_flag] column. usign the criteria NOT like "L*" to get the rest of the values in another table. and then combine the two.
Is there a more effiecient way?
I'm rusty on my Access (JET) SQL, but I think is what you want:
UPDATE table
SET Parameter_Flag = "L",
Parameter_Value = MID(Parameter_value, 2)
WHERE Parameter_Value LIKE "L*"
The * wildcard character only works in ANSI-89 Query Mode ("traditional mode"). Perhaps safer to use ALIKE, which uses the same Standard wildcard characters regardless of Query Mode e.g.
UPDATE table
SET Parameter_Flag = 'L',
Parameter_Value = MID$(Parameter_value, 2)
WHERE Parameter_Value ALIKE 'L%';