[Info-Ingres] SQL question - off topic

DATABASE

    Sponsored Links

    Next

  • 1. TERM_INGRES FOR w2k
    Hello, II_CHARSET<ii_installation_id> = WIN1252 TERM_INGRES = IBMPCD Works fine for me on W2K for r3 If you still don't have any luck, i would recommend unloading the database and reinstall. I initially had the same problem and TERM_INGRES was not working, and as it was only a test installation i removed and reinstalled leaving the character and terminal defaults. HTH m00n
  • 2. Connect Limit
    Hi Teisha, You are correct with regards to the connect_limit for the dbms, but the error you are encounting is ... E_GC2214_MAX_IB_CONNS GCC server has exceeded max inbound connections Is related to the users/sessions that connect over ingres net. If you look at the 'Net Server' in CBF you will see inbound_limit (default 64 connections) check that parameter and if majority of all the sessions connecting to the database is via Ingres/NET then i would probably make the inbound_limit and connect_limit to be the same. Hope this helps. m00n. > From: XXXX@XXXXX.COM > [mailto: XXXX@XXXXX.COM ] On Behalf Of Winkler, Teisha > Sent: Thursday, September 15, 2005 2:22 PM > To: XXXX@XXXXX.COM > Subject: [Info-ingres] Connect Limit > > If you set the connect_limit in CBF to 256 - do you really get 256 > connections available to you, or are part of those used up by internal > system connections? > > Ii have Ingres II 2.0 patch 9599 on AIX. > > I recently got message E_GC2214_MAX_IB_CONNS GCC server has exceeded max > inbound connections. Am I correct in saying that increasing the > connect_limit would correct this issue? > > Thanks, teisha > > Teisha Winkler > EDS - Lordstown Complex

[Info-Ingres] SQL question - off topic

Postby Roger Hill » Sat, 07 Jul 2007 04:29:18 GMT

Hi Guys:

This is a general SQL question, not specifically Ingress-related. But I 
know there are some experts on this list!

I have a table which has rows like:
Currency_code
Start_date
End_date
Other_data

For any given currency, I should have rows like:

CURR 20070101 20070315
CURR 20070315 20070620
CURR .....
CURR 20070723 NULL

That is, the end date of the row should match the start date of the next 
row, if we view the rows in START_DATE sequence.

I need to validate that this is in fact so. I.e that there are no gaps 
in coverage.
It is a (one-off)diagnostic task only - there is no need for the 
solution to be elegant, it just has to work: nevertheless, elegance is a 
'good thing'.

It is a given that the latest row will always have a null end_date, and 
start_date will always be non-null.

My current approach is in three parts:

1. Verify that end_date> start_date for all rows, counting null as 
2039-12-31 via a coalesce.
2. Create a temporary table of 'min(start_date)' for all currencies.
3. Do an exception join of all start dates against all end_dates, where 
the start_date is not equal to the corresponding min(start_date) from 
the temporary table, and end_date is not null.
i.e validate that the starts and ends match, excluding the first start 
date and latest end_date.

This seems to work ok, but can anyone come up with a better all-SQL 
solution?

Cheers
Roger




Re: [Info-Ingres] SQL question - off topic

Postby Karl & Betty Schendel » Sat, 07 Jul 2007 07:37:18 GMT


...

This is off the cuff, and probably not quite right;
but maybe close enough to get you there:

select ...
from table t1
where end_date is not null
  and (start_date >= end_date
       or not exists (select start_date
             from table t2
             where t2.start_date = t1.end_date
             group by start_date
             having count(*) = 1));


select all rows in error: start-end out of sequence,
or zero or more than one row with a start date
matching this end date.

Karl

Re: [Info-Ingres] SQL question - off topic

Postby Roger Hill » Sat, 07 Jul 2007 20:50:35 GMT

Thanks Karl:

I've not had time to try this today, but will do on Monday.

many Thanks

Roger






Re: [Info-Ingres] SQL question - off topic

Postby Roger Hill » Thu, 12 Jul 2007 02:19:26 GMT

Karl:

That worked just fine.  Many thanks.

Roger


Thanks Karl:

I've not had time to try this today, but will do on Monday.

many Thanks

Roger





_______________________________________________
Info-Ingres mailing list
 XXXX@XXXXX.COM 
 http://www.**--****.com/ 


Re: [Info-Ingres] SQL question - off topic

Postby Roger Hill » Fri, 20 Jul 2007 14:23:56 GMT

--CELKO--

Thanks for the alternative code. We do in fact use the half-open 
intervals...just cleaning up after finding bugs in some code --

Thanks again.

Roger




Similar Threads:

1.[Info-ingres] RES: [Info-ingres] RES: [Info-ingres] SQL Injection attacks

> -----Mensagem original-----
> De:  XXXX@XXXXX.COM  
> [mailto: XXXX@XXXXX.COM ] Em nome de Emiliano
> Enviada em: Monday, June 12, 2006 10:06 AM
> Para:  XXXX@XXXXX.COM 
> Assunto: Re: [Info-ingres] RES: [Info-ingres] SQL Injection attacks
> 
> On 2006-06-12, Leandro Pinto Fava < XXXX@XXXXX.COM > wrote:
> > Three years ago we had a case of SQL Injection against our web
portal of
> > students's info. This portal was made using ICE and reports in 1999
> > (with very bad security control). Now we have this portal made in
PHP
> > and the possibility of SQL injection is nearly null (I think :-().
We
> > had another web application (ASP) that suffered a successful SQL
> > injetcion too. The problems were corrected as well.
> 
> And (to hook into the delightful discussion I'm having with Roy), I'll
> bet you dimes to dollars that both were using query assembly.

The ASP app was, but the ICE app was not directly. Report Writer
internally should work with query assembly when passing parameters to
run a report.

> 
> The PHP function addslashes ought to protect you if you use it
> consistently. PHP ADODb has parameter binds, which are better.

Yes.

> 
> > In our case the problems were in the application layer.
> 
> HTML injection?

No, when I said application layer, I wanted to say the problem was not
in database server.

Leandro.

2.[Info-ingres] RES: [Info-ingres] RES: [Info-ingres] SQL Injection attacks

3.SQL question - off topic

>> This seems to work ok, but can anyone come up with a better all-SQL solution? <<

Create a Calendar table with all the temporal data you need for the
enterprise.  Make it 100 years long -- storage is cheap.  This is a
general purpose tool.  You need to get rid of the overlaps in your
(start_date, end_date) pairs and use the ISO half-open interval model
for the ranges.  It will make life a lot easier!

SELECT DISTINCT F1.currency_code AS bad_data
  FROM (SELECT cal_date
          FROM Calendar
         WHERE cal_date
               BETWEEN (SELECT MIN(start_date)
                          FROM Foobar AS F2
                         WHERE F1.currency_code = F2.currency_code)
                   AND CURRENT_TIMESTAMP) AS C1(cal_date)
       LEFT OUTER JOIN
       Foobar AS F1
       ON C1.cal_date BETWEEN F1.start_date
               AND COALESCE (F1.end_date, CURRENT_TIMESTAMP)
 GROUP BY F1.currency_code
 HAVING COUNT(C1.cal_date) <> 1;

it would be easier if there was a single minimum start date for all
currencies.  The idea is to see that each calendar date occurs once
and only once in each currency's date ranges.

This does not tell you what the missing dates are, just which currency
has a gap.

4.[Info-Ingres] Ingres SQL question

5.[Info-ingres] RES: [Info-ingres] SQL Injection attacks

6. [Info-Ingres] very slow login times - off topic

7. [Info-Ingres] Off topic tape backup

8. [Info-Ingres] Mounting the clone...a little off topic



Return to DATABASE

 

Who is online

Users browsing this forum: No registered users and 9 guest