Riaan Lehmkuhl's Blog

Subversion, Progamming, Tips & Tricks and whatever else springs to mind.
26Mar

View running 4GL SQL queries

26 March 2008 22:39 by Riaan Lehmkuhl
It has been a while since i have had to work with Informix / 4GL. I have already forgotten tha simple commands to view the current running SQL query with an executing 4GL script. So this is more of a note to myself, but if it helps you, I'll be overjoyed.
First find the correct process:
> ps -ef | grep glgo root 7618 7368 63 22:58:19 pts/ta 0:21 fglgo the_4gl_name_here
Then get the correct session using the pid from the previous result:
> onstat -g ses | grep 7618 1644203 root ta 7618 myserver 1 200704 187952 off
Now get the current executing sql of the session id above:
> onstat -g sql 1644203
If you would like the display to be automatically refreshed, just add a 'r' switch:
> onstat -gr sql 1644203
I hope I will remember to come and look for this next time I need it in a few months time.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
29Dec

sed to convert CSV to Informix unload format

29 December 2006 15:46 by Riaan Lehmkuhl

After searching for ever, I finally managed to compile a sed script to convert CSV formatted files to Informix unload format (bar-delimited) files.

Hope I help someone with this.

#************************************************#
#                 csv2unl.sh                     #
#                                                #
#          written by Riaan Lehmkuhl             #
#                Dec  29, 2006                   #
#                                                #
#  sed to convert csv to bar-delimited records.  #
#************************************************#
# usage: ./csv2unl.sh < infile > outfile         #
#************************************************#
/./!d
s/\([^\]\)|/\1\\\\|/g
s/\`/\'/g
s/^ *\(.*[^ ]\) *$/|\1|/;
s/" *, */"|/g;
: loop
s/| *\([^",|][^,|]*\) *, */|\1|/g;
t loop
s/  *|/|/g;
s/|  */|/g;
s/^|\(.*\)|$/\1/;
s/"//g
s/$/|/g

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Riaan Lehmkuhl


Me, a disorder of the brain that results in a disruption in a person's thinking, mood, and ability to relate to others.

Recent comments

Comment RSS

Thingies

Calendar And Month List

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Disclaimer & Privacy

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Privacy:
We use third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

Most comments

Cool Quote

I know that you believe that you understood what you think I said, but I am not sure you realize that what you heard is not what I meant. - Robert McCloskey