Re: Generating C structures from data dictionary definitions
Date: Mon, 12 Jul 1993 02:49:09 +0000
Message-ID: <742445349snz_at_hoxton.demon.co.uk>
In article <21moes$ofk_at_news.cs.tu-berlin.de> ernst_at_cs.tu-berlin.de writes:
>After having used Pro*C for a couple of weeks now, I find it inconvenient
>that it is quite hard to maintain consistency between the table
>definitions and the C structures in my Pro*C program.
>
>So I was thinking of a useful little tool that would generate C structures
>by reading the Oracle data dictionary. Before I start working on it :
>
>Does such a tool already exist ?
>
>Would it take a lot of work getting into the internals of Oracle to
>accomplish this task ?
>
>
>Thanks for any info, Ernst.
>--
>
>-----------------------------------------------------------------------------
>Ernst Kloecker phone: ++49-30-6181635 e-mail: ernst_at_cs.tu-berlin.de
>-----------------------------------------------------------------------------
>
Something like:
SELECT 'EXEC SQL BEGIN DECLARE SECTION;' FROM DUAL; SELECT 'VARCHAR '||CNAME||'['||LENGTH+1||'];'
FROM SYS.COL WHERE TNAME='&&TABLE'
SELECT 'EXEC SQL END DECLARE SECTION;' FROM DUAL; with suitable decodes for numbers and dates would do you. When you finish it off perhaps you could post it back here. :-)
-- Paul Beardsell 21 Finn House, Bevenden St, HOXTON, ~~~~~~~~~~~~~~ Hackney, London, N1-6BN, UK. paul_at_hoxton.demon.co.uk pbeardsell_at_cix.compulink.co.uk (+44 or 0)71 608-2391Received on Mon Jul 12 1993 - 04:49:09 CEST