Tagged Questions
1
vote
2answers
17 views
SQL BLOBs don't end with a null. How do I make it?
So I am using a java SQL api to insert some BLOB data into a table. However, Since the SQL apparently doesn't know that I just want the string to end, it just pads it with zeros. So I have 10 ...
0
votes
1answer
13 views
Convert numeric time value to string in Netezza
I'm trying to convert a date key and a time key (both numeric) to a timestamp in yyyy-mm-dd hh:mm:ss format in Netezza.
e.g. date_key=20120711 time_key=61946 should be converted to '2012-07-11 ...
0
votes
2answers
23 views
Split address string with carriage returns
I have an address field where all the address details are held in one column, I want to create some labels so need to be able to split the address into the correct postal format.
Example of the ...
0
votes
1answer
40 views
variable in SQL
I have a DB2 table with two columns A and B storing alphanumeric values.I want to find whether a value(MyValue) exist in between A and B. I want my result to be : MyValue | A | B
I could have used: ...
-1
votes
2answers
31 views
Mysql Date Format convert
I want to sub string date from [09/Jul/2014:16:12:58 +0530] and want to feed it to Date type Field.
My complete query is like this
insert into SquidLog
...
1
vote
1answer
39 views
Can MySQL automatically and transparently de-duplicate strings?
In C, the compiler assigns "strings" numeric IDs (4-byte pointers) and only keeps one copy of each string: for char *a="Hello", *b="Hello";, only one copy of "Hello" is stored in memory. This is ...
-2
votes
0answers
44 views
What's wrong in this insert into select
I'm trying to import the data contained in a table called cnefe with a single variable at column called cnefe too in the following format:
14 27 5 0 11RUA ...
6
votes
3answers
51 views
How to evaluate a dataset with a string ASP.NET C#
I want to be able to evaluate a dataset with a string. In an SQL statement I will I am pulling the data with a dataset, and if the dataset matches the string, I want to do something. I can't figure ...
0
votes
3answers
51 views
SQL Renaming NULL with string
I have looked through questions here and have not been able to find exactly what I am looking for.
How would I create a query in mysql that would return missing data in field Name in database Demo ...
0
votes
0answers
41 views
Check if string consists only of alphanumeric, white spaces, apostrophes, dashes or dots
I'm trying to select all customers who has an invalid name.
Allowed characters in names are:
- All Unicode letters [a-z][A-Z] and other letters such as (á, é, í, ó, ú, ü, ñ, etc...)
- All ...
0
votes
3answers
50 views
Object is not an ADODB Record set = C# filling datatable
I am trying to bring back records from my access DB by matching the number selected in my comboBox2 and bring back all the rows in relation to that number - this has worked fine in other projects but ...
0
votes
1answer
10 views
VBScript Initialize string
I try to initialize a string with an SQL query expression:
myString = "SELECT * FROM t_package WHERE t_package.PackageFlags LIKE '*CheckedOutTo=*'""
I get the following error: Unterminated string ...
0
votes
1answer
22 views
Oracle 11g - SQL replace trash values
I'm having major difficulty to do something which should be pretty simple.
I have column which have some data like this:
1,2,3,4,5,6
This numbers needs to be changed into descriptions so I'm using a ...
0
votes
1answer
14 views
Locate rows that have the same resource key (with different .endings) and same values
I have the following table, containing resources with either a .text or .watermark ending:
+-------------+-------+
| ResourceKey | Value |
+-------------+-------+
| A.Text | Val1 |
| ...
-1
votes
3answers
40 views
Unable to insert strings into MySQL using PHP
To add new records to the MySQL DB, I have used PHP to insert the data. So far however, I have been unable to pass strings into their fields. I have been able to pass integers into my field "ID" ...
0
votes
3answers
36 views
Write SQL text inside a compilation unit
I'm writing DAO objects using JdbcTemplate.
Sometimes I have long string queries with formats (tabs, new line an so on), but I don't know what is the best way to store it inside the class. Now I'm ...
0
votes
2answers
21 views
Connection String Help (Server 2003)
Can anyone please double check my connection string. I keep getting the error:
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not ...
-1
votes
1answer
19 views
Incorrect PDO result using loop
Connected with this question
I have got a really strange problem. When I use hardcoded values to retrieve data from arrays and pass as parameter to PDO, than everything is fine. Problems become when ...
0
votes
1answer
30 views
Conversion failed when converting date and/or time from character string in a stored procedure
So I try to run this query
ALTER PROCEDURE [dbo].[sp_ImportMonetareWinmentor]
@dataStart datetime ,
@dataFinal datetime
AS
set language english
declare @erroare int
...
0
votes
0answers
49 views
How to extract text from a notes column in a SQL Server database
I want to extract some text which is in a Notes column in Table X and display it as column fields in a SSRS report.
Ex: Notes Column
7/7/2014 4:38:03 PM Timothy Hebbar
New incident created in the ...
0
votes
2answers
22 views
Sql - How to add condition on fields when inserting them into a table?
I need to insert strings in an sql table, where I have to add condition. For example:
SELECT ii.Terminating_Item_Site_ID,
ii.Originating_Item_Site_ID,
loc.ServiceAddress,
loc.ServiceCity,
...
0
votes
4answers
44 views
How to split a row into two strings and copy the second string in a separate column in SQL?
I have a column which is named "Firstname" and contains
Firstname Lastname
and I want to create another column called Lastname and cut the Lastname from the "Firstaname" column and paste it on the ...
0
votes
3answers
53 views
SQL Query string replace
DECLARE @Chat varchar(100) = 'GiveSilk:[Axmeed] Amount:[10]'
,@TargetCharName varchar(32),@Amount int
SET @TargetCharName = (REPLACE(@Chat,'GiveSilk:[',''))
select @TargetCharName
thats my sql ...
0
votes
2answers
58 views
SQL server : split string function only return part of string
I found this SQL split string function on internet, but when I pass a string contains 700+ items in it, separated by commas, it only generate a table variable with 280 rows, can some help me to ...
0
votes
1answer
17 views
Formatting in pymysql multiline statement
The following gets a list of company names from one columns in a database, then iteratively uses MATCH AGAINST to match them against another column.
The code is:
cur = conn.cursor()
...
0
votes
2answers
28 views
Use SQL to extract characters with multiple back slashes [duplicate]
I have a string:
\_AAA\DDDD\09090\longtest
How can I extract just the string 09090?
There will be many strings like these and I would like to extract the string between the 3rd and fourth back ...
2
votes
1answer
97 views
Automatically truncate source strings exceeding destination string size
I am writing a procedure that translates data from a vendor's tables into our local tables, and there are many assignments that map from a cursor on the source table into a ROWTYPE of the destination ...
0
votes
1answer
24 views
Sql help, function parses a string field in table, need to filter returned table in where clause
I need some help, I am using Oracle 11g 11.1.2.4, and Jdeveloper
I need the 'Type' returned from my function to be filtered in the where clause so that any 'Type' that is 'NO_TYPE' is not returned.
...
0
votes
2answers
42 views
Parameter.addwithvalue function error
public static bool dataMatch(string data, string tableName, string column)
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = new SqlConnection(CnnStr);//connection string ...
0
votes
2answers
33 views
SQL query for counting multiple strings with one output
I have a database including certain strings, such as '{TICKER|IBM}' to which I will refer as ticker-strings. My target is to count the amount of ticker-strings per day for multiple strings.
My ...
0
votes
1answer
40 views
MySQL cuts off string from subquery which uses UDF
I have rather big InnoDB table (~100k rows) in MySQL 5.6 and UDF function:
CREATE AGGREGATE FUNCTION collect RETURNS STRING SONAME 'libcollect.so';
When I query
SELECT ...
1
vote
2answers
63 views
T-SQL help - can someone think of a set-based operation to replace our current row-basead operation in sql instead?
I have a question in one of the process, currently it's written in row-based operation, and it takes an hour to populate around 50,000 records but will take over 5 days for 3million records. I have ...
0
votes
2answers
33 views
Convert string of list to python list [duplicate]
I downloaded a csv table from a database using SQL. One of the fields has values like so:
'[0.1234,0.0,0.0]'
I want to convert this string to a python list to get the first value. I only know how ...
0
votes
2answers
40 views
How to extract 10 consecutive digits from a alphanumeric string?
This will give me whether or not a text_field value consists of 10 consecutive digits. Now, what if I need to extract those digits in a new field. How would that work?
select text_field,
case when ...
0
votes
1answer
37 views
OleDbDataAdapter UPDATE query comparing date type with string
I have an OleDbDataAdapter that is doing an UPDATE on a database.
On the table that I am updating I have a column named "Temp_date" that holds dates in the mm/dd/yyyy format.
Is there any way I can ...
0
votes
1answer
32 views
How to add a delimiter at a particular position in Oracle
Hi I have a string like this
ABCDEFGH I want the output to be ABCDEF.GH
If it's a number like 1234567 then i want the output to be 12345.67
Basically i want the delimeter (.) before last 2 ...
0
votes
2answers
50 views
Error in SQL update query in JDBC
For the command given below, if the variable body_template contains " Abhinav's number", it shows the following error:
You have an error in your SQL syntax; check the manual that corresponds to your ...
0
votes
1answer
33 views
SQL group by to concatenate text
Never ran into this before. I'd like to do it in SQL, but I can in Excel as a fall-back... It's a relatively small set of data.
Suppose I have the following data:
foo | val
----+-----
A | red
A ...
0
votes
0answers
14 views
Myqsl split string containing different number of words [duplicate]
How can I split strings, which are in one table column, into separate words but those words are not always one and the same number. Sometimes string can contain 1, 2, 3 or more words. And when they ...
0
votes
0answers
23 views
Joining 2 columns having same characters but arranged differently using SQL
I have a table T1 that has pre-concatenated values like A:B:C in a column . There is another table that also has the same pre-concatenated values but in a different order like B:C:A and also has ...
0
votes
1answer
34 views
Oracle How to get the count of occurrences within a comma separated string
I have a string that is a comma separated value stored in a table. I want the description and count of each item in the string. So, if one record has the string 'YL', I want to get 'YL Description', ...
1
vote
1answer
38 views
String split to table on whole column
I have two tables, the first, dbo.QuestionaireResponse includes the columns PersonID (int not null), ApplicationID (int not null) and RaceIDs. PersonID is a basic ID column, but RaceIDs is a ...
3
votes
1answer
71 views
Could not determine polymorphic type because input has type “unknown”
I have a query which gives output as
Could not determine polymorphic type because input has type "unknown"
Query :
select ( array_to_string(array_agg(name), ', '))::text as name,path
...
0
votes
2answers
47 views
Oracle REGEXP_REPLACE replacing ; delimited strings with quoted strings
I need a simple replace function which replaces a semicolon delimited list of strings to quoted comma delimited strings.
'123;Asd;_P1;' replaces to '123', 'Asd', '_P1'
Tried this but the last string ...
1
vote
1answer
39 views
CLOB to binarystream convertion
How to convert Clob data to Binarystream ?
I can able to find it in 2 steps as of now, 1--> CLOB to String 2---> String to BinaryStream.
I am calling a SQL package which has 1 i/p and 2 o/p and ...
-1
votes
2answers
41 views
Getting a char(36) UUID from MySQL query [closed]
What type should I be getting for a char(36) UUID value in a MySQL query?
Query:
ResultSet res = st.executeQuery("SELECT uuid FROM playerdata");
String variable:
String uuid = ...
0
votes
0answers
26 views
NULL character is passed to Oracle procedure by 64-bit C++ application
I am converting my C++ application to 64-bit. The problem I am having has to do with Oracle calls. Any string (varchar2) parameter I pass to an Oracle procedure has a null character at the end. For ...
0
votes
2answers
24 views
Join on two dis-similar column
I need to join one column of a table to a column of another table.
Now these two column consists the geographic region data. But the issue is the column dont have exactly same strings od data.
For ...
0
votes
4answers
39 views
oracle 12c - select string after last occurrence of a character
I have below string:
ThisSentence.ShouldBe.SplitAfterLastPeriod.Sentence
So I want to select Sentence since it is the string after the last period. How can I do this?
0
votes
0answers
44 views
Delete non printable-special characters from SQL
I am using Sybase DB and facing some issues with some tables because of special characters..
I found special characters like: ������ �Y1�0�@�D ��� ��� in one of the tables.
How can I search for ...