concatenation

MYSQL CONCAT() is failing but I don't know why...

Need some help understanding why my concat() is failing and how to fix it. I've never used concat() but came accross a situation where I needed to get a unit_nbr from another table and concatenate another field to it to make one field in the main select. Here's the CONCAT() I used: CONCAT(b.name, ' - ', unit_nbr) as lease_name The out...

Need to combine lots of files in a directory

I've got 50 to 60 files in a directory that I need to concatenate into a single file on a regular basis. I thought about using notepad++ thinking there was probably a plug-in that would help but haven't been able to find one. Any other thoughts? ...

Howto add a string to the 'type <filename>' DOS command before merging into file ?

Question: I've several text files containing sql create table/column/view/storedProcedure textfiles. Now I want to merge the textfiles into one textfile. I go into the directory, and type: type *.sql >> allcommands.sql Now to problem is I should add the text ' GO ' after every file's content. I can append Go by doing type *.sql >>...

Why does "SELECT DISTINCT a, b FROM..." return fewer records than "SELECT DISTINCT A + '|' + B FROM..." ?

I have a query that's selecting a bunch of fields related to names and addresses of customers but it boils down to: SELECT DISTINCT a, b, c, ... FROM big_dumb_flat_table it returns a bunch of records (10986590). When I replace the commas in the select-list to format it as a pipe-separated concatenated string: SELECT DISTINCT a + '|'...

String Usage in java

Consider am assigning the URL in the code below to a string, say String link = "http://www.topix.com/rss/city/ellensburg-wa"; How should I use the string in the below code instead of the URL itself. Note: am a beginner in java stmt.executeQuery("select url from urls where url='http://www.topix.com/rss/city/ellensburg-wa'"); stmt...

String Catenation in Python

I have this code: filenames=["file1","FILE2","file3","fiLe4"] def alignfilenames(): #build a string that can be used to add labels to the R variables. #format goal: suffixes=c(".fileA",".fileB") filestring='suffixes=c(".' for filename in filenames: filestring=filestring+str(filename)+'",".' print filestrin...

Linq2EF: Concat all values in another table into a string

Let's say I have two entities: Physician Credentials And a physician can have many credentials, such as Dr. Jones can have MD, DO, MPH as credentials. So I need to generate a report via Linq that concatenates the credentials into a single string. For example: from p in Physicians select { p.Name p.Credentials (??? <- concatenat...

mysql inner join statement and memory overuse !

hey guys im running bellow query to fetch from 3 mysql tables and it works fine but it increases memory usage and sometime it takes 10 seconds to start loading the page INNER JOIN table_tags AS ntg ON (ns.tags = '' OR CONCAT(' ',COALESCE(ns.tags,' '),' ') LIKE CONCAT('% ',ntg.tid,' %')) INNER JOIN table_topics AS nto ON (ns.asso...

jquery/javascript concat question

I want to create a jQuery statement that looks like this: $('.total_999').html("something"); However, 999 comes from variable called storeNo. How can I construct this statement dynamically? ...

Java String Concatenation

I have a issue with my java code. i asked the same question yesterday. I got answer but sorry it was my fault. My question is not clear. I have code looks like this: for(i = 0; i < geo.getTargets().length ; i++ ) { if(geo.getTargets(i).getTargetType().equalsIgnoreCase("ProximityTarget")) { final Proxim...

wpf textblock punctuation moves when concatinating

Actually the problem arises only when the second string terminates with a period or parenthesis. It might involve other characters, but none of my sample data uses other punctuation. Here's the background. The app consists of two vertical scroll viewers. On the right are search criteria, on the left a variety of detail lists and fields....

Style: objective c and token concatenation

This is a style question: Because Apple reserves the "_" privatization for its keywords, I was thinking of something along the lines of the following: #import <Cocoa/Cocoa.h> #define _(name) pvt_##name @interface SFMeasureViewController : NSViewController { @private NSTextField *_(label); } @property (retain) IBOutlet NSTex...

C++ concatenate string problem

Why does the following code not work? #include <iostream> #include <string> int main(){ char filename[20]; cout << "Type in the filename: "; cin >> filename; strcat(filename, '.txt'); cout << filename; } It should concatenate ".txt" on the end of whatever filename is inputted Also, when I try to compile it (with g...

Python, string (consisting of variable and strings, concatenated) used as new variable name?

I've been searching on this but am coming up a little short on exactly how to do specifically what i am trying to do.. I want to concatentate a string (I guess it would be a string in this case as it has a variable and string) such as below, where I need to use a variable consisting of a string to call a listname that has an index (from ...

String concatenation does not work in SQLite

I am trying to execute a SQlite replace function, but use another field in the function. select locationname + '<p>' from location; In this snip, the result is a list of 0s. I would have expected a string with the text from locationname and the '<p>' literals. ...

merge two rows and search in

Hi, I've used this MySQL query to get data: SELECT DISTINCT A.*, B.username FROM posts A, members B WHERE B.status=1 AND (A.USERID=B.USERID AND A.title LIKE '%myquery%' AND B.public='1' AND A.type = 'update' ) order by A.ID desc limit 0, 10 this works to search title row, but i need to search into title and msg row, how to "merge" (?)...

How can I store the status in an array after concatenating

Example: (if the status can be: 'done', on_going', 'to_verify') for loop starts here -------- I used $status .= $status; and if I perform echo $status; it will give me 'doneon_goingdoneto_verify' for loop endshere -------- I would want to perform something based on the status like if there's 'on_going' status then set $on_go...

How to concatenate two strings where the source string should be appended before the destination string?

I'm stuck at yet another C problem. How can I concatenate two strings with the second string being inserted before the first string? This is what I came up with. Unfortunately I'm stuck at all these pointer to chars, char arrays et cetera. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[] ) { ...

ruby narray concatenation

Given say 2x3 and mx3 arrays (I have used NArray): how to construct a (2+m)x3 array, the concatenation of each. + or << do not keep the elements properly aligned. e.g. a = [[1,2,3],[4,5,6]] b = [[1,2,3,4],[5,6,7,8]] # should be concatenated as: # [[1,2,3,1,2,3,4],[4,5,6,5,6,7,8]] Thanks. ...

C Macro Token Concatenation involving a variable - is it possible?

Hello, I'm trying to define a macro to generate a token name, containing a variable. Basically, what I'm trying is this: #define GLUER(x,y,z) x##y##z #define PxDIR(x) GLUER(P,x,DIR) int main() { int port; port = 2; PxDIR(port) |= 0x01; } I'm hoping to generate the token P2DIR in the above statement, but according to my compile...