473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

brackets added to pass through query

Hello All,

Why would brackets be added to the SQL of a pass through query to
Oracle?

If I paste the debug print of the SQL statement into SQLPlus of Oracle's
XE edition it works, and does NOT have brackets around the tablespace
preceding the table name. However when I create the pass through query
in VB brackets are placed around the tablespace, and the pass through
query does NOT work. If I eliminate the brackets around the tablespace
in the pass through query in Access it works.

Any ideals on how to eliminate the brackets around the tablespace when
the SQL of the pass through query is created in VB?

TIA!

You will find below the following:

1 debug print of pass through query in VB,

2 pass through query saved in Access module by VB, &

3 code creating the pass through query.

,----- [ 1 debug print of pass through query in VB ]
| select NVL(sum(ActualRev), 0) as TotActRev, NVL(sum(BudgetRev), 0) as
| TotBdtRev, NVL(sum(PrYrRev), 0) as TotPyRev FROM sc.tblSummary WHERE
| (PdNo = 2) AND (TypeOfMetric = 'Ord');
`-----

,----- [ 2 pass through query saved in Access module by VB ]
| SELECT NVL(sum(ActualRev), 0) AS TotActRev, NVL(sum(BudgetRev), 0) AS
| TotBdtRev, NVL(sum(PrYrRev), 0) AS TotPyRev
| FROM [sc].tblSummary
| WHERE (PdNo = 2) AND (TypeOfMetric = 'Ord');
`-----

=====================>Begin Code>===================================>3a
Private Sub Report_Open(Cancel As Integer)
Dim wsCur As DAO.Workspace
Dim dbCur As DAO.Database
Dim qdfPassThrew As DAO.QueryDef
Dim strSQL As String

Set wsCur = DBEngine.Workspaces(0)
Set dbCur = wsCur.Databases(0)

Call SetConStr

If DoesQryExist("qryMTDOrdRev") Then
dbCur.QueryDefs.Delete ("qryMTDOrdRev")
End If

strSQL = "select NVL(sum(ActualRev), 0) as TotActRev, " & _
"NVL(sum(BudgetRev), 0) as TotBdtRev, " & _
"NVL(sum(PrYrRev), 0) as TotPyRev " & _
"FROM sc.tblSummary " & _
"WHERE (PdNo = 2) AND (TypeOfMetric = 'Ord');"

Debug.Print strSQL
'create query
Set qdfPassThrew = dbCur.CreateQueryDef("qryMTDOrdRev", strSQL)
qdfPassThrew.Connect = "ODBC;" & strCnn

Set qdfPassThrew = Nothing
Set dbCur = Nothing
Set wsCur = Nothing
RefreshDatabaseWindow

End Sub
=====================<End Code<=====================================<3a

=====================>Begin Code>===================================>3b
Function DoesQryExist(strQryName As String) As Boolean
Dim db As Database
Dim qdef As QueryDef
Set db = CurrentDb
On Error Resume Next
Set qdef = db.QueryDefs(strQryName)
If Err.Number = 3265 Then
DoesQryExist = False
Else
DoesQryExist = True
End If
Set qdef = Nothing
Set db = Nothing
End Function
=====================<End Code<=====================================<3b

Again thanks!

--
Regards,

Greg Strong
Aug 19 '06 #1
1 4263
On Sat, 19 Aug 2006 15:23:37 -0500, Greg Strong
<ne*********@geedubeeu.com.invalidwrote:
>Why would brackets be added to the SQL of a pass through query to
Oracle?

Apparently the order. I set up PT query with the help of this link at
http://support.microsoft.com/kb/q112108/ and no brackets now. Thanks to
Bob P. in another user group for the link.

--
Regards,

Greg Strong
Aug 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: deko | last post by:
Do I need to use curly brackets in PHP if .. else statements? other constructs? Does it matter? What are Best Practices? Why? thanks in advance... This seems to work WITHOUT curly brackets:...
3
by: Eric Ellsworth | last post by:
Hi all, Does anyone have any bright ideas for Access' tendency to add square brackets when it parses queries, then tell you that the query syntax is invalid. In my case, I'm trying to do a LEFT...
8
by: Tcs | last post by:
I've been stumped on this for quite a while. I don't know if it's so simple that I just can't see it, or it's really possible. (Obviously, I HOPE it IS possible.) I'm trying to get my queries...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
24
by: dmitrey | last post by:
Hi all, I looked to the PEPs & didn't find a proposition to remove brackets & commas for to make Python func call syntax caml- or tcl- like: instead of result = myfun(param1, myfun2(param5,...
2
by: Peter | last post by:
Hi, I was wondering, can anyone tell me what statements in angle brackets are for in VB? For example, the default <System.Diagnostics.DebuggerStepThrough()thing that the IDE puts before the...
37
by: dorayme | last post by:
Is there some particular reason that the inventors of CSS chose to leave us with the legacy of the curly brackets (for which one has to shift press) rather than the square (for which one simply...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.