Oracle'izing a query
Alan Gamboa <[email protected]> Fri, 13 Sep 2002 15:55:31 -0400
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C25B5F.8448D2C0
Content-Type: text/plain;
charset="iso-8859-1"
I have following defined in my accessor:
DEFINE_COMMAND_EX(CMyAccessor,L" INSERT INTO MyTable(myField) VALUES(
SUBSTRING(?,1,3) ) ")
this query works fine in MS SQL Server but in Oracle you get
DB_E_ERRORSINCOMMAND.
Oracle uses SUBSTR() not SUBSTRING() - Is there an accepted method for
handling this situation other than creating another accessor for oracle or
doing a search replace on the command string?
tia
Alan Gamboa
CCG Systems, Inc.
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C25B5F.8448D2C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word"><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META content=3DWord.Document name=3DProgId>
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<META content=3D"Microsoft Word 10" name=3DOriginator><LINK=20
href=3D"cid:[email protected]" rel=3DFile-List><!--[if gte =
mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; =
mso-header-margin: .5in; mso-footer-margin: .5in; mso-paper-source: 0; =
}
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.EmailStyle17 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply; =
mso-style-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: =
10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; =
mso-bidi-font-family: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */=20
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=3DEN-US style=3D"tab-interval: .5in" vLink=3Dpurple =
link=3Dblue>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff size=3D2>I have=20
following defined in my accessor:</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002> <FONT =
face=3DArial=20
color=3D#0000ff size=3D2>DEFINE_COMMAND_EX(CMyAccessor,L" INSERT INTO=20
MyTable(myField) VALUES( SUBSTRING(?,1,3) ) ")</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff size=3D2>this=20
query works fine in MS SQL Server but in Oracle you get=20
DB_E_ERRORSINCOMMAND.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff size=3D2>Oracle=20
uses SUBSTR() not SUBSTRING() - Is there an accepted method for =
handling this=20
situation other than creating another accessor for oracle or doing a =
search=20
replace on the command string?</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>tia</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff size=3D2>Alan=20
Gamboa</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff size=3D2>CCG=20
Systems, Inc.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500303919-13092002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D500303919-13092002></SPAN> </DIV></BODY></HTML>
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C25B5F.8448D2C0--