Database

  • Install sqlplus and odat in Kali Linux

    Thanks to 0xdf, who have these steps documented. I just added my own screenshots and interpretation. sqlplus Download basic, sdk and sqlplus from https://github.com/f00b4r/oracle-instantclient At the time of writing, I downloaded instantclient-basiclite-linux.x64-19.6.0.0.0dbru.zip, instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip, instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip Unzip all of the above into one single folder, instantclient_19_6 Move instantclient_19_6 into /opt/ Update bashrc, be mindful to echo $LD_LIBRARY_PATH… Continue reading

  • Select max volume sql query

    Credits: http://rextester.com/GGOCWB28059 Continue reading

  • Setting up Oracle Database on Mac OS X (Part 1)

    It can really be a big, big hassle! Especially for beginners like me who had no prior knowledge on creating a new DB in Oracle. Oracle documentation is quite confusing as well, no offence though! By the way, a Mac user! So yeah, these are what I have been through, not to mention a lot… Continue reading

  • Using sqlcmd to set file name

    Credits: https://dba.stackexchange.com/questions/94774/how-to-use-sqlcmd-to-create-file-names-for-output-based-on-the-day-of-the-week-o For date only can look at: https://forums.asp.net/t/1616515.aspx?SQLCMD+timestamp+output+file Continue reading

  • SQL splitting columns into multiple

    Useful: select case CHARINDEX(‘_’, name) when 0 then name else SUBSTRING(name, 1, CHARINDEX(‘_’, name) – 1) end firstName, case CHARINDEX(‘_’, name) when 0 then name else SUBSTRING(name, CHARINDEX(‘_’, name) + 1, LEN(name)) end lastname from emp select parsename(replace(yourcolumn,’ ‘,’.’),3) as first, parsename(replace(yourcolumn,’ ‘,’.’),2) as second, parsename(replace(yourcolumn,’ ‘,’.’),1) as third from table Credits: https://stackoverflow.com/questions/22652225/how-to-split-one-column-into-two-columns-in-sql-server http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=167179 Continue reading

Design a site like this with WordPress.com
Get started