Sunday, 15 February 2015

sql server - SQL Update Multiple Rows -


  अद्यतित सारणी SET COL_1 = (SELECT SUM (TOT) से TABLE_2) WHERE CUST_NO = TABLE_2.CUST_NO   

तो, यह मेरा एसक्यूएल अब तक है। मूलतः, मैं TABLE_1 में COL_1 को TABLE_2 में संग्रहीत TOT की राशि के रूप में COL_1 को अपडेट करने का प्रयास कर रहा हूं। मैं इसे दोनों तालिकाओं से CUST_NO पर अपडेट करने की कोशिश कर रहा हूं।

मुझे पता है कि मेरा कोड बिल्कुल काम नहीं करता, लेकिन मुझे यह नहीं पता कि यह कैसे करना है

तो मेरे एसक्यूएल चलाए जाने से पहले TABLE_1 से एक पंक्ति का एक उदाहरण होगा:

  | CUST_NO | COL_1 | | 1000 | नल | | 1001 | नल |   

और टेबल 2:

  | CUST_NO | TOT | | 1000 | 15 | | 1000 | 17 | | 1001 | 13 | | 1001 | 12 |   

और जो मैं अंततः चाहता / चाहती हूं:

TABLE_1:

  | CUST_NO | COL_1 | | 1000 | 32 | | 1001 | 25 |    

यह हो सकता है कि आप क्या चाहते हैं:

  अद्यतित टैबली SET COL_1 = (SELECT SUM (TOT) से TABLE_2 WHERE table_1.CUST_NO = TABLE_2.CUST_NO) से यह मान लिया गया है कि आप सभी पंक्तियों को बदलना चाहते हैं। अन्यथा, इसे आज़माएं:  <पूर्व>  अद्यतित सारणी SET COL_1 = (SELECT SUM (TOT) से TABLE_2 WHERE तालिका_1.CUST_NO = TABLE_2.CUST_NO) जहां मौजूद है (तालिका 1 के द्वारा 1 तालिका का चयन करें WHERE table_1.CUST_NO = TABLE_2 .USUSNONO)   

पंक्तियों को अभी बदलने के लिए जहां तालिका 1 में ग्राहक संख्या तालिका 2 में है।

डेटाबेस के आधार पर, शायद यह व्यक्त करने के अन्य तरीके हैं हालांकि, यह सिंटैक्स अधिकांश डेटाबेस में काम करना चाहिए।

java - Hibernate Criteria with Projections.groupProperty cannot return full hibernate object (ClassCastException) -


I'm relatively new to hibernate and there is a problem adding "separate" restrictions to my hibernate class.

  @Entity Public Category Tagged Offer {Private Long Tag_offers_id; Private string brand; Private long CID; Personal date created_data; // Getter and Setter and more fields}   

Earlier, we were creating a hibernate query as follows:

  Public Detected Works in Build (Last Tag Offer request made) {different taxonomic criteria = Separated Ceritaries. Forbes (Tagged off class); Criterion Add (restriction. Eq ("brand", request.getBrand ())); Criterion Add (restrictions. ("Cid", request.getCids ())); // Sorted by date criteria. AddOrder (property.forName ("createdDate"). Desc ()); Return criteria; }   

This will create the following (working) HQL query:

  Select this_tagged_offers_id as Tag 1_2_3_, this_.brand as brand2_3_, this_ Cid as Cid2_3_, created in this_.created_date form 6_2_3_ site.tagged_offers this_ where this_.brand =? And this_.country_code =? And in this_.cid (?,?) The order by the _.created_date desc border?   

Here comes the tricky part. Now we need to ensure that the results are given which are different on the 'CID' field. Meaning, return as many results as possible, a specific CID can be made available in each record.

I saw it in SQL, and it seems that the easiest way to do this is to simply hibernate in a 'group by CID' query, in terms of norms, what I basically do Trying to:

  Creating a Public Separation Classification (Last Tagged Offer Request) {Separate Criteria Criteria = Different Classification. Class (tagged operator. Square); Criterion Add (restriction. Eq ("brand", request.getBrand ())); Criterion Add (restrictions. ("Cid", request.getCids ())); // Sorted by date criteria. AddOrder (property.forName ("createdDate"). Desc ()); // ** new ** different criteria criteria .Setprogication (projection groupProperty ("cid")); Return criteria; } It creates almost the HQ that I am looking for, but later it throws a class cast exception (because it opposes Sid field contrary to the whole object). .  
  Select this YouTube as site0agged_offers as y0_, where it_.brand =? And this_.country_code =? And in this_.cid (?,?) And tagtype1_.tag_type =? This_med_date desc limit by this_.cid command by group?   

And the exception:

  java.lang.ClassCastException: java.lang.Long can not be put on com.mycompany.site.taggedoffers.dao .   

By any idea how can I use projections to work my way Am I

Get estimates for all the columns you need.

  launch list projection list = projection Projection list (); ProjectionList.add (Projections.groupProperty ("CID")); ProjectionList.add (Projections.property ("tagged_offers_id")); ... Criteria. Launch (projection list);    

ios - How to set mysql_protocol_tcp in Objective C Mysql client -


I downloaded the MySQL source and libraries of Carl Craft and created a MySQL Client Lib for iOS 6. The local mysql database even handled the Blob data well.

The next step was to port in a remote database. After downloading various libraries and tearing my hair, I went looking for a pack solution.

I got the SSH Tunnel Library (FREE 30-day trial - and $ 149 for Chuckack) Have downloaded He also worked for the first time. It was a pleasure after the day and the nervousness of not building, not adding, not compiling, no i386 blah blah blah !!

OK, so here's the kicker. Now I want to work with remote database When I forward 3306 SST ports via a SSIT port 22 to 3306 on a database machine behind the firewall, I now close mysqld, and my host is Local Host Port 3306. There is a slight problem with my SSL

The client's default launch on Unix / Mac machine is to look for socket connections on the localhost.

I get the following error:

Error: Can not connect to the local MySQL server with the socket '/tmp/mysql.sock' (38) < / P>

For mysql I need a TCP protocol option to start, with a command line, it is easy --protocol = TCP.

With an iOS customer, this is not easily obvious. I did a search and in mysql.h we have mysql_protocol_type and constants mysql_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP etc.

The missing knowledge I have, to set programmatically in Objective-C.

is a server object that defines the parameter (server, name, port, user, password) and the next object is a connection object that calls mysql_init (). Does anyone have any clue on this?

BTW: A man of Karl Kraft and Shil, must keep his blood preserved for future generations. They saved me a lot of time.

Thanks in advance.

I took some time to find out with mysql client, if you were 'localhost ', Then this is ////. However if you specify the localhost as 127.0.0.1, then it connects to a TCP protocol equal to --protocol = TCP.

amazon web services - AWS : Accessing Auto Scaling Instances -


I have set up automatic scaling CLI and have also created two groups.
This is some sample output: Description-auto-scaling-example - Title organization- Investment-ID Group- NAME Availability - Region State Status Launch - Description -

  -bash-4.1 # Confidential Insurance i-2aaf0e42 MyGroup_micro us-east-1a InService Healthy MyLC_micro INSTANCE i-88338 C4 MyGroup US-East-1 Insurability Health MyLC   

My problems are: 1. 1. I do not see the above examples in my EC2 dashboard. Is this okay?
2. Can I enter those examples? If yes, then how?

  1. They should appear on their dashboard Occasionally not immediately, but it will eventually show.
  2. Yes, for example get an IP address and log in with the authentication you have configured.

Log a full request URL in IIS -


I am using IIS 8 on my Windows 8 development machine. I am developing an ASP.NET MVC 4 WebAPI-based application, which has interfaces with third party servers.

One of these servers (Kaltura Content Management System) sends a notification that I can not "catch" with my routing and / or controllers to log in to the full request url on IIS I am trying.

I have established IIS Advanced Logging and have configured it to enter all the available fields (except for working counters), but the logs do not have the URL or the content of the request (a form).

My question is, is it possible to log full URLs in IIS?

There is no default way to log all form fields logging everything will be huge enough to go log files very quickly If everything was a way to log viewstate logging and all post fields (if you are uploading a 20MB file)

If you want to support something like this, you will be creating a custom handler or in the website code itself (for example in the master page so that you do not want to add the logging code to each page).

sql server - EF4 insert data via scripts -


I know that by default EF code first sets StoreGeneratedPattern = Identit it's OK. But I want to include some part of the data via the SQL script. I know that at the time only one table can be on the SET IDENTITY_INSERT rules;

But when I try to run

  USE [GameDatabase] GO GO ON ATNSINNLS SET QUOTED_IDENTIIFIER SET - Rules on Game SET IDENTITY_INSERT RulesOfGames; RulesOfGames (RulesOfGameId, MaxScore, IsPossibleEqualsScore) INSERT (1, 20, 1) in values; SET IDENTITY_INSERT RulesOfGames OFF; - Kindsport SET IDENTITY_INSERT RulesOfGames on; Include in prices (KindSportId, Name, RulesOfGame_RulesOfGameId) Value (1, 'ÑÑ ?? Ñ ?? Ð ± оР»', 1); SET IDENTITY_INSERT Consort of Off;   

I get an error and I want to set a specific ID to set up a special argument set.

  Message 8107, Level 16, State 1, Line 3 IDENTITY_INSERT Table 'GameDatabase.dbo.KindSports' is already running for table 'RulesOfGames' SET can not perform action for   

How can I solve my problem?

set IDENTITY_INSERT RulesOfGames; RulesOfGames (RulesOfGameId, MaxScore, IsPossibleEqualsScore) INSERT (1, 20, 1) in values; SET IDENTITY_INSERT RulesOfGames OFF; - Kindsport SET IDENTITY_INSERT type assistance; Include in prices (KindSportId, Name, RulesOfGame_RulesOfGameId) Value (1, 'ÑÑ ?? Ñ ?? Ð ± оР»', 1); SET IDENTITY_INSERT Consort of Off;

applescript - Why is my applescrpt returning 2 msgbox while running the excel macro? -


The following subscription macro is running twice because I receive the message bar twice.

  Run the application "Microsoft Excel" to run VB macro "Test .xlsx! Test ()"   

and test () Macro:

  Sub-testing () MsgBox "This is an Excel macro." Last sub   

I'm getting the message box "This is an Excel macro." It seems twice that it is running twice, why is it going on two occasions with any idea?

I noticed that when an apple is disturbed, it can sometimes run again from the beginning For, usually when it calls some third-party applications.