« first day (1830 days earlier)      last day (2488 days later) » 
04:00 - 14:0014:00 - 17:00

user7912927
4:43 AM
morning all :)
 
user7912927
monday :((((((((((((((((((
 
5:37 AM
hi
 
user7912927
hello @Erum
 
helo
SQL invitation
 
user7912927
yeah...If you got any doubts regarding SQL ,you can ask here :)
 
Sure
 
user7912927
do you work in SQl server?
 
5:39 AM
nope
 
user7912927
which stream ? SQl,java,dotnet..?
 
java with SQlite in android platform
 
user7912927
okay :) you can ask doubt regarding sql queries here
 
user7912927
Where you from ? @Erum
 
6:06 AM
pak
 
user7912927
oke :)
 
6:47 AM
hi @Nias
 
user7912927
hello @AnamikaRathore
 
wazzup
why did you invite me here :)
I don't remember answering any SQL questions :P
 
user7912927
its a group of people who works in sql
 
user7912927
Do you work with SQL queries? @AnamikaRathore
 
not really
I'm a grad student
I know some sql, but no professional expertise
I'm not sure I'll be of any help to you :(
I know more Android
 
user7912927
6:52 AM
oooh :) its okay!
 
user7912927
may be after my current project..i ll be turning to android
 
user7912927
will c ya then! :D
 
sure
and get scolded there sometimes :P
 
user7912927
i checked it..but its messed up there :(
 
6:54 AM
messed up?
how?
 
user7912927
i mean..lots of ppl n lots of questions...really messed up..u know
 
:/
I don't know...I like it there :)
once you get a hold of how people ask questions, I guess you won't feel so confused there :)
 
user7912927
do you have enough reputation to create a new room?
 
I have 71
how much do you need to create a room?
100?
 
user7912927
lemme check
 
user7912927
6:58 AM
ooh...u need 100 reps
 
okay
then I don't have enough rep :P
 
user7912927
lemme check if there is an free room available :)
 
user7912927
*any
 
isn't this free?
 
user7912927
this group if for sql..lets not make this messed up :P
 
7:00 AM
okie...
 
user7912927
@AndyK gm :)
 
7:44 AM
hi @Nias
how's tricks?
 
user7912927
trick wrkn very well :)))
 
cool
where are you physically located Nias?
 
user7912927
kerala,India
 
user7912927
wbu? @AndyK
 
War
8:07 AM
@Sami lmao ... quality question that
morning all
 
Is it possible to save a SQL querie into a variable?
in MySQL
 
War
yup
either as a string or an expression tree
or do you mean the results?
 
e.g. does something like this work:
myvar = (SELECT * FROM users WHERE pid=20);
the results
 
War
just execute the query
when you say MySQL ... you are talking about the DB server, if you want results in in your app you need to write code for that in something like php or C#
 
yes i know, but I thought it is possible to declare variables in MySQL and then reuse them, is that possible?
I was not able to find a tutorial about variables and MySQL
e.g.

myQuerie = (SELECT uid
FROM fe_users
WHERE pid=0
AND deleted=0
AND disable=0
GROUP BY username
HAVING COUNT(username) > 1)

DELETE FROM fe_users
WHERE uid IN myQuerie;
 
War
8:18 AM
Do you mean you want to pass a parameter to the SQL query from your code?
 
basically I try to declare a variable in MySQL and reuse it in MySQL
 
War
declare @myVar int = 1234;
select * from Table where Col1 = @myVar;
 
ah so this is how it works :) thx. I will try it out
Is there a datatype for array in MySQL?
 
War
normally youd declare a table var
I don't think you can just declare a string array or int array or whatever
 
@War Sure. I was in a confference this week, the presenter was from google and he shown us new google platforms which support this technology with great functionalities.
 
War
8:26 AM
@Shaneis or @AndyK seem to be a bit more knowledgable than me on SQL though
 
@War hmm, I think what I try is not possible
 
War
I tend to avoid it in favour of using LINQ to ask SQL questions
@gtzinos It looks quite interesting ... I've also got one ear to the ground for cosmos DB ... have you seen that?
 
hey @War
sorry
bit swamped
 
basically my SQL Querie returns a list of some integers (UID's), I tried to store them into the variable, but I think MySQL is not able to do so. @War
 
War
moring @AndyK
np
@Black just select them
 
8:28 AM
morning mate
 
@War Not yet. I will check it.
 
War
select myIntCol from Table
 
But I try to store them to a variable
 
Now with this changes on my .net core app, i have a better performance when i get data from database
 
War
you don't need to
@gtzinos nice
 
8:29 AM
Good morning all
 
War
@Black you cant treat SQL like C# / other programming languages
it's purely for querying
 
@Erum What are you doing here?
 
War
@Sami morning
 
@War, ok I see, I thought so because some commenter on this post (stackoverflow.com/a/45498/4684797) asked why the Answer poster does not store the return value in a variable. Thank you for your time to explain!
 
hey Sam
 
8:33 AM
hey Andy :) morning
 
War
@Black cool :)
 
@War sleepy or what?
 
War
eh?
 
You have a lot of pings
& you don't respond
 
War
Just sat down with my first coffee of the day ... I feel like if today carries on like this it's gonna be busy
I topped 5k rep though :)
 
8:42 AM
hello
 
War
I'm not allowed to review stuff for a couple of days though
I got some wrong :(
 
@War Go to rad
 
War
@AdiMohan hi
 
can anyone help me with a syntax, it's been driving me crazy for the last couple of hours
 
user7912927
give it
 
War
8:43 AM
@AdiMohan syntax ... na we only break things in here
fixing stuff is for real pros
 
I'm trying to acomplish the following . I'm inserting my information from an INNER JOIN (from two tables) into a NEW third table, but i also want to make sure that i don't have any duplicates
the insert into, with the inner join, i've got it, but the duplicates not so much
i don't really know how to add an IF NOT EXISTS statement in my syntax
 
Morning
 
War
@AdiMohan ok show us what you have so far
@CrashBandicoot morning
 
@War hi
 
hi @crash
 
8:53 AM
@AndyK Hi
 
INSERT INTO [db_owner].[Test] (Linie, Model, [Descriere Semifabricat], [Cod Semifabricat], Artwork, Quantity, [Cantitate / Vitrina], Target, [Data Inceperii])
SELECT [db_owner].[DeschideLot].Linie as 'Linie',[db_owner].[DeschideLot].Model as 'Model',[db_owner].[MaterialAdaugate].DescSMF as 'Descriere Semifabricat',[db_owner].[MaterialAdaugate].CodSMF as 'Cod Semifabricat', [db_owner].[DeschideLot].Artwork as 'Artwork', [db_owner].[DeschideLot].QTY as 'Quantity',[db_owner].[MaterialAdaugate].CantNecesara as 'Cantitate / Vitrina', [db_owner].[DeschideLot].Target as 'Target', [db_owner].[Desch
 
War
how do you define "exists" ?
 
aaa i'm not sure what you mean by that
i need a "if not exists" clause in here
but i don't know how to go about it
 
War
ok but how can the system determine IF NOT EXISTS == true
or let me put it another way ...
 
Shit!
 
War
8:58 AM
Insert ...
INSERT INTO [db_owner].[Test] (Linie, Model, [Descriere Semifabricat], [Cod Semifabricat], Artwork, Quantity, [Cantitate / Vitrina], Target, [Data Inceperii])
... from set ...
SELECT [db_owner].[DeschideLot].Linie as 'Linie',[db_owner].[DeschideLot].Model as 'Model',[db_owner].[MaterialAdaugate].DescSMF as 'Descriere Semifabricat',[db_owner].[MaterialAdaugate].CodSMF as 'Cod Semifabricat', [db_owner].[DeschideLot].Artwork as 'Artwork', [db_owner].[DeschideLot].QTY as 'Quantity',[db_owner].[MaterialAdaugate].CantNecesara as 'Cantitate / Vitrina', [db_owner].[DeschideLot].Target as 'Target', [db_owner].[DeschideLot].DataIncepere as 'Data Inceperii'
FROM [db_owner].[DeschideLot]
... if exists ....
WHERE ?????
^ should solve your problem
 
ok so it's supposed to insert the info into the new table if an entire row doesn't already exist
that's what i'm aiming for
 
War
No i think you're missing what i'm trying to say ...
if I have 2 rows
one from the table you are adding to and another from the set you're inserting
how do I determine if they are the same row?
surely you don't want to have SQL compare every column?
 
if in the table i'm inserting to i already have a row exactly the same as the one I'm trying to insert now
 
War
I c
 
so i cant have two rows with the same exact info in my new table
 
War
9:01 AM
normally the logic would involve comparing a key or a couple of col vlaues
you want to compare the whole row
that's extremely inefficient
it's not impossible ... but will be slow ...
71
Q: SQL Server Insert if not exist

Francisco CarvalhoI want to insert data in my table, but insert only that doesn't exist in my DB! here is my code: ALTER PROCEDURE [dbo].[EmailsRecebidosInsert] (@_DE nvarchar(50), @_ASSUNTO nvarchar(50), @_DATA nvarchar(30) ) AS BEGIN INSERT INTO EmailsRecebidos (De, Assunto, Data) VALUES (@_DE, @...

 
well the database it's self will not be huge but i can't think of any other way i can go about this
 
War
there are ways you can create a sort of "upsert" statement in SQL ...
 
I've tried that one already
I'm gonna go back to the drawing board
but thanks alot :D i'm sure i'll find something soon
 
War
it's hard to solve this easily as you are saying that 2 rows are equal when all column vals are equal
generally this is not the case
there is ususally lesser criteria
 
9:58 AM
Guten Morgen everyone
 
hey there
 
Hello @AdiMohan
 
which region of germany ar you from? :D
I was assuming you are from germany, my mistake ? :)
 
Nah I'm not German. I've just been up since 3 am so my brain has gone weird, that's all.
 
hey Shaneis
 
10:16 AM
hey @AndyK
 
are you back at work?
 
Just back from holidays, got allowed to work from home but they've changed the VPN so I'm "awaiting" working from home...
 
lol
 
How you getting on?
 
I feel drained
except than that
I'm alive and that's a good feeling to rely on
 
10:23 AM
That's the spirit (sans feeling drained of course)
 
Bank holidays are coming in 2 days and half now
 
Sweet, have ours next weekend. Then payday, can't come quick enough!
 
lunch time!
 
11:05 AM
hey sql gurus
i have a startup idea and wanted to get feedback from you.
it's an ads (it doesn't even contain the name of project), i shared it because i think this is the best way to explain the idea. :)
wtdy? would people be willing to use this kind of product?
the pricing model will be subscription based, either saas or on-premise
 
Hey @burakemre, run it first by @War
then run it by the guys in The Heap chat room over in DBA.stackexchange
you'll definitely hit your target market there
Best o'luck!
 
War
@burakemre isn't this what EF does?
or am i missing something?
 
@war
what's EF?
 
War
Entity Framework (EF) is an open source object-relational mapping (ORM) framework for ADO.NET. It was a part of .NET Framework, but since Entity framework version 6 it is separated from .NET framework. == Overview == The Entity Framework is a set of technologies in ADO.NET that support the development of data-oriented software applications. Architects and developers of data-oriented applications have typically struggled with the need to achieve two very different objectives. They must model the entities, relationships, and logic of the business problems they are solving, and they must also work...
The idea is that by supporting implementations of a LINQ based provider you can layer a relational model on any db model
Gut feeling ... with a bit of work we could probably make this work for even a directory lol
directory where each file represents a table (possibly in something like CSV format)
then using some smarts (defined in the model) control how the files get written to
 
why do you hate dbs @War :'(
 
War
11:16 AM
but the other side of that is that you could potentially layer this on top of a block of ram
@Shaneis I don't ... just SQL is an inferior tech if you need raw perf
but it has it's place (complex model store)
 
ah yeah true but performance! I mean, who wants that!
 
yep, i actually have no idea how entity framework works but this idea is particularly useful for ETL
 
On an unrelated note, it's gettting a LOT better
 
War
right now ... I have a problem ... one of our prod servers is maxing out its cpu usage for long periods during which time we get timeouts when api calls come in
 
you can to this in application level but i'm not sure how one node can handle huge amounts of data
 
War
11:18 AM
I now somehow have to solve this by providing either a bigger server or better code or possibly something like elasticsearch on top of it
 
when you have elasticsearch, how do you process the data on mysql?
 
War
EF7 is quite an improvement (so i'm led to believe)
@burakemre you give it to EF
 
brb, lunch time
 
@war do you mind sharing a piece of code for this use case or a link that i can learn the details of that feature in EF?
 
War
@burakemre for elastic search integration?
 
11:21 AM
nope
 
War
I don't currently use elastic search
 
running a single query that references entities on different databases
 
War
oh that ... I'm not convinced you can, but I built abstraction on top of my models
basically use heirarchy in my expression trees
 
i assume EF has integration for most of the databases / search engines but how can you join/aggregate data on different databases with a single sql query?
@War, you're not convinced that we can build such a query engine?
here is the magic behind it: github.com/prestodb/presto
 
War
no i'm saying I don't think EF does that
I have code that does though
and by abstraction I can do it Generically
 
11:24 AM
yes, you can do this by fetching data independently from different sources and joining it on application level
but that's not fun and requires too much work
that's the beauty of the idea
you can even use your BI tool to run a query similar to the one that i shared
however i'm not sure this is a common problem even though i always suffered from this problem
 
War
ComplexService<T>
{
     IQueryable<T> GetAll<T>() <-- this returns a queryable set of T made up for data in many db's
}
^ I have this working
I do stuff like construct objects containing data from a Lucene index + data from SQL
then return those as queryable sets
 
yes but will it be flexible as SQL?
can you teach the BI team to write this code?
 
War
It only has to serve up an IQueryable<T> and T is defined by me and a few simple rules
so yeh i'd say it's pretty simple
as for teaching BI teams ... no point ... I expose endpoints of T in my odata graph
then I have generic odata tooling that can handle their needs
 
yep, but do you think that this is a common problem, or even e problem? :)
 
War
Yeh I think it's pretty common
but not one you could solve generically
 
11:29 AM
btw, you can even insert data from one db to another -> INSERT INTO mysql.users SELECT * FROM postgresql
 
War
I have solved it gneerically for us .. .but the way we work mightb e very different for the next company
 
yes
i think that this should be easy as writing an sql query
the ETL tools or custom code is too complex
 
War
@burakemre yup doable ... but generally a bad idea ... if you have data in the same format in 2 different data stores you probably have a duplication issue ... replication is a better solution for that
 
and only developers are able to ti
 
War
sounds cool I have to admit ... but near an impossible number of possible solutions
 
11:31 AM
the query was just a demonstration. you can do much better things with it
let's take this one
you have mysql as primary datasource
 
War
I have issues with defining security context across that stuff at the moment linking them all in asingle query could have some really nasty side effects
 
and want to use elasticsearch as a search engine
 
War
such as transactional scopes
 
INSERT INTO elasticsearch.topics SELECT name, queryableentry FROM mysql.topics
 
War
I can do that iwth a bit of simple linq
 
11:33 AM
you can do this one time with simple linq
but the datastores need to be syncronized
think of a cronjob that runs INSERT INTO elasticsearch.topics SELECT name, queryableentry FROM mysql.topics
where created_at between lastcheckpoint and now()
wouldn't it be quite simple?
 
War
await elasticDb.Add(sqlDb.GetAll<Topics>()); <-- async too
await elasticDb.SaveChangesAsync();
scope.Complete();
Seems quite simple to me
 
@Shaneis Hi , are you ok?
 
for basic thing, you can do it with a few lines of code but sql will be quite easy to use, simple to modify and easy to scale
 
War
well ... MS SQL has Integration services if you don't want to get the application layer involved
 
@burakemre Hello! from Turkey
Polat is here :)
 
War
11:35 AM
not sure about MySQL though
 
you will always be able to do it by writing code using your favourite programming language. but wouldn't it be easy to use just SQL?
@war, i wasn't aware of that, let me take a look at it
@Sami Hello!
@war
got it
 
War
:)
 
postgresql has a similar feature called foreign data wrappers
but they're not easy to use and won't support more than a few databases
 
War
MS SQL you can do things like embed .Net code in the db ... and execute it like you would a sproc
 
as i said, there will always be a harder way to do it
but the idea is that you don't have to embed .net code in the db. :)
do you really thing that writing .net inside mysql is fun and maintainable?
 
War
11:39 AM
it lets you process data streams from a source to a destination ... or do more complex things ... I did some data cleaning stuff once that did things like make calls to an api outside of our network as it worked through the data
 
@war, it looks like i won't be able to beat you :D
 
War
@burakemre no it's ugly as hell but once you have that basic idea working you can write a sproc that can then be given a rule and a set of data then write rules in very good maintainable code
 
i agree that this is not magic. you can always find other ways
 
War
@burakemre I'm just addressing your questions with possible solutions already out there
personally I like to see SQL style / LINQ style querying sit on an abstraction
globally
 
but noone can convince that it's easy to maintain .net inside mysql. :(
 
War
11:41 AM
so not just on top of things that have a T-SQL / PL-SQL engine in them but anything
 
just kidding about the beating part. :)
 
War
so pointing at a folder or a dynamic object in ram
 
yes, you can even mount your facebook friends as an sql table. :)
 
War
then just running whatever code I want on it ... treating it like a db
@burakemre yeh exactly that!
 
ah, that's an interesting idea
 
War
11:42 AM
there's an endpoint that exposes stuff as json / xml or something ... go turn that in to a virtual db in code
 
let's say that we have an interface and you implement it to join your custom data sources
 
War
give me "CRUD<T>" on this(anything)
 
yep
 
War
that's basically how I've built most my webstack
 
it looks really cool
 
War
11:43 AM
I have abase interface and I just bolt more implementations in
 
cool
 
War
@burakemre blog.ccoder.co.uk/Post?id=5 <-- example from my blog
 
i'm not used to .net :/
but will definitely read the article
 
War
the language to some extent doesn't matter
it's the concept that's important
 
yes
 
War
11:45 AM
CRUD<T>
 
i gotta go right now, thanks for the feedbacks
i will subscribe your blog!
 
War
k ... later ... good talk :)
I need to get an rss feed up
not done that yet :(
 
using System;

public class Tutorial
{
   public static void Main()
   {
      // write your code here
      string productName = "TV";
      int productYear = 2012;
      float productPrice = 279.99f;

      // test code
      Console.WriteLine("productName: " + productName);
      Console.WriteLine("productYear: " + productYear);
      Console.WriteLine("productPrice: " + productPrice);
   }
}
Start to learn c#
 
Hi all
 
Hi Alex
 
11:56 AM
Hey Sami
 
Sup?
 
Hi, I have an Oracle DB and I'm using it with Entity Framework. I have added new rows in DB using Oracle SQL Developer but EF can't see those new rows. Do you have any idea about why that is?
 
hi @Alex
 
Have you committed the INSERT statement?
Hi Andy
On Oracle, commits are explicit vs. SQL Server Mgmt. Studio, where they're implicit by default
 
oh no I forgot that
Thanks Alex
 
12:11 PM
right on Alex, right on
 
beauty
is there some word more than beauty? to describe the beauty , too much beauty
 
@jason You're welcome
 
@Sami Fascinating?
 
Yeah , It's good
I'm in love
 
Aesthetically pleasing
@Sami Great to hear! :)
 
12:16 PM
My love SQL server
You're so beauty
I love you so much @SQL Server
honey kisses
@CrashBandicoot Yeah ^
 
Lunch time ^^ brb
 
12:36 PM
hey @Sami, yup all good here
Yourself?
 
12:47 PM
Hey Shaneis
 
hey @Alex
 
Hey Shaneis, so so
 
1:12 PM
hello i have table like document
 
Hi
@IbrahimAlsurkhi and?
 
I don't think so
 
04:00 - 14:0014:00 - 17:00

« first day (1830 days earlier)      last day (2488 days later) »