Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

retrieving Stored procedure with SQL IN INFORMIX

2,096 views
Skip to first unread message

Lionel Girard

unread,
Jun 27, 2003, 9:54:13 AM6/27/03
to
Hi, i'm currently working on a Procedure extractor from delphi/BDE
plateform , and i do it with this request passed to INFORMIX :

strQuery:='SELECT sysprocedures.procname, sysprocedures.procid, ' +
'sysprocbody.datakey, sysprocbody.data, sysprocbody.seqno ' +
'FROM sysprocedures, sysprocbody ' + 'WHERE sysprocedures.procname='''
+ txtProcStoc.Text + ''' ' + 'AND
sysprocedures.procid=sysprocbody.procid ' +
'AND sysprocbody.datakey=''T'' ' + 'ORDER BY sysprocbody.seqno ASC;';

This give me the entire code of procedures, but there is a bug
sometimes. When sysprocbody.data ends or begin with a space, it forget
it in tables, so i can't get it back when i extract the procedure.

For example, a procedure as a line like this :
DEFINE myvar CHAR(2);
and it is segmented like this in table sysprocbody
..........DEFINE|myvar................
The space is lost in text but INFORMIX seems to keep it somewhere
because it can restore it with DBAccess. How can i find it and where?
Do you have an idea?

Really thanks for your help

Fnu Gaurav

unread,
Jun 27, 2003, 1:16:40 PM6/27/03
to


Informix client knows the way text of the procedure is broken and stored
and that is why dbaccess/dbexport are able to generate full procbody by
using the information in sysprocbody.

It can be done via any client application by just adding some logic for
buffering one row at a time and then use those intermediate buffers to
generate proceduer body by adding spaces or "\n" as required. You will need
to write a lot of code for checking various conditions if you are going to
support GLS. Otherwise, it should be straight forward logic.

Or you can use dbschema with "-f procname" option to generate this for you.

Thanks and Regards,
Gaurav



lionel.girard@stv
a.com (Lionel To: inform...@iiug.org
Girard) cc:
Sent by: Subject: retrieving Stored procedure with SQL IN INFORMIX
owner-informix-li
s...@iiug.org


06/27/03 08:54 AM
Please respond to
lionel.girard

sending to informix-list

Lionel Girard

unread,
Jun 28, 2003, 12:45:24 PM6/28/03
to
HI, thanks for the response. What i want to do is extracting procedure
without using UNIX Client, directly from my application. Is there a
way or tool to do it without UNIX executables?

Where can i find the way to correctly extract those procedures? I
mean, the rules that are used to store and unstore them by db tools
without missing any space between segments?

Thanks again for your help

Fnu Gaurav <fn...@us.ibm.com> wrote in message news:<bdhtut$lb3$1...@terabinaries.xmission.com>...

Lionel Girard

unread,
Jun 30, 2003, 9:35:21 AM6/30/03
to
Hi,

I've tested my query under dbaccess, and i retrieved the same result.
Sometimes, at the same segments, space are lost between two segments.

SELECT sysprocedures.procname, sysprocedures.procid,
sysprocbody.datakey, sysprocbody.data,
sysprocbody.seqno
FROM sysprocedures, sysprocbody
WHERE sysprocedures.procname='pj_i_lire_planjou2'
AND sysprocedures.procid=sysprocbody.procid
AND sysprocbody.datakey='T'
ORDER BY sysprocbody.seqno ASC

But with a dbschema -d <> -f <> <> ... , everything is correct !!!!

I really don't understand. I think some extra informations should be
somewhere else (in other fields selected by L ou S ....). For now, i'm
stopped ... will think about that...


In Delphi, i can't use those cursor. I've 2 way to retrieve
informations, using control Query (it returns String) or usine BDE
with dbi functions (but it returns strings too). Those two methods
returne string for fields in one segment of 255 caracters maxi. But
the result is the same, i still have some space caracters that are
missing at the end of some fields

lionel...@stva.com (Lionel Girard) wrote in message news:<ffc5d651.03062...@posting.google.com>...

Lionel Girard

unread,
Jul 25, 2003, 3:30:30 AM7/25/03
to
Finaly, i made it !!!
I just made a stored procedure that retrieve the original field and
split it in two string with a length < 255. And i tagged the two field
at the beginning and the end. In Delphi, now, i call the stored
procedure and concatenate the two field without any loss ...
Hope this will help anybody who need to do it in the future ...

lionel...@stva.com (Lionel Girard) wrote in message news:<ffc5d651.03062...@posting.google.com>...

0 new messages