wrong parsing SQL statements

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C2A5ED.5D254130
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

I have a complex SQL Statements like this:

SELECT pms_list_temp.lot_no,
   pms_list_temp.wo_no,  =20
   pms_list_temp.seq, =20
   pms_list_temp.ord_seq2,
   pms_list_temp.m_itemno,
   pms_list_temp.delivery_name,=20
   pms_list_temp.dep_no,
   pms_list_temp.wo_qty,
   pms_list_temp.dship,
   pms_list_temp.work_center,  =20
   pms_list_temp.work_group,
   pms_list_temp.catch_date,
   pms_list_temp.a26_del,
   pms_list_temp.a13_del,
   pms_list_temp.a37_del,
   pms_list_temp.other_del,=20
   pms_list_temp.air_del,      =20
   pms_list_temp.a01_del,      =20
   pms_list_temp.a11_del,      =20
   pms_list_temp.a73_del,      =20
   pms_list_temp.p18_del,      =20
   pms_list_temp.m99_del,        =20
   pms_list_temp.main_cust,=20
   pms_list_temp.ie_date,  =20
   pms_list_temp.dd,    =20
   pms_list_temp.code,    =20
   material.m_name,
   material.m_spec5,
   pms_list_temp.mold_bore,
   map      =3D ( Select m_map
        From order2, material=20
        Where order2.m_itemno =3D material.m_itemno
        And lot_no =3D pms_list_temp.lot_no),
         cfm_date =3D ( Select top 1 cfm_date  =20
                      From pms_cfm
                      Where wo_no =3D pms_list_temp.wo_no=20
                      And wo_seq =3D pms_list_temp.seq
                      Order by cfm_seq desc),
         cfm_note =3D ( Select top 1 note=20
                      From pms_cfm, tb0501
                      Where dep_no =3D depano
                      And delay_code =3D code =20
                      And wo_no =3D pms_list_temp.wo_no=20
                      And wo_seq =3D pms_list_temp.seq
                      Order by cfm_seq desc )
FROM pms_list_temp,
     material   =20
Where pms_list_temp.m_itemno =3D material.m_itemno
      and pms_list_temp.work_center =3D :ls_vc_no
      and pms_list_temp.ie_date >=3D :ldt_ie_date1
      and pms_list_temp.ie_date < :ldt_ie_date2
Order by pms_list_temp.work_center ,  pms_list_temp.dep_no

I used n_cst_sql to Parse the SQL, the where Clause and the order Clause =
is Wrong.

from LEO

------=_NextPart_000_000A_01C2A5ED.5D254130
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dbig5" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DMingLiu size=3D2>I have a complex SQL Statements like=20
this:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DMingLiu=20
size=3D2>SELECT&nbsp;pms_list_temp.lot_no,<BR>&nbsp;&nbsp;&nbsp;pms_list_=
temp.wo_no,&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.seq,&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.ord_seq2,<BR>&nbsp;&nbsp;&nbsp;pms_li=
st_temp.m_itemno,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.delivery_name,=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.dep_no,<BR>&nbsp;&nbsp;&nbsp;pms_list=
_temp.wo_qty,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.dship,<BR>&nbsp;&nbsp;&n=
bsp;pms_list_temp.work_center,&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.work_group,<BR>&nbsp;&nbsp;&nbsp;pms_=
list_temp.catch_date,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.a26_del,<BR>&nbs=
p;&nbsp;&nbsp;pms_list_temp.a13_del,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.a=
37_del,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.other_del,=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.air_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.a01_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.a11_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.a73_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.p18_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.m99_del,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.main_cust,=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.ie_date,&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.dd,&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.code,&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;material.m_name,<BR>&nbsp;&nbsp;&nbsp;material.m_sp=
ec5,<BR>&nbsp;&nbsp;&nbsp;pms_list_temp.mold_bore,<BR>&nbsp;&nbsp;&nbsp;m=
ap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D ( Select m_map<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From =
order2,=20
material <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Where =
order2.m_itemno =3D=20
material.m_itemno<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; And =
lot_no =3D=20
pms_list_temp.lot_no),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
cfm_date =3D ( Select top 1 cfm_date&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
From=20
pms_cfm<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Where wo_no =3D pms_list_temp.wo_no=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
And wo_seq =3D=20
pms_list_temp.seq<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Order by cfm_seq =
desc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
cfm_note =3D ( Select top 1 note=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
From pms_cfm,=20
tb0501<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Where dep_no =3D=20
depano<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
And delay_code =3D code&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
And wo_no =3D pms_list_temp.wo_no=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
And wo_seq =3D=20
pms_list_temp.seq<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
Order by cfm_seq desc )<BR>FROM =
pms_list_temp,<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
material&nbsp;&nbsp;&nbsp; <BR>Where pms_list_temp.m_itemno =3D=20
material.m_itemno<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and=20
pms_list_temp.work_center =3D =
:ls_vc_no<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and=20
pms_list_temp.ie_date &gt;=3D =
:ldt_ie_date1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and=20
pms_list_temp.ie_date &lt; :ldt_ie_date2<BR>Order by =
pms_list_temp.work_center=20
,&nbsp; pms_list_temp.dep_no</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D=B2=D3=A9=FA=C5=E9 size=3D2>I used n_cst_sql to Parse =
the SQL, the where Clause=20
and the order Clause is Wrong.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu size=3D2>from LEO</FONT></DIV></BODY></HTML>

------=_NextPart_000_000A_01C2A5ED.5D254130--

0
leo
12/17/2002 8:57:20 AM
sybase.powerbuilder.pfc 6437 articles. 1 followers. Follow

8 Replies
413 Views

Similar Articles

[PageSpeed] 41

we need to know the Database you are using.

But from my recent experience with Sqlserver7/2000 the select statement is 
wrong because pms list temp has a space.

if the table is truely called "pms list" then you'll have to put square 
brackets like so

from [pms_list] temp

I'm also assuming that temp is your alias for [pms list]...

then in you select section you'd refer to each column as temp.id...etc 


however if the table name is "pms list temp" then the from statement would 
be

from [pms list temp]

and you'd have [pms list temp] for each column


I'm pretty sure Oracle and Sybase sql server are similar and don't like 
spaces in their table names.

hope it helps and let us know.
0
cfauvel
12/17/2002 3:01:01 PM
We used MS SQL 7.0 Database Server, and it is not space in [pms_list_temp],

I find the wrong reasong is in these script:

They find the first [order by] position , it cause the error;s mainly
reason,
you must find the last [order by] key words to parse the SQL statements.

// -----------Script for parse the SQL statements
// There is a maximum of 7 keywords
 For li_KWNum = 7 To 1 Step -1
  If ls_Keyword[li_KWNum] <> "" Then
   // Find the position of the Keyword
   li_Pos = Pos(ls_UpperSQL, ls_Keyword[li_KWNum]) - 1            // Error
in Find

   If li_Pos >= 0 Then
    ls_Clause[li_KWNum] = Right(ls_SQL[li_Cnt], &
             (Len(ls_SQL[li_Cnt]) - &
              (li_Pos + Len(ls_Keyword[li_KWNum]))))
    ls_SQL[li_Cnt] = Left(ls_SQL[li_Cnt], li_Pos)
   Else
    ls_Clause[li_KWNum] = ""
   End if
  End if
 Next

The SQL statements like this:
// ---Start-----------------------------------------------------------
SELECT pms_list_temp.lot_no,
   pms_list_temp.wo_no,
   pms_list_temp.seq,
   pms_list_temp.ord_seq2,
   pms_list_temp.m_itemno,
   pms_list_temp.delivery_name,
   pms_list_temp.dep_no,
   pms_list_temp.wo_qty,
   pms_list_temp.dship,
   pms_list_temp.work_center,
   pms_list_temp.work_group,
   pms_list_temp.catch_date,
   pms_list_temp.a26_del,
   pms_list_temp.a13_del,
   pms_list_temp.a37_del,
   pms_list_temp.other_del,
   pms_list_temp.air_del,
   pms_list_temp.a01_del,
   pms_list_temp.a11_del,
   pms_list_temp.a73_del,
   pms_list_temp.p18_del,
   pms_list_temp.m99_del,
   pms_list_temp.main_cust,
   pms_list_temp.ie_date,
   pms_list_temp.dd,
   pms_list_temp.code,
   material.m_name,
   material.m_spec5,
   pms_list_temp.mold_bore,
   map      = ( Select m_map
        From order2, material
        Where order2.m_itemno = material.m_itemno
        And lot_no = pms_list_temp.lot_no),
         cfm_date = ( Select top 1 cfm_date
                      From pms_cfm
                      Where wo_no = pms_list_temp.wo_no
                      And wo_seq = pms_list_temp.seq
                      Order by cfm_seq desc),
         cfm_note = ( Select top 1 note
                      From pms_cfm, tb0501
                      Where dep_no = depano
                      And delay_code = code
                      And wo_no = pms_list_temp.wo_no
                      And wo_seq = pms_list_temp.seq
                      Order by cfm_seq desc )
FROM pms_list_temp,
     material
Where pms_list_temp.m_itemno = material.m_itemno
      and pms_list_temp.work_center = :ls_vc_no
      and pms_list_temp.ie_date >= :ldt_ie_date1
      and pms_list_temp.ie_date < :ldt_ie_date2
Order by pms_list_temp.work_center ,  pms_list_temp.dep_no
 ---End-------------------------------------------------------- */


<cfauvel> ?????
news:4A03973F3520212C00527D6585256C92.00358EFB85256C92@webforums...
> we need to know the Database you are using.
>
> But from my recent experience with Sqlserver7/2000 the select statement is
> wrong because pms list temp has a space.
>
> if the table is truely called "pms list" then you'll have to put square
> brackets like so
>
> from [pms_list] temp
>
> I'm also assuming that temp is your alias for [pms list]...
>
> then in you select section you'd refer to each column as temp.id...etc
>
>
> however if the table name is "pms list temp" then the from statement would
> be
>
> from [pms list temp]
>
> and you'd have [pms list temp] for each column
>
>
> I'm pretty sure Oracle and Sybase sql server are similar and don't like
> spaces in their table names.
>
> hope it helps and let us know.


0
leo
12/18/2002 2:29:59 AM
Yikes!!! I see how that would be difficult to parse correctly.

Sorry but I can't help you there....was that code from the PFC?
0
cfauvel
12/18/2002 4:11:40 PM
Yes, it's code from pfc, the userobject is n_cst_sql's of_parse

Can sybase team fix this problem?

<cfauvel> ?????
news:3D7B5F66A4A5052B0058F59C85256C93.0011C2D585256C93@webforums...
> Yikes!!! I see how that would be difficult to parse correctly.
>
> Sorry but I can't help you there....was that code from the PFC?


0
leo
12/19/2002 12:05:03 AM
I post this bug for a long time.
But I'm not heard how to solute this bug or how long this bug will be fixed.
Can anyone tell me?

Thanks for your help!




"leo" <leo@mail.nak.com.tw> ���g��l��
news:soU9GQvpCHA.82@forums.sybase.com...
> Yes, it's code from pfc, the userobject is n_cst_sql's of_parse
>
> Can sybase team fix this problem?
>
> <cfauvel> ?????
> news:3D7B5F66A4A5052B0058F59C85256C93.0011C2D585256C93@webforums...
> > Yikes!!! I see how that would be difficult to parse correctly.
> >
> > Sorry but I can't help you there....was that code from the PFC?
>
>


0
leo
1/3/2003 8:48:36 AM
This has been a "limitation" of the object for quite some time.  I doubt
there will be any resolution as the complexity of the SQL language (and its
many variants) would require a complete SQL parser.  If you think it is a
bug, you should open a case with Sybase.  Good luck!

"leo" <leo@mail.nak.com.tw> wrote in message
news:9wbuzawsCHA.338@forums.sybase.com...
> I post this bug for a long time.
> But I'm not heard how to solute this bug or how long this bug will be
fixed.
> Can anyone tell me?
>
> Thanks for your help!
>
>
>
>
> "leo" <leo@mail.nak.com.tw> ���g��l��
> news:soU9GQvpCHA.82@forums.sybase.com...
> > Yes, it's code from pfc, the userobject is n_cst_sql's of_parse
> >
> > Can sybase team fix this problem?
> >
> > <cfauvel> ?????
> > news:3D7B5F66A4A5052B0058F59C85256C93.0011C2D585256C93@webforums...
> > > Yikes!!! I see how that would be difficult to parse correctly.
> > >
> > > Sorry but I can't help you there....was that code from the PFC?
> >
> >
>
>


0
Scott
1/3/2003 1:14:41 PM
I am sad heard about this.   ~>.<~
Why Team Sybase didn't response me?

"Scott Morris" <bogus@microsoft.com> ���g��l��
news:PCmEWyysCHA.339@forums.sybase.com...
> This has been a "limitation" of the object for quite some time.  I doubt
> there will be any resolution as the complexity of the SQL language (and
its
> many variants) would require a complete SQL parser.  If you think it is a
> bug, you should open a case with Sybase.  Good luck!
>
> "leo" <leo@mail.nak.com.tw> wrote in message
> news:9wbuzawsCHA.338@forums.sybase.com...
> > I post this bug for a long time.
> > But I'm not heard how to solute this bug or how long this bug will be
> fixed.
> > Can anyone tell me?
> >
> > Thanks for your help!
> >
> >
> >
> >
> > "leo" <leo@mail.nak.com.tw> ���g��l��
> > news:soU9GQvpCHA.82@forums.sybase.com...
> > > Yes, it's code from pfc, the userobject is n_cst_sql's of_parse
> > >
> > > Can sybase team fix this problem?
> > >
> > > <cfauvel> ?????
> > > news:3D7B5F66A4A5052B0058F59C85256C93.0011C2D585256C93@webforums...
> > > > Yikes!!! I see how that would be difficult to parse correctly.
> > > >
> > > > Sorry but I can't help you there....was that code from the PFC?
> > >
> > >
> >
> >
>
>


0
leo
1/6/2003 4:00:59 AM
"leo" <leo@mail.nak.com.tw> wrote in message
news:47k4IoTtCHA.198@forums.sybase.com...
> I am sad heard about this.   ~>.<~
> Why Team Sybase didn't response me?


TeamSybase is not responsible for fixing errors in the PFC...

You have an extremely complex SQL statement that the PFC parser is choking
on.   You can either a) fix the SQL parser yourself as a PFE extension or
something (and then post the fix here so that others can benefit from your
effort); or b) rewrite your SQL statement to make it "parseable".

--
Paul Horan[TeamSybase]
VCI   Springfield, MA
www.vcisolutions.com



0
Paul
1/6/2003 3:02:33 PM
Reply:

Similar Artilces:

RE: SQL::Statement cannot parse valid Postgresql statement
> From: Terrence Brannon [mailto:metaperl@mac.com] > > On Monday, December 10, 2001, at 09:16 AM, Jeff Zucker wrote: > > > Terrence Brannon wrote: > >> > >> The following SQL is not parseable by SQL::Statement: > >> > >> INSERT > >> INTO thot_log (thot_fk,thot_type_fk,thot_temporality_fk,date) > >> VALUES (?,?,?,CURRENT_TIMESTAMP) > > What I have is a program which reads a SQL statement from a file. > It parses it with SQL::Statement, then it prepares this > statement, then does an ...

what is wrong with this sql statement
declare @name nvarchar(30) declare @Location nvarchar(30) declare @nonbill float declare @empType varchar(30) select @location=location, @Name = name, @empType = employeetype, @nonbill = CASE cbetts.v_payrolltotals.jobno WHEN left(cbetts.v_payrolltotals.jobno,3) = '900' THEN sum(totals) ELSE 0 END from cbetts.v_payrolltotals where userid = 1025 and we = '6/4/2004' i am getting the error for the case statment.. "Incorrect syntax near '=', Incorrect syntax near the keyword 'END'. You have to put the left argument as the CASE CONDITION: select @location=locat...

Parsing SQL Statements
Has anyone run across any code or utilities for getting information from complex SQL statements? I want to be able to collect the table names and column names from SQL statements with complex sub-queries. Any help or pointers would be appreciated. joe white joe@lemma.net Joe -- Check out n_cst_sql in the PFC. It has a function that will break up a sql command into individual components (select,from,where,order,...) and another that will recombine the components into a single command. One caveat about this. When I used the 5.0.3 version, it had problems where nested sele...

PFC SQL PARSING
Hi all: I use the SQL parsing service,when pass the SQL segment,the of_parse() function is not valid. SQL segment: SELECT "DO_MARKET_HOLD"."MARKET_FIRMID", (select count(unique dm_date) from do_market dm,do_market_hold dmh where dm.FIRMID=dmh.market_firmid) as dm_days, sum(market_qty) as z_market_qty, sum(market_firmqty) as z_market_firmqty FROM "DO_MARKET_HOLD" GROUP BY "DO_MARKET_HOLD"."MARKET_FIRMID" I'am alread looked for old newsgroup,but nobody give a clearly answer. PFC 9.0.0 Here's m...

wrong sql statement
hello folks , please help me with this last thing to finish off everything i am having search thing in my database , but there are 3 types of search , anyway i am not sure how to write the sql statement for that , this is what i wrote SELECT [ID], [Name], [Type], [Size], [Uploader], [fullName] FROM [Slides] WHERE @type LIKE '%' + @query + '%' am taking @type and @query from querystring but this statement isnt working...ny ideas? If there is more than one possible option in the WHERE clause, use optional parameters instead: http://steve.emxsoftware.com/Optional+Parameter...

parsing SQL statement
Anyone having suggestion parsing SQL statement? It should able to parse: BLA BALA BALA... VALUES( 'abcd efg',,999, 'some \"STRING\" and \'STR2\' STR3',,,, 'abcd, def, fghi' ) I'm using tr and then split by "," but it will fall when seeing comma inside the single quote. Thanks. --budhi On Fri, 2008-05-30 at 19:24 +0700, beast wrote: > Anyone having suggestion parsing SQL statement? > > It should able to parse: > > BLA BALA BALA... > > VALUES( > 'abcd efg',,999, 'so...

sql statement parsing
hi guys, how can i parse the where clause in an SQL::Statement object instance? $statement = SQL::Statement->new("select 1,2,3 from table where x=y"); now when i do this: $where = $stmt->where(); it gives me error: Can't locate object method "where" via package "SQL::Statement" (perhaps you for got to load "SQL::Statement"?) at blah line 34. any idea? thanks -- Hytham Shehab At 07:34 PM 8/10/02 +0300, Hytham Shehab wrote: > how can i parse the where clause in an SQL::Statement object instance? >$statement = S...

SQL statement and If statement
I've problem, it's in sqlcommand it's in "where" condition, which if it's exist in sql the "ELSE" not work, and if the condition not in sqlcommand the "ELSE" appear, could someone help  it's in selectcommand.CommandText = "SELECT Weekno FROM Weeks where Weekno='" + Weekno.Text + "'" if i delete the condition the " ELSE " appear. otherwise it's not appear whole code Dim myconnection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\football.mdf;Integrated S...

Whats wrong with my sql statement?
I have the following SQL statement: UPDATE product SET name = 'Big Johnson Baseballs', category_id = 7, brand_id = 4, description = 'These balls are gold!', condition_id = 1, count = 12, in_stock = True, price = 7.95, priority_id = 3, featured_product = True WHERE product_id = 2 It tells me I have a "syntax error". What am I doing wrong? Thanks. May be a hunch but, is count a reserved word? Its worked fine in all my select statements, but in my update its wigging out. >>May be a hunch but, is count a reserved word? prbly. also you missed a set of quotes ar...

Parsing columns from a sql statement
Hi, How I could get the name of the columns from a string variable that has a sql statement? "select this, that, (to_date('02-02-04','mm-dd-yy')) from table" I want to obtain the column names "this", "that" and (to_date('02-02-04','mm-dd-yy')) Thank you I would suggest to use the POS and MID functions. Joseph wrote: > Hi, How I could get the name of the columns from a string > variable that has a sql statement? > > "select this, that, (to_date('02-02-04','mm-dd-yy')) from >...

Whats wrong with this SQL statement
"UPDATE members SET myage = year(date()) - year(birthday) WHERE month(date()) - month(birthday) = 0" it didnt recoqnize date? date() is not a sql function getDate() is the proper syntaxBlindeddie...

Showing parsed SQL statement?
In classic ASP, I used to be able to do a response.write(SQL) to view a parsed SQL statement. Can I do this in .NET? I'm using a SQLDataSource container and want to see what I'm passing through in my INSERT statement. All I can seem to get are @parameters.Thanks!Stace Add OnInserting="SqlDataSource1_Inserting"  to your SqlDataSource and check the InsertCommand and parameter values as shown below. Another way is to use SQL Profiler from SSMS (SQL Server Management Studio) to trace what has been passed to SQL Server.  protected void SqlDataSource1_Inserting(objec...

sql server 2005 inserting prbblem..wrong SQL? wrong parameter?
Im trying to insert a record in my sql server 2005 express database.The following function tries that and without an error returns true.However, no data is inserted into the database...Im not sure whether my insert statement is correct: I saw other example with syntax: insert into table values(@value1,@value2)....so not sure about thatAlso, I havent defined the parameter type (eg varchar) but I reckoned that could not make the difference....Here's my code:        Function CreateNewUser(ByVal UserName As String, ByVal Password As String, _&nbs...

What's wrong with this SQL-statement ?
Hi all,SQL-statement :OLEDB.OLEDBCOMMAND ("SELECT ID, WK, NBR FROM Table1 WHERE nbr =" & stringvariable & ")" I got the error that there was expected a ')' The next command got the same error:OLEDB.OLEDBCOMMAND ("SELECT ID, WK, NBR FROM Table1 WHERE nbr ='" & stringvariable & "')" (This last one is with single quotes around the stringvariable)Help is appreciated, Ger.Ger (Carpe Diem) Since you have enclosed the closing parenthesis in double quotes it is being treated as a literal value.  Try this instead: OLEDB.OLEDBCOMMAND ("SELECT ID, WK, NBR FROM Table1 WHERE n...

PARSE SQL STATEMENT (Changing Where part)
Dear All, I wonder if there is a way to change the Where statement of a Sql statement withouth writing a custom code? For instance I need to change the "select * from employees where serial>100 order by serial" to "select * from employees where EmploymentDate is not null order by serial" Thanks a lot Aref K. Hi, Have that portion of "where ...." in a variable and then you can concatenate it to the query string. Like as follows:- Dim strWhrCon as string // then you can assign the where condition to this variable. strsql =...

Sql Statement Returns wrong results
Please take a look at this sql. Line 1 thru 4 are always true. However 5 thru 8 are optional. None or all may be true. Why it does not bring correct results. SELECT * FROM T 1. WHERE Dt = '9/21/2003' 2. AND Id = 3 3. AND T_CD = 130 4. AND V_CD = 0 5. AND Emp_NUM > 11000 AND Emp_NUM < 11999 6. OR Emp_NUM > 33000 AND Emp_NUM < 44999 7. OR Emp_NUM > 77000 AND Emp_NUM < 77999 8. OR Emp_NUM > 99000 AND Emp_NUM < 99999 Thanks Mashraf you need parantheses and where you need it xactly depends on the result tha...

Parsing a textbox for use in a SQL statement
How can I take the value of a textbox and parse out the indivdual words to use in a WHERE statement without having to result to having the user placing a special charater in between word?  I'm pulling the text out and doing the data pull in my code behind VB.net page. Thanks, Ty  you can use the string.split method and specify your own delimiter. http://msdn.microsoft.com/en-us/library/system.string.split.aspx or you can use the string.replace method and replace spaces with whatever character you want to delimit the words in the textbox Do you mean something like, the us...

Parsing complex datawindow SQL statements
Hello, I need to modify the where clause of a datawindow SQL expression at runtime. This cannot be done by using the using retrieval arguments, so I need to modify the TABLE.SELECT of the datawindow. In PFC there is a user object that does this, but it doens't handle the nested queries in the SELECT or WHERE clause. I have been looking around on the internet for hints that point me in the right direction, but I haven't found anything yet. Dipesh Panchal has posted a reply back in december 98 stating that he has done this, but there is no sample code nor details about the way...

Y2K: PowerBuilder and SQL Anywhere
My DoD client uses PowerBuilder 5.0.02 and Sybase SQL Anywhere 5.5.00. They are planning a migration to PowerBuilder 6.5 and Sybase SQL Anywhere 5.5.04 which are both certified for Y2K. The DoD requires a contingency plan (ie. What happens if we cannot deliver the modified code by 2000). This plan basically says based on know problems, how can they operate. What I need to know is the following: What are the real bugs in PowerBuilder 5.0.02 and Sybase SQL Anywhere 5.5.00? Any help and know bugs in these versions would be appreciated. Thanks Tim Kelly We are testing th...

Adding an IF Statement to the SQL Statement
I have the following tables and SQL statment which works out a league table for me from the given results. I am now trying to add a bit more to this: If the Walkover column = 1 then that row will be a home walkover meaning that the score will be 0(Home Score) - 0(Away Score) but the home team will recieve 3 points, and away team recieves 0 points, win column will be 1 and the played colum will be 1 as well.If the Walkover column = 2 then that row will be a home walkover meaning that the score will be 0(Home Score) - 0(Away Score) but the away team will recieve 3 po...

can any body tell me what wrong in my sql statement
Hi, can any body tell me what is wrong in my sql statement  SELECT title, price, Budget = CASE price WHEN price > 20.00 THEN 'Expensive' WHEN price BETWEEN 10.00 AND 19.99 THEN 'Moderate' WHEN price < 10.00 THEN 'Inexpensive' ELSE 'Unknown' END FROM titles it gives me this error Msg 170, Level 15, State 1, Line 3 Line 3: Incorrect syntax near '>'.   but when i use somthing like that i will works fine SELECT Budget i am using sql server 2000  Spread Your Knowledge, Get Known.Happy Programing:)  SELECT title, price, Budget = CASE WHE...

Parsing SQL statements in Delphi with Oracle [Edit]
Hi, I have a requirement for a DBA to compile once and run many times sql sentences. I tried with BDE, ADO and DBExpress but in all cases the number of parsing is equals executions Example in delphi: procedure TForm1.Button1Click(Sender: TObject); var i : integer; begin Query1.Close; for I := 1 to 20 do begin Query1.SQL.Clear; Query1.SQL.Add(' SELECT COUNT(8) FROM CONTAB WHERE CONTAB_FEHOULMO__B = :fecha'); Query1.ParamByName('fecha').value := edit1.text ; Query1.Prepare; Query1.OPEN; end; end; the trace in oracle show...

WRONG WRONG WRONG
Name: ROZ mandelcorn Email: thunderstaratearthlinkdotnet Product: Firefox Summary: WRONG WRONG WRONG Comments: as a long-time user, first of netscape and, mozilla firefox, i must say i DO NOT LIKE THE PLACEMENT of TABS in version 4. nor do i like the whole rearrangement of the upper/navigation portion of firefox. I NEED/WANT MY TABS DIRECTLY ABOVE MY WINDOWS AS IT IS NOW....NOT ON TOP OF THE BROWSER. I WANT MY FILE-EDIT-ETC-MENU on TOP. ETC. AT LEAST GIVE US THE CHOICE AS TO WHICH FORMAT WE WANT....CAN YOU SAY CUSTOMIZATION! I WILL NOT USE 4 IF THIS IS THE WAY IT IS. [just ...

Problem parsing SQL Statement with backslash and parameter
Hi We are migration from Ado to Firedac (for MSSQL) and noticed that not all existing SQL starements work as before. As an example such a statement won't work anymore (resulting in "Incorret syntax near ':'"): insert into table (field1, field2, field3) values ('test', '\\Server\Share\', :paField3Parameter). Is there a fix or another way how to change the behaviour of the component without the need to change the SQL statements? Thanks FireDAC by default considers '\' as an escape character. Because you are migrating from ADO and do n...

Web resources about - wrong parsing SQL statements - sybase.powerbuilder.pfc

User:Jimbo Wales/Statement of principles - Wikipedia, the free encyclopedia
As we move forward with software and social changes, I think it is imperative that I state clearly and forcefully my views on openness and the ...

Category:Articles containing potentially dated statements from June 2006 - Wikipedia, the free encyclopedia ...
This is an administration category . It is used for administration of the Wikipedia project and is not part of the encyclopedia. It contains ...

Cardinal George Pell's full statement
Leaked allegations spurious and false: Cardinal George Pell's full statement.


Boris: Leave Campaigners Concerned That London Mayor’s Statements Advocate ‘Associate Membership’ Of ...
Boris: Leave Campaigners Concerned That London Mayor's Statements Advocate 'Associate Membership' Of EU

Webster Hall issues statement after rapper Skate Maloley alleges security assaulted him
Skate Maloley at the Marlin Room at Webster Hall (photo via @camsgodiva) An altercation went down last night (2/20) in the Marlin Room of NYC's ...

GSMA Statement Regarding Planned Barcelona Transport Strike and Contingency Plans for Mobile World Congress ...
The metro and bus workers from TMB, the main public transport operator in the metropolitan area of Barcelona, have announced plans to strike ...

​Clinton rejects staffer statements that Nevada is "80 percent white"
"That's not me," she tells interviewer; calls Nevada "diverse," "exciting"

Bernie Sanders: Climate & Energy Statements At Last Night’s Speech
Bernie Sanders gave a long speech in Amherst, Massachusetts, last night. Below are key climate and energy statements he made there, which you ...

Chevrolet SportsNet Central Update: Bruins with a statement win
... Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN Chevrolet SportsNet Central Update: Bruins with a statement ...

Resources last updated: 2/24/2016 10:06:09 PM