set colsep "{char}"

Oracle: set column separator

set colsep "&TAB" -- for tab separator set colsep "|" -- for pipe separator etc...

-5
By: EBAH
2011-04-05 10:48:48

These Might Interest You

  • Similar output to using MySQL with the \G at the end of a Query. Displays one column per line. Other modes include: -column Query results will be displayed in a table like form, using whitespace characters to separate the columns and align the output. -html Query results will be output as simple HTML tables. -line Query results will be displayed with one value per line, rows separated by a blank line. Designed to be easily parsed by scripts or other programs -list Query results will be displayed with the separator (|, by default) character between each field value. The default. From inside the command line this can be also changed using the mode command: .mode MODE ?TABLE? Set output mode where MODE is one of: csv Comma-separated values column Left-aligned columns. (See .width) html HTML code insert SQL insert statements for TABLE line One value per line list Values delimited by .separator string tabs Tab-separated values tcl TCL list elements Show Sample Output


    -1
    sqlite3 -line database.db
    pykler · 2010-10-09 16:10:19 0
  • explanation of flags: -dp path to JDBC driver -t Oracle thin driver -o output


    0
    java -jar ~/Downloads/schemaSpy_5.0.0.jar -dp ~/instantclient_10_2/ojdbc14.jar -t orathin -db DBNAME -host HOSTNAME -port 1521 -u USERNAME -p PASSWORD -o KSEMBEDDED-ks-1.3-merge
    corporate_gadfly · 2012-04-05 17:29:12 0
  • inputfile.txt is a space-separated textfile, 1st column contains the items (id) I want to put into my SQL statement. 39 = charactercode for single tick ' 1 = first column If inputfile.txt is a CSV-file separated by "," use FS= to define your own field-separator: awk 'BEGIN {FS=","; }{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt Show Sample Output


    2
    $ awk '{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt
    alvinx · 2009-09-21 14:08:04 0
  • (separator = $IFS)


    2
    ps aux | sort -nk 6
    totti · 2011-08-16 11:04:45 0
  • Creates a consistent datapumpt export on an Oracle database with the current sequence number, while the system is running and changes happens on the database.


    0
    expdp user/password FLASHBACK_SCN=$(echo -e "select current_scn from v\$database;" | sqlplus / as sysdba 2>/dev/null| grep [0-9][0-9][0-9][0-9][0-9][0-9]*)
    peshay · 2009-10-01 08:55:20 0
  • get a list of currently running oracle dbs (identified by the pmon process) show the executable that spawned the process and show the ORACLE_HOME relative to the environment within which the process is running tailored to AIX (sed on linux behaves...differently) suggestions for a better way...please.


    1
    ps -ef |grep oracle |grep pmon |awk '{print $2}' |xargs -I {} ps eww {} |grep pmon |grep -v grep |awk '{print $5 " " $6 " " $0}' |sed 's/\(S*\) \(S*\) .*ORACLE_HOME/\1 \2/g' |cut -f1,2,3 -d" "
    brianmuckian · 2010-03-23 20:36:59 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: