Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SQL Script with ODBC

5 posts in ODBC Last posting was on 2010-03-24 12:57:22.0Z
devzone.advantagedatabase.com Posted on 2010-03-23 10:00:00.0Z
From: "devzone.advantagedatabase.com" <alex_black@mail.ru>
Newsgroups: Advantage.ODBC
Subject: SQL Script with ODBC
Date: Tue, 23 Mar 2010 12:00:00 +0200
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 100322-0, 22.03.2010), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 193.109.249.137
Message-ID: <4ba8908a@solutions.advantagedatabase.com>
X-Trace: 23 Mar 2010 03:57:30 -0700, 193.109.249.137
Path: solutions.advantagedatabase.com!193.109.249.137
Xref: solutions.advantagedatabase.com Advantage.ODBC:1874
Article PK: 1133250

SQL Script

select * into #tmp from client;
select * from #tmp

Do not create an error, but with outstanding results. It seems that the
second request is not in any way. How to solve this problem?


Mark Wilkins Posted on 2010-03-23 22:05:25.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: Advantage.ODBC
References: <4ba8908a@solutions.advantagedatabase.com>
Subject: Re: SQL Script with ODBC
Date: Tue, 23 Mar 2010 16:05:25 -0600
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.228
Message-ID: <4ba93a9f@solutions.advantagedatabase.com>
X-Trace: 23 Mar 2010 16:03:11 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.ODBC:1876
Article PK: 1133252

Both of those statements return the result set. I think you only need to
run the first one to get the cursor back:

select * into #tmp from client;

Mark Wilkins
Advantage R&D

"devzone.advantagedatabase.com" <alex_black@mail.ru> wrote in message
news:4ba8908a@solutions.advantagedatabase.com...
> SQL Script
>
> select * into #tmp from client;
> select * from #tmp
>
> Do not create an error, but with outstanding results. It seems that the
> second request is not in any way. How to solve this problem?
>


Sitnik Alexander Posted on 2010-03-24 08:11:10.0Z
From: "Sitnik Alexander" <alex_black@mail.ru>
Newsgroups: Advantage.ODBC
References: <4ba8908a@solutions.advantagedatabase.com> <4ba93a9f@solutions.advantagedatabase.com>
Subject: Re: SQL Script with ODBC
Date: Wed, 24 Mar 2010 10:11:10 +0200
Lines: 266
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_003C_01CACB3A.5368CFC0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Antivirus: avast! (VPS 100323-1, 23.03.2010), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 193.109.249.137
Message-ID: <4ba9c88a@solutions.advantagedatabase.com>
X-Trace: 24 Mar 2010 02:08:42 -0700, 193.109.249.137
Path: solutions.advantagedatabase.com!193.109.249.137
Xref: solutions.advantagedatabase.com Advantage.ODBC:1877
Article PK: 1133253

This is just an example of what the second query returns no results. In fact, the request is much more complicated and contains data from a number of temporary tables:
 
FULL SCRIPT!!!!
 
SELECT DC.FILIAL, SUM(SD.VES) AS VES,  SUM(IIF(NET.OBJVALUE=24077,SD.SUMMAUC,
SD.SUMMA)) AS SUMMA
INTO #OTGR
FROM DC000012 DC
INNER JOIN SD000012 SD ON SD.KODDOC=DC.KODDOC
LEFT OUTER JOIN CLIENT KODM ON KODM.KODKLI=SD.KODM
LEFT OUTER JOIN PAR_OBJ NET ON NET.KODOBJ=DC.KODIN AND NET.KODPAROBJ=441
WHERE DC.PRIZNAK =233 AND DC.DATA>='2010-03-01' AND DC.DATA<='2010-03-23'  AND DC.ISOTGR=2 AND KODM.KODG=2673
AND DC.KODIN<>81694 GROUP BY 1  ; 
 
SELECT DC.FILIAL, SUM(SD.VES) AS VES,  SUM(IIF(NET.OBJVALUE=24077, SD.SUMMAUC,SD.SUMMA)) AS SUMMA
INTO #VOZV
FROM DC000012 DC
INNER JOIN SD000012 SD ON SD.KODDOC=DC.KODDOC
LEFT OUTER JOIN CLIENT KODM ON KODM.KODKLI=SD.KODM
LEFT OUTER JOIN PAR_OBJ NET ON NET.KODOBJ=DC.KODIN AND NET.KODPAROBJ=441
LEFT OUTER JOIN PAR_OBJ V ON V.KODOBJ=SD.KODM AND V.KODPAROBJ=1
WHERE PRIZNAK =2998 AND DATA>='2010-03-01' AND DATA<='2010-03-23'  AND DC.KODIN<>81694 AND
SD.VES<>0  AND IFNULL(V.OBJVALUE,0) IN (2679,4611,4612,4613,4614,4615,4616,4618,4619) AND DC.ISOTGR=2
GROUP BY 1 ; 
 
SELECT DC.FILIAL,   SUM(IIF(NET.OBJVALUE=24077,SD.SUMMAUC,SD.SUMMA)) AS SUMMA
INTO #KORR
FROM DC000012 DC
INNER JOIN SD000012 SD ON SD.KODDOC=DC.KODDOC
LEFT OUTER JOIN PAR_OBJ NET ON NET.KODOBJ=DC.KODIN AND NET.KODPAROBJ=441
LEFT OUTER JOIN PAR_OBJ V ON V.KODOBJ=SD.KODM AND V.KODPAROBJ=1
WHERE PRIZNAK =18 AND DATA>='2010-03-01' AND DATA<='2010-03-23'  AND DC.KODIN<>81694 AND SD.VES<>0 
AND IFNULL(V.OBJVALUE,0) IN (2679,4611,4612,4613,4614,4615,4616,4618,4619)
GROUP BY 1  ;
 
SELECT O.FILIAL, O.VES AS OTGR, O.SUMMA AS SUMOTGR, V.VES AS
VOZV, V.SUMMA AS SUMVOZV, K.SUMMA AS SUMKORR
INTO #ALLRES
FROM #OTGR O
FULL JOIN  #VOZV V ON O.FILIAL=V.FILIAL FULL JOIN  #KORR K ON O.FILIAL=K.FILIAL; 
 
SELECT FILIAL.NAME AS FILIAL, OTGR, SUMOTGR, VOZV, SUMVOZV, SUMKORR
FROM
#ALLRES O
LEFT OUTER JOIN CLIENT FILIAL ON FILIAL.KODKLI=O.FILIAL ORDER BY 1
 
"Mark Wilkins" <mark@no.email> сообщил/сообщила в новостях следующее: news:4ba93a9f@solutions.advantagedatabase.com...
> Both of those statements return the result set.  I think you only need to
> run the first one to get the cursor back:
>
> select * into #tmp from client;
>
> Mark Wilkins
> Advantage R&D
>
> "devzone.advantagedatabase.com" <alex_black@mail.ru> wrote in message
> news:4ba8908a@solutions.advantagedatabase.com...
>> SQL Script
>>
>> select * into #tmp from client;
>> select * from #tmp
>>
>> Do not create an error, but with outstanding results. It seems that the
>> second request is not in any way. How to solve this problem?
>>
>
>


Joachim Duerr (ADS) Posted on 2010-03-24 08:35:42.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: SQL Script with ODBC
Newsgroups: Advantage.ODBC
References: <4ba8908a@solutions.advantagedatabase.com> <4ba93a9f@solutions.advantagedatabase.com> <4ba9c88a@solutions.advantagedatabase.com>
Date: Wed, 24 Mar 2010 09:35:42 +0100
User-Agent: XanaNews/1.19.1.194
X-Face: u2p+</,mb|Ah!x!/qxX5q0t:O~.<1&JzwNHYhSqcviY{~&|iDc"U.Je1A.ZeHR`d;;y#R
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.155
Message-ID: <4ba9ce56@solutions.advantagedatabase.com>
X-Trace: 24 Mar 2010 02:33:26 -0700, 10.56.66.155
Lines: 15
Path: solutions.advantagedatabase.com!10.56.66.155
Xref: solutions.advantagedatabase.com Advantage.ODBC:1878
Article PK: 1133254


Sitnik Alexander wrote:

>This is just an example of what the second query returns no results.
>In fact, the request is much more complicated and contains data from
>a number of temporary tables:

if you run that script in ARC - does it return a cursor? I'm pretty
sure it does. So the only question is why ODBC doesn't.
In which environment do you use the ODBC driver? Could it be that your
IDE doesn't pass through the SQL statement and threads it as a script?

--
Joachim Duerr
Advantage Presales
check out my new ADS book on http://www.jd-engineering.de/adsbuch


Sitnik Alexander Posted on 2010-03-24 12:57:22.0Z
From: "Sitnik Alexander" <alex_black@mail.ru>
Newsgroups: Advantage.ODBC
References: <4ba8908a@solutions.advantagedatabase.com> <4ba93a9f@solutions.advantagedatabase.com> <4ba9c88a@solutions.advantagedatabase.com> <4ba9ce56@solutions.advantagedatabase.com>
Subject: Re: SQL Script with ODBC
Date: Wed, 24 Mar 2010 14:57:22 +0200
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Antivirus: avast! (VPS 100324-0, 24.03.2010), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 193.109.249.137
Message-ID: <4baa0b9d@solutions.advantagedatabase.com>
X-Trace: 24 Mar 2010 06:54:53 -0700, 193.109.249.137
Path: solutions.advantagedatabase.com!193.109.249.137
Xref: solutions.advantagedatabase.com Advantage.ODBC:1879
Article PK: 1133255

In ARC all ok. I test this script in Microsoft Query, Borland SQL Explorer.
I test this script in Microsoft Query, Borland SQL Explorer. Return No
result, or error :-(

"Joachim Duerr (ADS)" <jojo.duerr@gmx.de> ???????/???????? ? ????????
?????????: news:4ba9ce56@solutions.advantagedatabase.com...

> Sitnik Alexander wrote:
>
>>This is just an example of what the second query returns no results.
>>In fact, the request is much more complicated and contains data from
>>a number of temporary tables:
>
> if you run that script in ARC - does it return a cursor? I'm pretty
> sure it does. So the only question is why ODBC doesn't.
> In which environment do you use the ODBC driver? Could it be that your
> IDE doesn't pass through the SQL statement and threads it as a script?
>
> --
> Joachim Duerr
> Advantage Presales
> check out my new ADS book on http://www.jd-engineering.de/adsbuch