RE: Sqlpp-devel digest, Vol 1 #3 - 2 msgs

"Randy Davis" <[email protected]> Fri, 31 Oct 2003 08:09:59 -0600
Newsgroups gmane.comp.lib.sql.sqlpp
Message-ID <000001c39fb8$ae2ab860$6801a8c0@radavis001>
I am using SS 2000, windows xp, and VS 2003 (7.1) for compiling.

The join generated is actually on an index. I scanned index columns and
created pseudo fk constraints to mine secondary relationships. I just
added 2 related tables to the query and output the sql. This might not
be the best approach, but I am still learning sqlpp at this point.

R.D.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Thursday, October 30, 2003 10:32 PM
To: [email protected]
Subject: Sqlpp-devel digest, Vol 1 #3 - 2 msgs

Send Sqlpp-devel mailing list submissions to
	[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/sqlpp-devel
or, via email, send a message with subject or body 'help' to
	[email protected]

You can reach the person managing the list at
	[email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Sqlpp-devel digest..."


Today's Topics:

   1. spacing problem in generated query (Randy Davis)
   2. Re: spacing problem in generated query (Jonathan de Halleux)

--__--__--

Message: 1
From: "Randy Davis" <[email protected]>
To: <[email protected]>
Date: Thu, 30 Oct 2003 13:13:59 -0600
Subject: [Sqlpp-devel] spacing problem in generated query
Reply-To: [email protected]

This is a multi-part message in MIME format.

------=_NextPart_000_0002_01C39EE7.AEC75980
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

This query was generated using the sql server adaptor.

============= Try a Query================
SELECT 
*
FROM AT_AD_COMM_TBL AS Ad Table 
INNER JOIN AT_AD_TBL AS ChgObj
ON ChgObj.CO_ID = Ad Table.CO_IDAND ChgObj.PROD_ID = Ad Table.PROD_IDAND
ChgObj.BUY_ID = Ad Table.BUY_IDAND ChgObj.AD_ID = Ad Table.AD_ID

GO

============= Generate DB Graph ================
graph G {
graph [bgcolor=white]
node [shape=record fillcolor=lightgrey style=filled]
0[label="AT_AD_COMM_TBL AS Ad Table"];
1[label="AT_AD_TBL AS ChgObj"];
0--1 [headlabel="CO_ID,PROD_ID,BUY_ID,AD_ID"];
}

As you can see there are no spaces following the connectors in the on
clause and there is no delimiter around the Names (aliases) with
embedded spaces.

The generated DDL seems to have a large number of line feeds in some
places. 


================Create SQL================
USE AT_DEV

GO



























IF EXISTS (
    SELECT name FROM dbo.sysobjects
    WHERE name = 'FKREF1'
      AND type = 'F'
    )ALTER TABLE AT_MEDIA_SUB_CAT_TBL DROP CONSTRAINT FKREF1

GO

This is not a real problem except that I am outputting the DDL to  an
output window and I have to filter them to get an acceptable "look".



Regards,
Randy Davis
email:[email protected]


------=_NextPart_000_0002_01C39EE7.AEC75980
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.4630.0">
<TITLE>spacing problem in generated query</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">This
=
query was generated using the sql server adaptor.</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Try a =
Query=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">SELECT </FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">*</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">FROM
=
AT_AD_COMM_TBL AS Ad Table </FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">INNER
=
JOIN AT_AD_TBL AS ChgObj</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">ON =
ChgObj.CO_ID =3D Ad Table.CO_IDAND ChgObj.PROD_ID =3D Ad =
Table.PROD_IDAND ChgObj.BUY_ID =3D Ad Table.BUY_IDAND ChgObj.AD_ID =3D =
Ad Table.AD_ID</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">GO</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Generate DB Graph
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">graph
=
G {</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">graph
=
[bgcolor=3Dwhite]</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">node
=
[shape=3Drecord fillcolor=3Dlightgrey style=3Dfilled]</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">0[label=3D&quot;AT_AD_COMM_TBL AS Ad =
Table&quot;];</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">1[label=3D&quot;AT_AD_TBL AS =
ChgObj&quot;];</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">0--1
=
[headlabel=3D&quot;CO_ID,PROD_ID,BUY_ID,AD_ID&quot;];</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">}</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">As =
you can see there are no spaces following the connectors in the on =
clause and there is no delimiter around the Names (aliases) with =
embedded spaces.</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">The =
generated DDL seems to have a large number of line feeds in some =
places.</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"> =
</SPAN></P>
<BR>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DCreate =
SQL=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">USE AT_DEV</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">GO</FONT></SPAN></P>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">IF EXISTS (</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp; SELECT name FROM =
dbo.sysobjects</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp; WHERE name =3D 'FKREF1'</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AND type =3D 'F'</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">&nbsp;&nbsp;&nbsp; )ALTER TABLE AT_MEDIA_SUB_CAT_TBL DROP =
CONSTRAINT FKREF1</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Courier =
New">GO</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">T</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">his</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial"> is not a real problem except that I am outputting the =
DDL to&nbsp; an output window and I have to filter them to get an =
acceptable</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"> <FONT SIZE=3D2 FACE=3D"Arial">&#8220;</FONT></SPAN><SPAN
=
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">look</FONT></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">&#8221;</FONT></SPAN><SPAN
=
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">.</FONT></SPAN></P>
<BR>
<BR>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"></SPAN><A NAME=3D""><SPAN =
LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">Regards,</FONT></SPAN></A></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 FACE=3D"Arial">Randy
=
Davis</FONT></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"><FONT SIZE=3D2 =
FACE=3D"Arial">email:[email protected]</FONT></SPAN><SPAN =
LANG=3D"en-us"></SPAN><SPAN LANG=3D"en-us"></SPAN><SPAN =
LANG=3D"en-us"></SPAN></P>

<P ALIGN=3DLEFT><SPAN LANG=3D"en-us"></SPAN></P>

</BODY>
</HTML>
------=_NextPart_000_0002_01C39EE7.AEC75980--



--__--__--

Message: 2
Date: Thu, 30 Oct 2003 20:25:20 +0100
To: [email protected]
From: Jonathan de Halleux <[email protected]>
Subject: Re: [Sqlpp-devel] spacing problem in generated query
Reply-To: [email protected]


--MIMEStream=_0+26926_6080389117948_10177580514
Content-Type: text/plain; charset="us-ascii"; format="flowed"

Waht is you platform ? Windows, Unix, Linux ?

That's strange, I usually don"t get this...

At 13:13 30/10/2003 -0600, you wrote:

>This query was generated using the sql server adaptor.
>
>============= Try a Query================
>
>SELECT
>
>*
>
>FROM AT_AD_COMM_TBL AS Ad Table
>
>INNER JOIN AT_AD_TBL AS ChgObj
>
>ON ChgObj.CO_ID = Ad Table.CO_IDAND ChgObj.PROD_ID = Ad
Table.PROD_IDAND 
>ChgObj.BUY_ID = Ad Table.BUY_IDAND ChgObj.AD_ID = Ad Table.AD_ID
>
>GO
>
>============= Generate DB Graph ================
>
>graph G {
>
>graph [bgcolor=white]
>
>node [shape=record fillcolor=lightgrey style=filled]
>
>0[label="AT_AD_COMM_TBL AS Ad Table"];
>
>1[label="AT_AD_TBL AS ChgObj"];
>
>0--1 [headlabel="CO_ID,PROD_ID,BUY_ID,AD_ID"];
>
>}
>
>As you can see there are no spaces following the connectors in the on 
>clause and there is no delimiter around the Names (aliases) with
embedded 
>spaces.

I'll have a look at that.

>The generated DDL seems to have a large number of line feeds in some
places.
>
>================Create SQL================
>
>USE AT_DEV
>
>GO
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>IF EXISTS (
>
>     SELECT name FROM dbo.sysobjects
>
>     WHERE name = 'FKREF1'
>
>       AND type = 'F'
>
>     )ALTER TABLE AT_MEDIA_SUB_CAT_TBL DROP CONSTRAINT FKREF1
>
>GO
>
>This is not a real problem except that I am outputting the DDL to  an 
>output window and I have to filter them to get an acceptable look.
>
>
>Regards,
>
>Randy Davis
>
>email:[email protected]

------------------------------------------------------------------------
-----------
Jonathan de Halleux, Research Assistant
Center for Systems Engineering and Applied Mechanics (CESAME)
Universite catholique de Louvain
Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
B-1348 Louvain-la-Neuve Belgium
E-mail : [email protected]
------------------------------------------------------------------------
-----------

--MIMEStream=_0+26926_6080389117948_10177580514
Content-Type: text/html; charset="us-ascii"; name="unnamed.html"

<html>
<body>
Waht is you platform ? Windows, Unix, Linux ?<br><br>
That's strange, I usually don&quot;t get this...<br><br>
At 13:13 30/10/2003 -0600, you wrote:<br><br>
<blockquote type=cite class=cite cite><font size=2>This query was
generated using the sql server adaptor.<br>
</font><br>
<font size=2>============= Try a Query================<br>
</font><br>
<font size=2>SELECT <br>
</font><br>
<font size=2>*<br>
</font><br>
<font size=2>FROM AT_AD_COMM_TBL AS Ad Table <br>
</font><br>
<font size=2>INNER JOIN AT_AD_TBL AS ChgObj<br>
</font><br>
<font size=2>ON ChgObj.CO_ID = Ad Table.CO_IDAND ChgObj.PROD_ID = Ad
Table.PROD_IDAND ChgObj.BUY_ID = Ad Table.BUY_IDAND ChgObj.AD_ID = Ad
Table.AD_ID<br>
</font><br>
<font size=2>GO<br>
</font><br>
<font size=2>============= Generate DB Graph ================<br>
</font><br>
<font size=2>graph G {<br>
</font><br>
<font size=2>graph [bgcolor=white]<br>
</font><br>
<font size=2>node [shape=record fillcolor=lightgrey style=filled]<br>
</font><br>
<font size=2>0[label=&quot;AT_AD_COMM_TBL AS Ad Table&quot;];<br>
</font><br>
<font size=2>1[label=&quot;AT_AD_TBL AS ChgObj&quot;];<br>
</font><br>
<font size=2>0--1
[headlabel=&quot;CO_ID,PROD_ID,BUY_ID,AD_ID&quot;];<br>
</font><br>
<font size=2>}<br>
</font><br>
<font size=2>As you can see there are no spaces following the connectors
in the on clause and there is no delimiter around the Names (aliases)
with embedded spaces.</font></blockquote><br>
I'll have a look at that.<br><br>
<blockquote type=cite class=cite cite><font size=2>The generated DDL
seems to have a large number of line feeds in some places.</font>
<br><br>
<font face="Courier New, Courier" size=2>================Create
SQL================<br>
</font><br>
<font face="Courier New, Courier" size=2>USE AT_DEV<br>
</font><br>
<font face="Courier New, Courier" size=2>GO<br>
</font><br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<font face="Courier New, Courier" size=2>IF EXISTS (<br>
</font><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp; SELECT name
FROM dbo.sysobjects<br>
</font><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp; WHERE name =
'FKREF1'<br>
</font><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AND type = 'F'<br>
</font><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp; )ALTER TABLE
AT_MEDIA_SUB_CAT_TBL DROP CONSTRAINT FKREF1<br>
</font><br>
<font face="Courier New, Courier" size=2>GO<br>
</font><br>
<font size=2>This is not a real problem except that I am outputting the
DDL to&nbsp; an output window and I have to filter them to get an
acceptable</font> <font size=2>look.<br>
</font><br><br>
<font size=2><a></a>Regards,<br>
</font><br>
<font size=2>Randy Davis<br>
</font><br>
<font size=2>email:[email protected]<br>
</font></blockquote>
<x-sigsep><p></x-sigsep>
------------------------------------------------------------------------
-----------<br>
Jonathan de Halleux, Research Assistant<br>
Center for Systems Engineering and Applied Mechanics (CESAME)<br>
Universite catholique de Louvain <br>
Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595 <br>
B-1348 Louvain-la-Neuve Belgium <br>
E-mail : [email protected] <br>
------------------------------------------------------------------------
-----------<br>
</body>
</html>

--MIMEStream=_0+26926_6080389117948_10177580514--



--__--__--

_______________________________________________
Sqlpp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlpp-devel


End of Sqlpp-devel Digest



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/