Re: Difference between tsql and libsybdb
Alberto Pulvirenti <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAJNp6N0iW8dYbHz5zi7EtP1D=rHf=sqeDuJew1C6c19xFThkgQ@mail.gmail.com> |
Hello, 2012/9/27 James K. Lowden <[email protected]> > On Tue, 25 Sep 2012 18:15:38 +0200 > Alberto Pulvirenti <[email protected]> wrote: > > > > Session properties aren't set by dbopen(). They're set via > > > T-SQL's SET command. Read up on that, and on @@options. (Nowadays > > > there's a function to query session properties individually, not > > > just as a bit mask.) > > > > This last paragraph I didn't fully understand. > > What may not be clear is that the problem you're seeing doesn't > manifest itself when you first open the connection. It shows up when > you issue that particular query. A simple query like > > SELECT 1 as 'one' > > will not fail. But one that requires e.g. CONCAT_NULL_YIELDS_NULL > will. > This is perfectly clear. Then, something which is sent by my dbopen() invocation maybe triggers some query that relies on this. I am just wanrdering what can this be, which is not done by the executable "tsql". > > CONCAT_NULL_YIELDS_NULL is a session property. Session properties in a > T-SQL session are set using the T-SQL SET command, cf. > http://msdn.microsoft.com/en-us/library/ms190356.aspx. Among the many > arcane things affected by session properties are the ability to create > indexed views and the ability to *use* an existing index of an indexed > view, cf. "Requirements for the CREATE INDEX Statement" at > http://msdn.microsoft.com/en-us/library/aa933148(v=SQL.80).aspx. > > > In any case, I suppose that I can issue such a SET command only once > > the DBPROCESS is properly initialized after dbopen(). > > English is a little ambiguous here. You can issue any number of SET > commands for the duration of the session, just as any query, after > dbopen() and before dbclose(). > I am very sorry since maybe I don't manage to express myself clearly enough. Anyway, that's the point. My application fails when I call dbopen(). Then, whatever needed to solve this problem I need to apply BEFORE calling dbopen(). That's what is driving me crazy. Thanks, Alberto > > HTH. > > --jkl > _______________________________________________ > FreeTDS mailing list > [email protected] > http://lists.ibiblio.org/mailman/listinfo/freetds >