Search the web
Sign In
New User? Sign Up
magicu-l · uniPaaS (Magic) Software Users Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Executing SQL   Message List  
Reply | Forward Message #137866 of 148729 |
Re: Executing SQL

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
>





Tue Jan 6, 2009 9:37 pm

ChemaTercero
Offline Offline
Send Email Send Email

Forward
Message #137866 of 148729 |
Expand Messages Author Sort by Date

Hi, UP Discovery 1.0 I was wondering if the only way to do this is with Direct SQL statments...
ChemaTercero
Offline Send Email
Jan 6, 2009
4:42 am

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,...
Keith Canniff
kbcanniff
Offline Send Email
Jan 6, 2009
11:57 am

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? ...
ChemaTercero
Offline Send Email
Jan 6, 2009
4:46 pm

Hi Chema, Normally, you'd use a direct SQL task for that sort of thing. Andy J ... From: magicu-l@yahoogroups.com [mailto:magicu-l@yahoogroups.com] On Behalf ...
Andy Jerison
ajerison
Offline Send Email
Jan 6, 2009
4:50 pm

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...
Andy Jerison
ajerison
Offline Send Email
Jan 6, 2009
5:04 pm

Go ahead please. ... purpose, but ... it. ... Behalf ... Behalf ... way? ... On...
ChemaTercero
Offline Send Email
Jan 6, 2009
5:06 pm

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...
Andy Jerison
ajerison
Offline Send Email
Jan 6, 2009
7:21 pm

Interesting! What I wanted to avoid it build a new task but I see with your method it is also needed. Regards, ... repository. ... source ... Select ... SQL...
ChemaTercero
Offline Send Email
Jan 6, 2009
9:37 pm

Another way is to use uniPaaS Invoke COM operations with Microsoft ActiveX Data Objects (ADODB). Steve Blank ... Steven G. Blank Salt Lake City, Utah USA...
Steven G. Blank
blanstev
Offline Send Email
Jan 6, 2009
8:55 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help