« first day (1775 days earlier)      last day (2543 days later) » 

6:57 AM
hi all, I am trying to load data to external table.But data is not loading because of characterset value. Since data file has UTF-16 format which value should i use for character set?
 
UTF-8
 
UTF-16
 
you are genius
now try that.
 
@ARr0w trying but data is not properly loading
 
7:13 AM
what is the error?
 
@ARr0w while loading extra spaces are padded with actual data.
 
in which database?
oracle?
 
@ARr0w oracle DB
@ARr0w This is my code
CREATE TABLE EX_BOOK_LOCAL
( ISBN_10 VARCHAR2(10 BYTE),
AUTHOR VARCHAR2(70 BYTE),
TITLE VARCHAR2(150 BYTE)
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY "DAT_DIR"
ACCESS PARAMETERS
( RECORDS DELIMITED by "\n" CHARACTERSET JA16EUCYEN BADFILE BAD_DIR : 'BOOK_LOCAL%p_%a.bad' logfile LOG_DIR : 'BOOK_LOCAL%p_%a.log' READSIZE 10485760 FIELDS LRTRIM MISSING FIELD values ARE null reject rows
WITH ALL NULL FIELDS ( ISBN_10 ( 1: 10) CHAR(10) ,AUTHOR ( 11: 80) CHAR(70) ,TITLE ( 81: 230) CHAR(150))
 
@ARr0w this character set value works for utf-8 format not for utf-16.
 
7:26 AM
CHARACTERSET AL32UTF16 ? tried?
actually I don't have any experience of Oracle.
but there is a guy we have here @Shaneis, who is not around right now. He can help you out with this.
 
@ARr0w tried
 
Restrictions Specific to the ORACLE_DATAPUMP Access Driver

In addition to the restrictions just described, the ORACLE_DATAPUMP access driver has the following restrictions:

Handling of byte-order marks during a load: In an external table load for which the datafile character set is UTF8 or UTF16, it is not possible to suppress checking for byte-order marks. Suppression of byte-order mark checking is necessary only if the beginning of the datafile contains binary data that matches the byte-order mark encoding. (It is possible to suppress byte-order mark checking with SQL*Loader loads.) Not
The external tables feature does not support the use of the backslash (\) escape character within strings. See Use of the Backslash Escape Character.

Use of the Backslash Escape Character

In SQL*Loader, you can use the backslash (\) escape character to mark a single quotation mark as a single quotation mark, as follows:

FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\''

In external tables, the use of the backslash escape character within a string will raise an error. The workaround is to use double quotation marks to mark the separation string, as follows:
I hope this might solve your issue.
 
i wanted to have some theoretical knowledge of MVC
Which can be asked in an interview
about mvc.
 
War
I C ... hmmm
I doubt interviewers will ask much besides "have you used it before"
they might then go on to say "could you show us an example"
so maybe have a github repo or running site
or both
 
8:25 AM
morning guys
 
War
morning
 
s'up @War
 
War
tail end of flu today :(
 
shit, sorry man!
 
War
suffering a bit but still came to work
got too much to do
 
8:29 AM
nice Google-fu @ARr0w, but don't really know Oracle
sorry :(
@War yup, figured as much
 
thanks, Shaneis.
Morning dude
 
at least the flu gets you off working on your blog @War
 
War, i know that :p
 
morning @ARr0w :)
 
Get well soon, War.
 
8:41 AM
hey guys
have you seen that? We're going to the american timezone now
 
you mean you and @Alex on here and working late into the night?
I saw. Impressive :)
 
I finished my PRA doc
yesterday eve at 11PM
GF is out of town
so...
 
@AndyK I got no clue what a PRA doc is @AndyK, sorry :(
@AndyK yeah I get ya. I get more work done that way too :D
 
DRP = PRA (French)
 
@AndyK ah deadly! of course!
congrats man!!
 
8:53 AM
thanks man
 
 
2 hours later…
10:38 AM
@Shaneis
I need a bit of advice, pls
 
s'up @AndyK
?
 
let's say I have a query
that's acting like a dynamic query
without index
it takes up to 10mn, for around 10k lines
and the more lines, the more times it takes
let's say I need to look on the behind scene
1) do an explain plan of the query
 
@AndyK explain plan? this Postgres, MySQL, Oracle?
 
postgres
what else can you think of to try to improve perf on a query?
coming back in a bit
 
I don't really know man with Postgres
make every data set as small as you can
only bring back what you need
check out the stats with EXPLAIN
basically everything that you already know
sorry @AndyK, not much help here I think :(
 
 
1 hour later…
11:50 AM
Hi all
 
hey @Alex
busy night ;)
 
Hey Shaneis
Yeah, we had some challenging questions
 
War
12:44 PM
@ARr0w @Shaneis thx guys :(
meetings and complexity as always
 
no worries @War!
....for what?
 
War
well I made the stack smarter because the boss kept asking for stuff that wasy complex to do
now he wants it to do more complex stuff
 
@War yay!
 
Once they know you're smart, they'll hit you with ever more complex requirements
 
War
so I got to the point now where workflow is transactional and sits inside everything ... now I have workflow processes executing workflow processes in heirarchies, each is transactional
so I can build out entire business processes that span hundreds / thousands of companies and either have everything happen or none of it
and SQL now starts complaining about concurrency issues
so now I need to find a way to resolve concurrency exceptions in EF and pass up a "possibly handled result" to the calling service that may be a child of aworkflow execution that may be a child of a process that may be a child of another process
all in ... this got messy fast
it gets worse when you consider each of these pieces can happen on a different networked server depending on a bunch of complex criteria
 
12:51 PM
war, i asked the concept topics of mvc :P
such like concept of OOP is questioned to us
 
War
@ARr0w yup you did ... did I not answer everything ?
 
no bro.
I can have running site.
 
War
I've come to the conclusion that you need to know the basics (about code structure and language, ect) then some medium level stuff (like patterns and practices) and then you just need to show you have done it and can do it
 
yo
 
War
so I just built stuff
 
12:53 PM
ohhhhhhkay
now you answered it good
 
@War Crazy complex!
 
War
then I take that stuff with me wherever I go, my web stack and core gaming architecture just comes with me
@Alex yeh it's gotten stupid now for no other reason than it can
I seriously doubt it needs to be this complex
so I'm working a system that can allow the user through a webpage to build a business process and the system will worry about how exactly it's implementation works
 
Rafactor to simplify, if possible
 
War
well yeh ... the recetn rejig retired about 20 projects
I only have about 40 all in now for everything and they are all in one relatively small solution
 
If I'm right in code, I can't see the forest for the trees. Six months later, I can think of all kinda ways to improve/refactor
 
1:05 PM
morning
hey @War & @Alex
 
Hi Andy
 
Morning? @AndyK I know for a fact that you are an hour ahead of me :)
 
Wrote a loop in PHP to an INSERT on the first round and then to do UPDATES on any following runs. However what happens is the first round works great, everything is inserted as should be. The following round it will update the very first item, and then it will INSERTS for the rest of the loop, but it will always re-insert the very first item. Like, if I had [a,b,c]. Run 1 = [a,b,c] in db. Run 2 = [a,b,c,a,a,a]
Code is in PHP, but maybe I am doing something with sql? pastebin.com/1tMFuJvf
 
War
@AndyK hey @AndyK how goes it :)
 
@Austin Instead of running the query, write it to the screen using a print statement in the loop. See what it looks like. It's doubtful it's SQL giving you trouble; more than likely the loop
 
1:12 PM
@Alex Yea I am just not sure why? So if you see in the code segment if I find count == 0 I print INSERTING, if its not 0 I print UPDATING. THe first round is all INSERTING, the second round is UPDATING, INSERTING, INSERTING, INSERTING...but I have no idea why it is inserting. Maybe I do not fully understand the sqlsrv_num_rows?
I presume my first query is looking to see if I have this row already. If the request fails (to db) then I just say it failed to reach db, otherwise I presume $count = sqlsrv_num_rows($requestCheck1); would tell me if that row exists or not. Is that correct?
 
It's been years since I've worked with PHP. All that comes to mind is printing the actual UPDATE/INSERT statements to see what values they're passing
 
yup, yea thats the other weird thing, the second round seems to only update/insert the first item N times xD
 
I'd recommend an SO question on that. Bet someone can quickly note what's wrong
 
hey @War
just starting to have dust settling down
 
War
1:27 PM
nice :)
you still having team problems?
 
1:56 PM
alright guys
later, takecare.
 
See ya, ARr0w
 
Hi @Alex
Did 007 ever figure out what the issue was?
 
see ya @ARr0w
 
@JamieLester Not sure. He signed off of here last night
 
2:18 PM
hey there guys may I ask perhaps a stupid question
 
Go for it
 
okay I have a table, sqlite flavor, and I want to create an array column, ofc thats not possible so I thought the following. Should I create another table having the desired data, and (the part I dont know how to do), call it from the other table normally
c.execute("CREATE TABLE first_table(id INTEGER, text LONG, additional fields)")
c.execute("CREATE TABLE second(id INTEGER, num INTEGER, ..data..)")
first_table data = ex: id=10, text=example, my_other_table
second data = ex: id=10, num=row_id, data
something like this is waht I want
 
Hi @nonerth, what language is that?
 
nodejs
 
Ahh never seen it before
 
2:26 PM
its the same thing with every language
using sqlite
or SQL fot that matter
 
The SQL part is yeah
You'll want to have two tables
 
so did you understood my problem
 
When you say array column, what are you trying to accomplish?
 
yes
Basically what I want is each and every user/id have a different table with many rows and columns containing some other data
 
What info is the array column storing?
 
2:30 PM
uhm it'll be storing strings and integers
 
That doesn't sound like a good database structure... to have a table for every user
You'd have one table for the users
Then another table with the UserId and other information about them
 
yeah actually I was thinking about that, its not good to do that yeah
 
UserId is the primary key from the Users table
 
okay I get it,
I'll a look a bit more into it
 
So UserId is a foreign key on the second table
 
2:34 PM
yeah its not the primary
 
2:44 PM
Hi
Does anyone know what encryption algorithm SQL Server's EncryptByKey function uses?
 
Hi @SamyS.Rathore , does that not depend on the Database Key or the Certificate?
 
@Shaneis I'm not too sure, I don't work muchon backend, I found this statement in one of my databse function
ENCRYPTBYKEY(KEY_GUID('MyApp_SYM_KEY_BY_CERTIFICATE'), @inputString, 1, @authenticator)
 
yeah, you have a certificate, check out sys.certificates
that cert was probably created with an algorithm
but I hope you find out who created it! :)
btw this is your cert = MyApp_SYM_KEY_BY_CERTIFICATE
 
3:11 PM
Oh, ok...thanks for the help @Shaneis
:)
 
no worries @SamyS.Rathore hope you get your answers
 
3:24 PM
bye folks
 
See ya, Andy
 
see ya @AndyK
 
3:47 PM
@Shaneis I sure did, I looked up in sys.symmetric_keys and there it was
with algorithm_desc as AES_256
 
@SamyS.Rathore great! glad to hear it
 
Thanks for pointing m in the right direction, saved me a lot of trouble
 
@SamyS.Rathore no worries, that's what we are here for
heading off, talk to ya guys
 
See ya, Shaneis
 
 
2 hours later…
6:00 PM
How can I combine this two item in one single command?
BEGIN TRAN
use SupplementalFood
GO
update Voucher
set Confirmed = '1'
where VoucherID between 5705 and 5707;
--rollback commit

BEGIN TRAN
USE SupplementalFood
GO
update Voucher
set Confirmed = '1'
where VoucherID BETWEEN 5691 and 5696;
--rollback commit
 
update Voucher
set Confirmed = '1'
where (VoucherID between 5705 and 5707)
	or (VoucherID BETWEEN 5691 and 5696);
 
i am trying to retrieve all tracks posted by all users with all comments for each track along with the users who commented them...i have used left join but i am getting duplicates..for every comment the track details are getting repeated...how can i structure this query?i am doing this in mysql
 
Can you paste a sample of your SQL?
 
sure
('SELECT trackId,artistName,trackName,trackUrl,albumArt,genreName,tracks.created_at as track_posted_on,name,image,comment,comments.created_at as comment_posted_on,likes.user_id IS NOT NULL as liked FROM tracks LEFT OUTER JOIN comments ON tracks.id=comments.track_id LEFT JOIN users ON comments.user_id=users.id LEFT JOIN likes ON likes.track_id=tracks.id WHERE tracks.user_id=:current_user_id ORDER BY comments.created_at DESC'), array('current_user_id' => $this->uid)
i have written this for all tracks posted by a single user
but problem is the same
 
6:19 PM
You'll need separate queries
So grab all tracks, then grab all comments the tracks
 
thats what i think too but i was wondering if any experienced person has a solution for this...group_concat,distinct,group by...i have tried them all but failed
 
You can also try a GROUP BY or a DISTINCT. On the SELECT, add DISTINCT. Take a look here: mysqltutorial.org/mysql-distinct.aspx
Your ORDER BY will probably change when using DISTINCT/GROUP BY
 
But with group by, the track data will still be duplicated
 
@JamieLester yes
 
Try the DISTINCT
 
6:25 PM
Distinct is the same
 
What you need is a user defined function
It takes a username and returns a comma-separated string of all tracks for that user
Then you'd call it from your SELECT, passing in the username/ID
 
Eg:
1, "Adele", "Hello", ..., "Best song ever"
2, "Adele", "Hello", ..., "Could be better"
Those would be distinct even though the track info is duplicated
 
Let's see. Ignore earlier idea
 
What language is your program written in?
C#?
 
an api in php
 
6:28 PM
Ahhhh
SELECT * FROM tracks WHERE user_id = <user ID here>
SELECT comments.* FROM comments INNER JOIN tracks ON comments.track_id = tracks.id WHERE tracks.user_id = <user ID here>
or SELECT * FROM comments WHERE track_id IN (SELECT id FROM tracks WHERE user_id = <user ID here>)
 
separate queries then?
 
Otherwise, get the data with the track duplicates and filter it programmatically
 
but that would be an overhead in this case don't you think...the query itself is expensive
 
Returning the whole table means more data is being transferred between the web server and the SQL server
Whereas the separate queries means less data, but more time to establish the connections for each query
But the connections will probably be reused anyway
In C# you can get multiple tables back from a query, so you could get both the tracks and comments back at the same time
Not sure if that's possible in PHP
 
without duplicates?
must be the orm you use return nice collections, right?
just a wild guess
i got the structure right using laravel's orm...but i can't do anything with the results..no ordering no nothing
i mean its very much possible to order the result but not with this horrible join thingy
anyway...thank you so much for your time :)
 
 
2 hours later…
8:52 PM
Hello there, yet again. I have a bit of a problem and I'd like to ask here to save some time.
My primary key is a 'string' - therefore I want to hash it so I can use the hashed number instead of a string..
I have in total 800 fixed strings so its very unlikely I'll encounter collisions, what IYHO is a good hash function/method. Cheers
 

« first day (1775 days earlier)      last day (2543 days later) »