sql select works in isql and not in datawindow code

im running with sybase 11 and i do a select statement like this

    select terminal_number, merchant_name=(select merchant_name from
merchant_data from table1 , table2
            where table2.field1 = convert(varchar, table3.field1)
and    table2.field2 = table1.field2 and table2.field3 =
table1.field3)
    from table3 where
    terminal_number = 1111 and
    ..........
and when i try to exit from datawindow datasource painter window (in text
mode) it says "Incorrect Syntax near the word "from""

and if i move my marchant_name field before the terminal number field it say
"Incorrect syntax near ",""
what can it be or how can i make it work.
i have pb651 on win98




0
Ramses
7/21/1999 2:20:41 PM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

3 Replies
511 Views

Similar Articles

[PageSpeed] 23

Looks like you are using more then just table3, why is that the only table after
the from clause?


Ramses Palomo wrote:

> im running with sybase 11 and i do a select statement like this
>
>     select terminal_number, merchant_name=(select merchant_name from
> merchant_data from table1 , table2
>             where table2.field1 = convert(varchar, table3.field1)
> and    table2.field2 = table1.field2 and table2.field3 =
> table1.field3)
>     from table3 where
>     terminal_number = 1111 and
>     ..........
> and when i try to exit from datawindow datasource painter window (in text
> mode) it says "Incorrect Syntax near the word "from""
>
> and if i move my marchant_name field before the terminal number field it say
> "Incorrect syntax near ",""
> what can it be or how can i make it work.
> i have pb651 on win98



--
Hope this helps!



Kenneth A. Drendel
email Kdrendel@HotMail.com
Icq# 34027019


0
Ken
7/21/1999 4:19:18 PM
If the select statement is your exact syntax then you have to many 'from'
in the statement.  You are allowed only one 'from' for each select.  In
your statement I see 2 selects and 3 froms.


Ramses Palomo <rpalomo@starnet.net.gt> wrote in article
<CiojXu40#GA.111@forums.sybase.com>...
> im running with sybase 11 and i do a select statement like this
> 
>     select terminal_number, merchant_name=(select merchant_name from
> merchant_data from table1 , table2
>             where table2.field1 = convert(varchar, table3.field1)
> and    table2.field2 = table1.field2 and table2.field3 =
> table1.field3)
>     from table3 where
>     terminal_number = 1111 and
>     ..........
> and when i try to exit from datawindow datasource painter window (in text
> mode) it says "Incorrect Syntax near the word "from""
> 
> and if i move my marchant_name field before the terminal number field it
say
> "Incorrect syntax near ",""
> what can it be or how can i make it work.
> i have pb651 on win98
> 
> 
> 
> 
> 
0
Sheila
7/21/1999 5:56:22 PM
Your doing this all wrong try this :

SELECT terminal_number,
               merchant_name
FROM    table1,
               table2,
               table3
WHERE  table3.terminal_number = 1111
AND       table2.field1 = convert(varchar, table3.field1)
AND       table2.field2 = table1.field2
AND       table2.field3 = table1.field3


Ramses Palomo wrote:

> im running with sybase 11 and i do a select statement like this
>
>     select terminal_number, merchant_name=(select merchant_name from
> merchant_data from table1 , table2
>             where table2.field1 = convert(varchar, table3.field1)
> and    table2.field2 = table1.field2 and table2.field3 =
> table1.field3)
>     from table3 where
>     terminal_number = 1111 and
>     ..........
> and when i try to exit from datawindow datasource painter window (in text
> mode) it says "Incorrect Syntax near the word "from""
>
> and if i move my marchant_name field before the terminal number field it say
> "Incorrect syntax near ",""
> what can it be or how can i make it work.
> i have pb651 on win98



--
Hope this helps!



Kenneth A. Drendel
email Kdrendel@HotMail.com
Icq# 34027019


0
Ken
7/21/1999 8:12:53 PM
Reply:

Similar Artilces:

To Replace SQL Select statement in the datawindow through script coding
Hello, Does somebody help me how to replace an old sql select statement with the new one? I've tried to use setSQLselect() of the datawindow with the new statement as the argument but it failed to get the right result, it supposed to retrieve the data covered in the new sql select statement. Any views on this? Thanks in advance Question from DW group. If DW has no retrival arguments you can use setsqlselect() overwise use MODIFY. It is more dificult becose of duoble quotas and etc. You can use breakpoint in SQLPREVIEW to test new SQL. On Mon, 26 Mar 2001 16:05:5...

Works in ISQL; doesn't work in code.
I am using ASA 6.0.0.744 with VB6. The following query works successfully when run from ISQL but fails as a source in OpenRecordSet with Runtime error '3061' Too few parameters. Expected 1. I have isolated it to the clause "where CLNAME like 'J%'". It seems a use of the alias 'CLNAME' is taken as parameter rather than a column name. What's the story here. Select approved, InvoiceID, InNo, InDate, Client.name As CLNAME , Debtor.name AS DRNAME, Invoice.CientID, Invoice.DebtorID,Client.Phone1, Client.Phone1Ext, BulkNumber from Invoice, Client, Debt...

Variable in sql satement not working
I have a variable that is created dynamically that will be used as an input for a sql statement.  When I display the variable in a text box it looks like this: (PROP_CLASS IN ('" & 100 & "','" & 101 & "' ))   The following works when I hard code the values into the SQL statement: strSQL = "SELECT * FROM web_transfer WHERE (PROP_CLASS IN ('" & 100 & "','" & 101 & "' )) AND ........."But I get no values returned when I use the variable directly in the sql:...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information from a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~", ~...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information for a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~",...

2 sql select statements in 1 sql string just wont work!
hi there, i have a bit of a strange problem, and i must be doing something wrong because this works with insert and update statements in other pages. What is going on is that i am trying to do 2 select statements in the same bit of code so i dont have to open a datareader twice, but if i put the delivery charge select before the other it seems to get it, but if i put it after it does not, i just cant work it out! i have posted my code below for you all to have a look at because im stumped! //gets order id and customer id and puts them to strings and int to be used laterstring strCustID = Re...

Help! How to modify the sql select statement for a nested datawindow inside a composite datawindow?
Help! How to modify the sql select statement for a nested datawindow inside a composite datawindow? Would the following work? dw_nest.Object.DataWindow.Table.Select="select employee_id from ..." Please help. jungan@aboex.com GetChild () ??? "Jun Gan" <jungan@aboex.com> wrote in message news:40e48313$1@forums-2-dub... > Help! > > How to modify the sql select statement for a nested datawindow inside a > composite datawindow? > > Would the following work? > > dw_nest.Object.DataWindow.Table.Select="select e...

string sql = "SELECT * FROM Office; SELECT * FROM Room"; DO NOT work with Access??
Hi I am trying to create a nested datagrid and I am using this tutorial; http://www.dotnetjunkies.com/Tutorial/47792CB0-0990-4BD8-BF84-B6063C4C9BBC.dcik I am using C# ASP.NET and Access database. This is my code; string sqlStmt = "SELECT * FROM Office; SELECT * FROM Room"; roomDataAdapter = new OleDbDataAdapter(sqlStmt, connection); roomDataAdapter.Fill(roomDataSet); roomDataSet.Tables[0].TableName = "Office"; roomDataSet.Tables[1].TableName = "Room"; Error message: System.Data.OleDb.OleDbException: Characters found after end of S...

'Too many characters' error in sql string
Hello i constructed the following query in SQL management studio and it runs fine, exactly how i want it to. However when i run it in my code behind i get the error: 'Too many characters in character literal' I desperatly need to use this query exactly how it displays in the mangement tool - why wont it work the same in my code behind? (I am using c# in my code behind and binding the results of the query to a gridview) Regards "SELECT DISTINCT (dbo.AuthorList(publicationID))+ ';' + ISNULL(' Editor: '+Publication.editor, '')+ '' + ISNULL...

Datawindow Update ---> SQL CODE 1222 SQL STATE 37000 "Lock request time-out period exceeded"
Hi all we developed an app with PB 7 and SQL SERVER 2000 and all was good but now we have migrated it to PB 11 and we see a strange problem: This the environement: SQL SERVER 2000 Service Pack 4 PowerBuilder 11.1 Test: User A retrieves the row X from a table User B retrieves the row Y from the same table So rows X and Y are locked User A tries to save row X with the Datawindow Update and he sees this error: SQL CODE 1222 SQL STATE 37000 "Lock request time-out period exceeded" In the same environement but withn PB 7 instead of PB 11 all was ok Could someone h...

Datawindow Update ---> SQL CODE 1222 SQL STATE 37000 "Lock request time-out period exceeded"
Hi all we developed an app with PB 7 and SQL SERVER 2000 and all was good but now we have migrated it to PB 11 and we see a strange problem: This the environement: SQL SERVER 2000 Service Pack 4 PowerBuilder 11.1 Test: User A retrieves the row X from a table User B retrieves the row Y from the same table So rows X and Y are locked User A tries to save row X with the Datawindow Update and he sees this error: SQL CODE 1222 SQL STATE 37000 "Lock request time-out period exceeded" In the same environement but withn PB 7 instead of PB 11 all was ok Could someone h...

SQL button in datawindow not working
Upon opening a previously working data window, the "SQL" (Data Source) button is greyed out and I cannot find the data source. Other datawindows in the application are working fine and there are no problems with the database. I've also regenerated the datawindow to no avail. Any solutions? There was a previous posting with this problem on May 11, 2001 but no reply was given. If this is not an exetrnal source dw object, try exporting the syntax of the dw from the library painter. If you can see the PBSELECT statement, try renaming it in syntax form, then i...

working with SQL 2005 interface but internally it works as SQL 2000
Hi! I have installed SQL 2000 and SQL 2005 in my computer.I tried to use some new features like row_number(),try..catch.. but are not working giving syntax error.” So someone told me that i had to check the version and when I cheked I realized I was working with SQL 2000: “Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)” So, how can I change it for working with SQL 2005?. It’s like I’m working with SQL 2005 interface but internally it works as SQL 2000. Can you ...

Datawindow SQL Select Return
Hello, PB 6.5 is returning the 'PBSELECT' syntax when performing the original_select = tab_letters.tabpage_let_queue.dw_queue.Describe("DataWindow.Table.Select") statement. After reading the help, it basically states that a connection is not being made to the database, but appears. Any suggestions... Thanks, Are you connecting to the database then issuing a dw_1.SetTransObject(... The dw needs to know which database it is using to create the SQL > Hello, > > PB 6.5 is returning the 'PBSELECT' syntax when performing > the original_se...