[GRLUG] Postgresql help

Richard Maloley II richard at rrcomputerconsulting.com
Tue Apr 12 14:30:29 EDT 2011


This is not a stored process. This is a vendor provided database so I do not
have write access to the database in order to store new processes/functions.

I would normally do this in PHP however I am trying to get this query to run
from our monitoring toolset (NimSoft's NimBUS) which cannot pass in the
required variable.

*Richard Maloley II*
*Rick and Richard Computer Consulting*
p: 616-745-6914
e: richard at rrcomputerconsulting.com
w: http://www.rrcomputerconsulting.com




On Tue, Apr 12, 2011 at 2:23 PM, Roger Roelofs <roger.roelofs at gmail.com>wrote:

> Richard,
>
> Is this a stored proc?  We hormally handle stuff like this by
> dynamically constructing the sql in php.
>
> On Tue, Apr 12, 2011 at 2:10 PM, Richard Maloley II
> <richard at rrcomputerconsulting.com> wrote:
> > Hello,
> > I'm trying to create a really simple query against a Postgresql database.
> > This database creates a new table every single day for daily statistics,
> > therefore all tables are named the same except for the different date
> > appended to the name.
> > My query right now is simple: Execute a single SQL statement that will
> > gather data from the correct daily table depending on the day. For
> example:
> > SELECT * FROM tnt_audit.summaryreport_login_stats_20110412;
> > The above query will select all of the data for today. The date piece,
> > 20110412, needs to be dynamically changed. Here is what I thought of:
> > SELECT
> > *
> > FROM
> > tnt_audit.summaryreport_login_stats_(CURRENT_DATE)
> > ;
> > However this results in the following error message:
> > ERROR:  function tnt_audit.summaryreport_login_stats_(date) does not
> exist
> > LINE 4:  tnt_audit.summaryreport_login_stats_(CURRENT_DATE)
> >          ^
> > HINT:  No function matches the given name and argument types. You might
> need
> > to add explicit type casts.
> > ********** Error **********
> > ERROR: function tnt_audit.summaryreport_login_stats_(date) does not exist
> > SQL state: 42883
> > Hint: No function matches the given name and argument types. You might
> need
> > to add explicit type casts.
> > Character: 17
> > I'm no SQL expert and I've been unable to find any direction on how to
> > accomplish this. I feel as though it should be simple to append this data
> to
> > the table name but the answer eludes me. For reference we are using
> version
> > 8.x of the database.
> > Thanks,
> > Richard Maloley II
> > Rick and Richard Computer Consulting
> > p: 616-745-6914
> > e: richard at rrcomputerconsulting.com
> > w: http://www.rrcomputerconsulting.com
> >
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> > _______________________________________________
> > grlug mailing list
> > grlug at grlug.org
> > http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> >
>
>
>
> --
> Roger
>
> Roger Roelofs
> Know what you value.
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shinobu.grlug.org/pipermail/grlug/attachments/20110412/e7736a08/attachment-0001.html>


More information about the grlug mailing list