Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / January 2004

Tip: Looking for answers? Try searching our database.

4GL question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Salter - 28 Jan 2004 14:50 GMT
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3E5AE.12223DD0
Content-Type: text/plain

Hello all,



I'm writing a 4GL report, and I need it to span several databases that all
have matching tables and structures, it's just the info in the tables that's
different. I know I could add the database name to the FROM statement in
each of my selects, but I was hoping there was a way to do create a DATABASE
statement using a variable name. That way I wouldn't have to change the SQL
statements and add the CLOSE and FREE statements for each cursor and prep
statement.



TIA,



Howard

------_=_NextPart_001_01C3E5AE.12223DD0
Content-Type: text/html

<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">

<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman";}
a:link, span.MsoHyperlink
    {color:blue;
    text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
    {color:purple;
    text-decoration:underline;}
span.EmailStyle17
    {font-family:Arial;
    color:windowtext;}
@page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
    {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello all,</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I'm writing a 4GL report, and I need it to span
several databases that all have matching tables and structures, it's just
the info in the tables that's different. I know I could add the database
name to the FROM statement in each of my selects, but I was hoping there was a
way to do create a DATABASE statement using a variable name. That way I wouldn't
have to change the SQL statements and add the CLOSE and FREE statements for
each cursor and prep statement.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>TIA,</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Howard</span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C3E5AE.12223DD0--
sending to informix-list
malcolm.iiug - 28 Jan 2004 16:30 GMT
This is a multi-part message in MIME format.

------=_NextPart_000_0045_01C3E5BC.1553C650
Content-Type: text/plain;
    charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Howard,
In the past I have used a technique of prompting for a database name and =
opening the database using the character string returned.  And guess =
what?  It still works.  You don't even need the @servername.  And you =
don't even need to close the old one. =20

regards

Malcolm
(some of us oldies still use 4GL)
 ----- Original Message -----=20
 From: Howard Salter=20
 To: informix-list@iiug.org=20
 Sent: Wednesday, January 28, 2004 2:50 PM
 Subject: 4GL question

 Hello all,

 I'm writing a 4GL report, and I need it to span several databases that =
all have matching tables and structures, it's just the info in the =
tables that's different. I know I could add the database name to the =
FROM statement in each of my selects, but I was hoping there was a way =
to do create a DATABASE statement using a variable name. That way I =
wouldn't have to change the SQL statements and add the CLOSE and FREE =
statements for each cursor and prep statement.

 TIA,

 Howard

------=_NextPart_000_0045_01C3E5BC.1553C650
Content-Type: text/html;
    charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in =
1.25in; }
P.MsoNormal {
    FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
    FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
    FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
    COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
    COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
    COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
    COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
    COLOR: windowtext; FONT-FAMILY: Arial
}
DIV.Section1 {
    page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Howard,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In the past I have used a technique of =
prompting=20
for a database name and opening the database using the character string=20
returned.&nbsp; And guess what?&nbsp; It still works.&nbsp; You don't =
even need=20
the @servername.&nbsp; And you don't even need to close the old =
one.&nbsp;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Malcolm</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>(some of us oldies still use =
4GL)</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
 <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
 <DIV=20
 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
 <A title=3DHowardSalter@penningtonseed.com=20
 href=3D"mailto:HowardSalter@penningtonseed.com">Howard Salter</A> =
</DIV>
 <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dinformix-list@iiug.org=20
 href=3D"mailto:informix-list@iiug.org">informix-list@iiug.org</A> =
</DIV>
 <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, January 28, =
2004 2:50=20
 PM</DIV>
 <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> 4GL question</DIV>
 <DIV><BR></DIV>
 <DIV class=3DSection1>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello =
all,</SPAN></FONT></P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm writing a 4GL =
report, and I=20
 need it to span several databases that all have matching tables and=20
 structures, it's just the info in the tables that's different. I know =
I could=20
 add the database name to the FROM statement in each of my selects, but =
I was=20
 hoping there was a way to do create a DATABASE statement using a =
variable=20
 name. That way I wouldn't have to change the SQL statements and add =
the CLOSE=20
 and FREE statements for each cursor and prep =
statement.</SPAN></FONT></P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">TIA,</SPAN></FONT></P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
 <P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial">Howard</SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0045_01C3E5BC.1553C650--

sending to informix-list
Rob Vorbroker - 28 Jan 2004 18:44 GMT
Howard,  Assuming the tables in the various DB all
have the same structure - why not create a set of
synonyms in one master DB (pick the one that makes
sense) and select from all the tables at once?

Is that an option for you?

Rob Vorbroker
--- Howard Salter <HowardSalter@penningtonseed.com>
wrote:
> Hello all,
>
[quoted text clipped - 21 lines]
>
> Howard

=====
Rob Vorbroker                             Phone: 513/336-8695
Vorbroker Consulting, Inc.            Fax: 513/336-6812
www.vorbroker.com                     robv@vorbroker.com

sending to informix-list
Rob Vorbroker - 28 Jan 2004 18:44 GMT
Howard,  Assuming the tables in the various DB all
have the same structure - why not create a set of
synonyms in one master DB (pick the one that makes
sense) and select from all the tables at once?

Is that an option for you?

Rob Vorbroker
--- Howard Salter <HowardSalter@penningtonseed.com>
wrote:
> Hello all,
>
[quoted text clipped - 21 lines]
>
> Howard

=====
Rob Vorbroker                             Phone: 513/336-8695
Vorbroker Consulting, Inc.            Fax: 513/336-6812
www.vorbroker.com                     robv@vorbroker.com

sending to informix-list
sending to informix-list
Jonathan Leffler - 29 Jan 2004 04:30 GMT
> This message is in MIME format.

Don't post MIME - or I'll set the Clown onto you!

> I'm writing a 4GL report, and I need it to span several databases that all
> have matching tables and structures, it's just the info in the tables that's
[quoted text clipped - 3 lines]
> statements and add the CLOSE and FREE statements for each cursor and prep
> statement.

I'm not quite clear what you mean by 'I was hoping there was a way to
do create a DATABASE statement using a variable name'.  I suspect that
you are asking for something like:

    FROM somevar:tablename AS t

Where the somevar is an I4GL host variable.  That's a non-starter; you
can only specify values via variables, not table names - and
dbase:tablename is still a table name even though it includes a
database name too.

Secondly, even if by some magic you could make the database name into
a variable, you would still have to re-prepare (and re-declare, and
re-open) the statement each time.

> <meta name=Generator content="Microsoft Word 10 (filtered)">

Should be banned!!

Signature

Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Obnoxio The Clown - 30 Jan 2004 16:09 GMT
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
[quoted text clipped - 78 lines]
> ------_=_NextPart_001_01C3E5AE.12223DD0--
> sending to informix-list

Don't post HTML, or I'll set Jonathan on you.

Signature

"C'est pas parce qu'on n'a rien à dire qu'il faut fermer sa gueule"
- Coluche

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.