« first day (1557 days earlier)      last day (2761 days later) » 

9:05 AM
@ARr0w
?
 
what's up man!
how was the weekendd?
 
Grand, took it off and did nothing but relax.
Needed!
Yours?
Did you need to ask me something yesterday?
 
nope just wanted to see chat a little
random.
great!
mine was also all rest.
 
Great!
taking last weekend off means that I can get some work done this weekend
we have a bank holiday so 3 day weekend
 
awesome
 
 
3 hours later…
12:36 PM
Hi
I have the following
CREATE TABLE #TempTabDenom (Denomination CHAR(200))
    INSERT INTO #TempTabDenom VALUES ('abcZa')
    INSERT INTO #TempTabDenom VALUES ('aEurocZa')
    INSERT INTO #TempTabDenom VALUES ('BAa')

    SELECT * FROM randomTable WHERE colname IN (SELECT Denomination FROM #TempTabDeno)
I thought it would make sense but it does not as the selection does not retrieve me, the data I'm looking for...
 
@AndyK what data are you looking for?
also is this SQL Server, MySql, etc
 
this sql server
 
cool, so what are you looking for?
 
I'm looking for data where colname has an exact match in the temp table #TempTabDeno
I thought (mistakenly ?) that the operator in would do what I was looking for
but it does not seem to be the case...
I checked on the net but I did not find anything
 
What's the definition of randomTable?
 
12:44 PM
CREATE TABLE #TempTabDenom (Denomination CHAR(200))

    INSERT INTO #TempTabDenom VALUES ('abcZa')
    INSERT INTO #TempTabDenom VALUES ('aEurocZa')
    INSERT INTO #TempTabDenom VALUES ('BAa')
very simple (or I thought so...)
 
But you're trying to select from randomTable where colname is either 'abcZa', 'aEurocZa', or 'BAa'
and you haven't told us how randomTable is set up or what's in it?
 
yes
 
I think we'll need that to help you out....
 
randomtable is a query I wrote
actually it goes like that
SELECT DISTINCT
PARTPMOR.Denomination INTO #TempTabDenom
FROM ENTREPRISES
LEFT OUTER JOIN ETABLISSEMENTS ON ETABLISSEMENTS.IU_ENTREPRISE = ENTREPRISES.IU_ENTREPRISE
INNER JOIN dbo.BASES ON dbo.ETABLISSEMENTS.IU_BASE = dbo.BASES.IU_BASE
LEFT OUTER JOIN dbo.ETATS ON dbo.ETABLISSEMENTS.IU_ETAT = dbo.ETATS.IU_ETAT
LEFT OUTER JOIN dbo.NAF ON dbo.ETABLISSEMENTS.IU_NAF_ECO = dbo.NAF.IU_NAF
LEFT OUTER JOIN CODES_JURIDIQUES ON ENTREPRISES.IU_CODE_JUR = CODES_JURIDIQUES.IU_CODE_JUR
INNER JOIN  dbo.SITES ON dbo.ENTREPRISES.IU_SITE = dbo.SITES.IU_SITE
Then the query
SELECT DIRIGEANTS.REP_LEGAL,actu
CASE  WHEN DIRIGEANTS.IU_PART_PM is NULL  THEN COALESCE(CASE PARTPPHY.TITRE WHEN 1 THEN 'Monsieur ' WHEN 2 THEN 'Madame ' WHEN 3 THEN 'Madame ' ELSE '' END +
CASE WHEN CHARINDEX( ' ', LTRIM(PARTPPHY.IDENTITE)) > 0 THEN
        UPPER(LEFT(LTRIM(PARTPPHY.IDENTITE),1))
        +LOWER(SUBSTRING(LTRIM(PARTPPHY.IDENTITE), 2, CHARINDEX( ' ', LTRIM(PARTPPHY.IDENTITE)) - 1 ))
        +SUBSTRING(LTRIM(PARTPPHY.IDENTITE),CHARINDEX( ' ', LTRIM(PARTPPHY.IDENTITE) ),DATALENGTH(LTRIM(PARTPPHY.IDENTITE)))
@Shaneis you've got everything
 
okay...so let's break this down...
does it work if you remove the `AND PARTPMOR.DENOMINATION IN (SELECT * FROM #TempDenom)` ?
great, and is there something in that result set that is in #TempDenom as well?
 
12:51 PM
yes it does work
In #tempDenom, there is actually 4 lines
 
okay...and are any of those lines in the result of your query when you don't include AND PARTPMOR.DENOMINATION IN (SELECT * FROM #TempDenom)` ?
 
ok @Shaneis we've moved closer
actually I was trying to go for the NOT IN
the IN after your comment, is working fine
the NOT IN is not doing what it is supposed to do
how come...?
 
is there a NULL?
 
in the temp table ?
no null there
 
in either I suppose
 
12:56 PM
no null in the query and in the temp table
 
so it sounds like every single PARTPMOR.DENOMINATION is in the #TempTabDenom then?
 
only 4 of them
When I go for the full query, I have 14 rows
I have 4 rows in the temp table
I want to make sure that the 4 rows of the temp table are excluded from the full query
which should make 10 rows
yet, when I'm running a NOT IN, I have only 2 rows
 
and not exists (SELECT * FROM #TempTabDenom WHERE denomination = PARTPMOR.DENOMINATION)
try that instead of your not in
 
yeah. I like it
 
does it work?
 
1:00 PM
it worked. How come?
 
hmmm pity but I can't figure out your problem without seeing the data
but at least you have a workaround
what the above is doing, is grabbing your PARTPMOR.DENOMINATION
 
what's the difference between the exists and the in...? Thought it was close to the same thing...
 
checking if that exists at all in the Denomination column of the temp table
and if a true is returned, excludes it
very close to the same thing
but NOT IN has some weird aspects with scanning the whole table and NULL checks and the like
 
I did not experience the exists before ...
do you want me to put a question on SO , in case you want the points...?
 
Nah I'm grand, if you spot a question like it though, feel free to answer and see if it helps you
you never know you may be able to help someone out later on :)
 
1:04 PM
I will. Many thanks for your help, I was truly lock
 
No worries, best o' luck @AndyK
 
cheers @Shaneis. Beers on me if we meet one day
 
haha deal!
 
1:22 PM
haha
andy k
why don't you stick around here :P
with me and shaneis.
 
1:58 PM
I'm here @ARr0w
you guys do not have a lot of fun around... (or it seems)
 
yeah, cos, we're mostly not around.
\but we do talk time to time.
it is because of not much of people here.
 
I see
 
if people start staying around will make this channel alive.
i hung around here, because, i find shaneIs is a appreciable person and a friend that is what i see him as.
hang*
 
let's give some notoriety to that channel
btw
have you heard of the socvr...?
maybe we can implement one here ...
 
@ARr0w No I'm an a$$h*le, I just hid it well
@AndyK what is it?
 
2:13 PM
yes, you are @Shaneis
 
basically, it can retrieve all the questions that are duplicates... Some rooms like the GMT ones has one
it is quite impressive
 
@AndyK seems pretty cool, I'd try anything out once
 
Let me ask a few questions here and there , on how to implement that
I enjoy SQL actually
 
2:28 PM
@kendall-frey are you still around SO?
 
2:47 PM
Hi, I have question which need to be debate, as I am struggling normalising properly my schema and i would like some opinion
One table is Request with RequestId and RequesTypeId, etc..
One table is Cancellation with OriginalRequestId and ReasonId, etc...
One table is CancellationReason with ReasonId, RequestTypeId, Value etc...
How can I enforce Cancellation table to have reasonIds valid for the particular request associated?
so far I have found no way except to duplicate the requestTypeId in the cancellation table
to allow a foerign key constraint
Any opinion on this?
 
what DB are you using?
 
using SQL Server, but I would prefer to avoid triggers
if it's what you're implying
 
I was thinking more along the lines of CHECK CONSTRAINTS
or even another table to join onto
 
Do you mean creating a function with a subquery to be called in a check constraint?
 
hii
 
2:59 PM
Not sure to understand what you are suggesting with the join solution?
 
imgetting fill all fields in php
this is my php code
<?php

$name = $_GET['name'];
$phoneno = $_GET['phoneno'];
$state = $_GET['state'];
$district = $_GET['district'];
$mandal = $_GET['mandal'];
$gramapanchayath = $_GET['gramapanchayath'];
$village = $_GET['village'];
$farmsize = $_GET['farmsize'];
$irrigated = $_GET['irrigated'];
$rainfedarea = $_GET['rainfedarea'];
$adhaarcard = $_GET['adhaarcard'];

if($name == '' || $phoneno == '' || $state == '' || $district == '' || $mandal == '' || $gramapanchayath == '' || $village == '' || $farmsize == '' || $irrigated == '' || $rainfedarea == '' || $adhaarcard == ''){
thanx in advance
 
@LeBaptiste I'll try to create sample data for a proof of concept
 
ok thanks for your time
 
hello any help plz
please
 
@user6631959 Don't know PHP, sorry
 
3:04 PM
kk
 
@user6631959 this is a sql room... if you're looking for php, this room will be your gate to salvation -> chat.stackoverflow.com/rooms/11/php
@user6631959 before anything, think well to format your code with ctrl+k
 
btw @user6631959 those are the rules you will need to follow to get answers to any of your questions -> odedcoster.com/blog/2010/07/28/…
tip 8 and tip 13 are definitely a must-follow
 
If I have to duplicate the RequestType in the Cancellation table to enforce the constraint on ReasonId value, then I will do it, just wondering if there's a "most satisfying" way. Would you suggest more complex check constraint instead of a duplicate column, what do you think of this trade of? Or maybe another normalisation of the tables?
 
Actually I got i to work with another tabel with valid reasons and a foreign key constraint
CREATE TABLE [Valid_reasons]
(
	[request_id] int,
	[reason_id] int,
		CONSTRAINT [PK_ValidReasons] PRIMARY KEY ([request_id], [reason_id])
);

INSERT INTO [Valid_reasons] ([request_id], [reason_id])
VALUES (1, 1), (1, 2), (2, 1), (2, 3);
-- Request 2 with a Reason 2 is not allowed.

SELECT * FROM [Valid_reasons]

CREATE TABLE [Cancellations]
(
	[cancellation_id] INT IDENTITY(1, 1) CONSTRAINT [PK_Cancellations] PRIMARY KEY,
	[original_request_id] int,
	[reason_id] INT,
		CONSTRAINT [FK_OriginalRequestIDReasonID]  FOREIGN KEY ([original_request_id], [reason_id]) REFERENCES [Valid_reasons] ([r
clean up afterwards
DROP TABLE [Cancellations], [Valid_reasons]
@LeBaptiste let me know if you have questions when you read it
 
3:20 PM
Yes thanks, I am reading :)
My question would be the reason is not on a specific request id but on its type
 
okay...how do you know what type it is
 
the Request table has RequestId and TypeId
the cancellation can be on many type
 
then would it not be a case of changing the key from request_id to type_id?
that should work I think?
so the key would be type_id, reason_id
 
in the cancellation, yes I agree
but I feel pity to have redundant info, since cancellation has already the original request id
and know from it what is the type id
but It looks like to be the only sensible solution
 
maybe, maybe not...
don't take something if you are not happy
if you think there is a better answer then you don't have to settle for one
keep looking :)
it may be a long search but there could be something
 
3:27 PM
ok thanks for your time @Shaneis
 
No problem @LeBaptiste
 
I would go for this option, it has the advantage to be KISS, I will always have the time to renormalise if not enough satisfying
 
@LeBaptiste haha you don't do Powershell do you? that sounds like a Laerte Junior Quote
 
Very few PowerShell, but I often regret to try to always find a better way, so refraining myself is sometimes good ;)
 
@LeBaptiste yeah I can respect that
 
3:46 PM
bye @Shaneis , @ARr0w & @LeBaptiste
 
See ya @AndyK
 
See you @AndyK
 
4:04 PM
see ya around budyd
 
I'm off too, see ya @LeBaptiste, @ARr0w
 
alright man
takecare!
 
4:46 PM
@Shaneis see you
 
 
3 hours later…
user1881400
7:51 PM
Does the SQL standard set the character encoding for strings, and if so, what is it?
 
user1881400
I will have to ask a question on Stack Overflow otherwise because I can't find anything with Google; it's all about SQL Server, and I don't want to shell out $200 for the specs to see if they mention a constraint on character encoding.
 

« first day (1557 days earlier)      last day (2761 days later) »