Interesting!
What I wanted to avoid it build a new task but I see with your method
it is also needed.
Regards,
--- In magicu-l@yahoogroups.com, "Andy Jerison" <ajerison@...> wrote:
>
> OK, just remember I'm not necessarily recommending this....
>
> Suppose your table is called MyTable. Add a line to your data
repository.
> The Name could be something like "COUNT(*) FROM MyTable". The Data
source
> name has to be the name of the actual table, MyTable in my example.
Select
> the correct database.
>
> Add a single column with the name COUNT(*). Leave the DB Column name
> property alone; the studio will automatically enter COUNT(*). All
SQL data
> sources have to have at least one index, so create one -- I named
mine
> "Count" -- set its Index type property to "Virtual", and select the
column.
>
> At this point, if you generate and run a program from this data
source, you
> should get the result of SELECT COUNT(*) FROM MyTable.
>
> You want a FROM clause in your query, though. To get this, generate
a
> program from the table. On the Data tab of Task Properties,
set "Transaction
> mode" to Physical, "Transaction begin" to "on record lock". Only
tasks with
> Transaction type = Physical allow you to enter a DB SQL WHERE
clause, which
> you'll do next.
>
> In the task, press Ctrl+R to open the Range/Locate window. On
the "SQL
> Where" tab, enter the WHERE clause without the word WHERE. For
example:
>
> LastName LIKE 'T%'
>
>
> This works because Unipaas uses whatever text it finds in the "DB
Column
> name" property to build its SELECT statement. You can't include
other
> columns because SQL Server requires a GROUP BY clause if columns are
> specified after the COUNT() function, and I haven't figured out a
way to
> force the Unipaas gateway to add that. However, it's perfectly OK
to specify
> columns in the DB SQL WHERE clause that are not defined in the data
source
> entry. It's also fine to have more than one data source definition
for a
> single table.
>
> Ugly but effective,
>
> Andy J
>
> -----Original Message-----
> From: magicu-l@yahoogroups.com [mailto:magicu-l@yahoogroups.com] On
Behalf
> Of ChemaTercero
> Sent: Tuesday, January 06, 2009 12:07 PM
> To: magicu-l@yahoogroups.com
> Subject: [magicu-l] Re: Executing SQL
>
> Go ahead please.
>
> --- In magicu-l@yahoogroups.com, "Andy Jerison" <ajerison@> wrote:
> >
> > Chema,
> >
> > There is a trick that lets you use an ordinary task for this
> purpose, but
> > it's not usually a good idea. Let me know if you want to hear
about
> it.
> >
> > Andy J
> >
> > -----Original Message-----
> > From: magicu-l@yahoogroups.com [mailto:magicu-l@yahoogroups.com]
On
> Behalf
> > Of Andy Jerison
> > Sent: Tuesday, January 06, 2009 11:51 AM
> > To: magicu-l@yahoogroups.com
> > Subject: RE: [magicu-l] Re: Executing SQL
> >
> > Hi Chema,
> >
> > Normally, you'd use a direct SQL task for that sort of thing.
> >
> > Andy J
> >
> > -----Original Message-----
> > From: magicu-l@yahoogroups.com [mailto:magicu-l@yahoogroups.com]
On
> Behalf
> > Of ChemaTercero
> > Sent: Tuesday, January 06, 2009 11:46 AM
> > To: magicu-l@yahoogroups.com
> > Subject: [magicu-l] Re: Executing SQL
> >
> > So I was refering to Explicit SQL.
> >
> > I need to execute Select count(*) from table where...
> >
> > Do I need to use a task with a Direct SQL or can be done another
> way?
> >
> > I tried with an Evaluate but got not result.
> >
> > Regards,
> >
> > --- In magicu-l@yahoogroups.com, "Keith Canniff" <kcanniff@>
wrote:
> > >
> > > I'm not sure what you mean by this, but UP has both explicit
SQL
> > (SQL
> > > statements) and Implicit SQL (UP generates the SQL statements
for
> > locate,
> > > range, links, etc.)
> > >
> > > You decide which you want to do.
> > >
> > >
> > >
> > > From: magicu-l@yahoogroups.com [mailto:magicu-
l@yahoogroups.com]
> On
> > Behalf
> > > Of ChemaTercero
> > > Sent: Monday, January 05, 2009 11:42 PM
> > > To: magicu-l@yahoogroups.com
> > > Subject: [magicu-l] Executing SQL
> > >
> > >
> > >
> > > Hi,
> > >
> > > UP Discovery 1.0
> > >
> > > I was wondering if the only way to do this is with Direct SQL
> > statments
>