Menu
  • HOME
  • TAGS

How to get column values in one comma separated value without using XML path and temporary variable

sql,comma,temporary

CREATE TABLE [dbo].[Cities]( [Id] [int] NULL, [CityName] [varchar](50) NULL ) ON [PRIMARY] INSERT INTO [dbo].[Cities] ([Id],[CityName]) VALUES (1,'New York'), (2,'Miami'), (3,'Orlando') GO DECLARE @listStr VARCHAR(MAX) SELECT @listStr = COALESCE(@listStr+',' ,'') + CityName FROM Cities SELECT @listStr Edit: Also read this post, it contains several approaches in which you can achieve...

Temporary storage for Azure WebSites

caching,azure,windows-azure-storage,azure-web-sites,temporary

You could store the processed content on Azure Blob Storage and serve the content from there.

creating postgresql temporary tables for search / reporting routine

sql,postgresql,lua,temporary

Just use: CREATE TEMPORARY TABLE temp1 AS ... This solves both questions #1 and #2 because: Temporary tables live in a namespace that's private to the session, so when concurrent sessions use the same name for a temporary table, it refers to different tables, each session its own table. TEMP1...

Temporary table in PostgreSQL

function,postgresql,temporary

You can only DECLARE variables. The CREATE TABLE (ddl) statement can only be run between the BEGIN - END blocks....

C conditional increment

c,condition,increment,temporary

Yes, b=0 now. And the decrement is permanent within the scope of the function you have defined b in.

Managing the memory footprint of temporary variables in PHP

php,memory-management,guidelines,temporary

Putting this here since it's too long for a comment: The only time you'd really want to force-free something in PHP is in between long-running sections where temp data from one section isn't needed anymore, but also would cause the unused data to remain in-scope for a while, e.g. function...

Using SQL temp table inside of select query

mysql,sql,database,inner-join,temporary

The subquery needs an alias name otherwise it won't work. This returns 1 : SELECT test from -- or fully qualified : aliasname.test (SELECT 1 as test) aliasname WHERE test>0 So I presume you require something like : mysql_query("SELECT something_1, something_2 . . . FROM (SELECT table1.something_1, table2.something_2 . ....

Generating a Temporary url in Python

python,encryption,hash,hyperlink,temporary

The problem was not being able to putout a normal string because the encryption will result in characters that are almost impossible to encode, so the solution is to use binascii to encode the bStrings for us and decode them import binascii then we encode the resulting usable string for...

Why is the lifetime of an object “that is the complete object of a subobject” extended when the subobject is returned?

c++,c++11,reference,temporary

How about following the constructor and destructor of your object #include <string> #include <iostream> class string_like: public std::string { public: string_like(const char* str): std::string (str) { std::cout << "string_like() : \n"; } ~string_like() { std::cout << "~string_like(): \n"; } }; char const * foo() { std::cout << "in foo(){} :...

Getting Input from a Function - c++ [duplicate]

c++,function,variable-assignment,temporary

change your method signature to accept the address of the variables "&" void Input(string &a, string &b) without the "&" operator you are just sending copy's of the variable into the function, with the "&" address-of operator you are passing the variables by reference...

C: Performant temporary variables to avoid frequent typecasting

c,performance,variables,temporary

Compilers are pretty good at optimizing. I think you would have no problems with: My_LengthilyNamedClass *const ptr = this; If you are really paranoid you could use a macro: #define THIS ((My_LengthilyNamedClass *)this) THIS->someMember = 5; #undef THIS ...

temporary variables in a python expression

python,functional-programming,temporary

This isn't really idiomatic code, but for single expressions you can use lambdas that you immediately invoke. Your example would look like this: >>> b, c = 2, 3 >>> (lambda a: a * (a + 1))(b * c) 42 You can also write this using keyword arguments if that...

Generate the Cartesian Product of 2 vectors In-Place?

c++,string,vector,temporary,cartesian-product

You may try the following approach #include <iostream> #include <vector> #include <string> int main() { std::vector<std::string> final{ "a", "b", "c" }; std::vector<std::string> temp{ "1", "2" }; auto n = final.size(); final.resize( final.size() * temp.size() ); for ( auto i = n, j = final.size(); i != 0; --i ) {...

Where is the temporary object stored? [duplicate]

c++,object,temporary

It's stored on the stack, not the heap. Note however that std::string probably makes use of the heap.

Having multiple cases in a select

mysql,sql-server,select,case,temporary

Mysql equivalent for this is: CREATE TEMPORARY TABLE tblWU AS SELECT ReqN, MAX(IF(rk=1, WU, NULL)) WU1, MAX(IF(rk=2, WU, NULL)) WU2, MAX(IF(rk=3, WU, NULL)) WU3, MAX(IF(rk=4, WU, NULL)) WU4, MAX(IF(rk=5, WU, NULL)) WU5, MAX(IF(rk=6, WU, NULL)) WU6, MAX(IF(rk=7, WU, NULL)) WU7, MAX(IF(rk=8, WU, NULL)) WU8 FROM ( SELECT ReqN, WUnit, (...

Disable Task manager temporarily on log on

html,vbscript,temporary,taskmanager

To disable the task manager you should try this code : Call DisableTaskMgr '-----------------------------DisableTaskMgr------------------------------------- sub DisableTaskMgr Dim WshShell,System System="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\" Set WshShell=CreateObject("WScript.Shell") Wshshell.RegWrite System, "REG_SZ" WshShell.RegWrite System &"\DisableTaskMgr", 1, "REG_DWORD" end sub And to enable it again just you do like that: Call EnableTaskMgr...

Oracle SQL - Creating A Temporary Table Then Union To That Table

sql,oracle,temporary

Try this: WITH tmp2 AS (SELECT * FROM prod_trkg_tran ptt WHERE ptt.menu_optn_name = 'RF Split/Comb {Carton}' AND ptt.cntr_nbr = '0031195609' ) SELECT * FROM tmp2 UNION SELECT * FROM prod_trkg_tran ttp INNER JOIN tmp2 ON ttp.tran_nbr = tmp2.tran_nbr WHERE ttp.menu_optn_name = 'RF Split/Comb {Carton}' AND ttp.cntr_nbr <> '0031195609' ...

Redirect a single dynamic URL with Apache .htaccess to temporary page

.htaccess,url,redirect,dynamic,temporary

Your rule should work fine. Just append ? at the end of target URI to strip off existing query string: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com$ [NC] RewriteCond %{QUERY_STRING} ^Itemid=230$ [NC] RewriteRule ^$ http://domain2.com/temoporary-solution.html? [R=302,L] ...

Is there a way to be sure that a const reference stored in class will always refer to a valid object?

c++,reference,temporary,object-lifetime,anonymous-objects

No, there is not. Remember that references are pointers under the hood, and normally don't control the lifetime of the object they reference (see here for an exception, although it doesn't apply in this case). I would recommend just having a B object, if this is in a piece of...

SQL Server: Filter by layers … Need help or advise

sql-server,join,filter,left-join,temporary

You have to use IS NULL expression to check if parameters are nulls and if so do not filter by them. Try something like that: where (@p_parameter1 IS NULL OR tb1.somefield like @p_parameter1) AND (@p_parameter2 IS NULL OR tb2.somefield like @p_parameter2) AND ... ...

Fortran runtime warning: temporary array

fortran,warnings,gfortran,temporary

One way is to pass an assumed shape array real(real64),intent(inout) :: flx_est(:),flx_err(:) the other is to exchange the dimensions of your array, so that you can pass a contiguous section of the 2D array. call combflx_calc(flx_est(:,i),flx_err(:,i)) The problem is that the explicit size dummy arguments of your procedure (var(n)) require...

Find out implementation type of input interface

java,interface,temporary,implements

First, please don't use Raw Types. Second, I don't think you can but you could make a temporary variable of Comparable. Something like, static <T> void sort(Comparable<T> A[]){ if (A == null || A.length == 0) { return; } Comparable<T> temp = A[0]; // ... } ...