My Informix Test
Posted in 1995
Since the posting and requests to me for a copy of this test continue,
here it is again. It will soon be available at the Informix FTP site.
Also if you would like a clean faxed copy of the test (USA ONLY),
please send me a fax number and I will fax you a copy of just the
test.
Have fun....
Stuart
slitel@netcom.com
---------------------- cut here ------------------------
STUART LITEL
Post Office Box 40
Newtonville, MA 02160
(617) 527 - 4551
FAX (617) 964 - 4262
slitel@netcom.com
Attached is a copy of an Informix Programmers Test I compiled a
while back for one of my customers. The original idea was to
test prospective Informix programmers and see if their knowledge
would help the company.
Recently I started talking to the people at Prentice Hall /
Informix Press to write a book on the subject. I am still in
discussions with them, and have not fully decided if I will
write such a book.
I am giving this test away, in hopes of convincing me that such
a book is necessary. In exchange for this test, I would
appreciate any help. If you can think of any questions to add
to the test, I would appreciate your forwarding (with the
answers of course) them to me. All questions will remain my
property, but if I do write such a book, I will TRY to
acknowledge any individual who send me at least 10 questions
that I do use. I would like to keep all the questions in the
following four categories, and need help especially with the
latter two.
1) Informix SQL questions
2) Informix 4GL questions
3) Informix New Era questions
4) Informix Database Administrator type questions (On-Line / Standard Engine)
Please try not to send me any questions that are specific to
certain versions of Informix. For example something that is try
in the RDS version and not in the compiled Informix version or
true in Informix 5.X but not in Informix 7.X.
Please send me your questions in any of the following ways.
1) Via E-Mail at: slitel@netcom.com
2) Via Fax: (617) 964 - 4262
3) Via U.S.P.S. mail: Stuart Litel, P.O. Box 40 Newtonville, MA 02160
Thank you for all your help, in I hope this test will assist you
in your needs. Oh yes, you may freely reproduce this test and
use as needed, but please leave it intact. Just copy the test
as is, and use as needed.
One last request - if you do find this test useful, kindly send me a
Thank You note, so I know that is it being used and it was useful.
Thank You!
Stuart Litel
About the author: Over 10 years ago I started using Informix 4GL / SQL
where I worked at a company that was a beta tester for the products
including RDS/Debugger and Turbo (now known as "on-line"). Presently
I serve as an Indepent Consultant on all areas of Informix Products
and quite possibly maybe the longest Informix programmer/user in
the country. I also serve on the Steering/Executive Committee (and Founder)
of the Informix New England(USA) User Group. I am always available for
servies and can always be reached via e-mail or telephone. I believe
I have also written over 3 million lines of Informix 4GL code and
work with the complete line of products from RDS/Compiled, Debugger,
Standard/On-Line engines upto the most recent versions.
------------------------- cut here for test --------------------------------
INFORMIX 4GL Programming Test
1) Explain what the Informix "Construct" statement does?
2) What is the difference between the "Input by name" and
"input prog_rec from screen_rec"?
3) In a 4GL report what does "order external" do?
4) What will happen in the following code sample - find at least
two mistakes...
define p_array[100] of smallint
define x smallint
#NOTE assume the next two lines are correct and xyz is
# a smallint field
declare abc_curs cursor for
select xyz from abc
foreach abc_curs into p_array[x]
end foreach
5) Explain briefly what the following Informix built-in
functions do:
1) errorlog(char-expr)
2) infield(field-name)
3) scr_line()
4) arg_val(integer_expr)
6) Explain what will be displayed on the lines below in bold for
the value of x:
database abc
globals
define x smallint
end globals
main
define x smallint
display x #I AM A BOLD LINE
let x = 2
display x #I AM A BOLD LINE
call funct1()
display x #I AM A BOLD LINE
call funct2()
display x #I AM A BOLD LINE
call funct3() returning x
display x #I AM A BOLD LINE
end main
function funct1()
define x smallint
let x = 3
end function
function funct2()
let x = 4
end function
function funct3()
let x = 5
return x
end function
7) How do you "force the cursor" in the input array statement to
go down on line or bounce to the next row?
8) What is int_flag? How and when is it set?
9) What is the prepare statement used for?
10) What is the difference in the following code
# SAMPLE #1
define x smallint
declare abc_curs cursor for
select field from table
open abc_curs
while true
fetch abc_curs into x
if (status = 100) then
exit while
end if
display x
end while
# SAMPLE #2
define x smallint
declare abc_curs cursor for
select field from table
foreach abc_curs into x
display x
end foreach
11) When using ring menus, explain how to make a different key
other than the first key the "choice" key? For example I have a
ring menu that is hEllo and I want to make the "E" key the key
that will pick this choice.
12) When using ring menus explain how to Hide Options to certain
users?
13) What is the difference between the "format" and "picture"
attribute in a .per screen file?
For the next few questions (#14 - # 19) - use the following two
tables
Person Table State table
first_name char(20) state char(2)
last_name char(20) description char(20)
address char(30)
Job_title char(30)
city char(30)
state char(2)
zip char(5)
age smallint
14) Write an SQL query that will find all the people in the
person table that do not live in a state that begins with the
letter "M"
15) Write an SQL query that will give a list of all the first
and last names of the people in the person table and the state
long description that "goes with" or "joins" them from the state
table.
16) Write an SQL query that will give a list of all the first
and last names of the people in the person table and the long
description that "goes with" or "joins" them and the state is or
is not in the state table. For example John Smith lives in NH
(New Hampshire) and Jane Doe lives in XX and there is no state
XX, but you want to show both John Smith wit