Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SyntaxFromSQL

4 posts in DataWindow Last posting was on 2008-10-29 01:48:50.0Z
Enrique Montalvan Posted on 2008-10-28 00:26:41.0Z
From: "Enrique Montalvan" <emontalvan@gruponuevomundo.com.pe>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: SyntaxFromSQL
Lines: 128
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0247_01C93869.D3304F90"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49065c41$1@forums-1-dub>
Date: 27 Oct 2008 16:26:41 -0800
X-Trace: forums-1-dub 1225153601 10.22.241.152 (27 Oct 2008 16:26:41 -0800)
X-Original-Trace: 27 Oct 2008 16:26:41 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88049
Article PK: 417305

Hello :
 
I have the follow script
 
//////////////
 
ls_cadena_sql = "SELECT boleto_pax.id_sucursal FROM BOLETO_PAX, CLIENTE, PAX_RESERVA " + &
  " WHERE BOLETO_PAX.numero_de_boleto = " + String(adc_numero_de_boleto)  + &
  " AND BOLETO_PAX.id_proveedor = " + String(al_proveedor )  + &
  " AND IsNull(BOLETO_PAX.id_file,0)  > 0 " + &
  " AND IsNull(BOLETO_PAX.emitido,0)  = 1 " + &
  " AND BOLETO_PAX.id_cliente = CLIENTE.id_cliente " + &
  " AND BOLETO_PAX.id_file = PAX_RESERVA.id_file " + &
  " AND BOLETO_PAX.id_sucursal = PAX_RESERVA.id_sucursal " + &
  " AND BOLETO_PAX.id_pax_reserva = PAX_RESERVA.id_pax_reserva "
  
ls_cadena_sql = atr_conexion.SyntaxFromSQL(ls_cadena_sql, "", as_error)
lds_datos.Create( ls_cadena_sql, as_error)
lds_datos.SetTransObject(atr_conexion)
 
ll_filas_boleto = lds_datos.Retrieve()
 
 
////////////////////////
 
How can I get the data of the column.
Sometimes it comes in one way and the other
 
These are the two ways :
 
1.- li_id_sucursal = lds_datos.Object.id_sucursal[1]  
 
2.- li_id_sucursal = lds_datos.Object.boleto_pax_id_sucursal[1]  
 
 
//////////////
 
Thanks for your help
 
 
Enrique Montalvan Arroyo


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-28 00:38:30.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49065c41$1@forums-1-dub>
Subject: Re: SyntaxFromSQL
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49065f06@forums-1-dub>
Date: 27 Oct 2008 16:38:30 -0800
X-Trace: forums-1-dub 1225154310 10.22.241.152 (27 Oct 2008 16:38:30 -0800)
X-Original-Trace: 27 Oct 2008 16:38:30 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88050
Article PK: 417304

I'm guessing that in one case you are connecting as the owner of boleto_pax
and the other you are not.
Simple solution: use GetItemNumber (1, '#1')
It's always more efficient to use the functions rather than dot notation to
get a single value. Dot notation requires that a DWObject be created and
destroyed, and an Any cast to the proper type.

"Enrique Montalvan" <emontalvan@gruponuevomundo.com.pe> wrote in message
news:49065c41$1@forums-1-dub...
Hello :

I have the follow script

//////////////

ls_cadena_sql = "SELECT boleto_pax.id_sucursal FROM BOLETO_PAX, CLIENTE,
PAX_RESERVA " + &
" WHERE BOLETO_PAX.numero_de_boleto = " + String(adc_numero_de_boleto) +
&
" AND BOLETO_PAX.id_proveedor = " + String(al_proveedor ) + &
" AND IsNull(BOLETO_PAX.id_file,0) > 0 " + &
" AND IsNull(BOLETO_PAX.emitido,0) = 1 " + &
" AND BOLETO_PAX.id_cliente = CLIENTE.id_cliente " + &
" AND BOLETO_PAX.id_file = PAX_RESERVA.id_file " + &
" AND BOLETO_PAX.id_sucursal = PAX_RESERVA.id_sucursal " + &
" AND BOLETO_PAX.id_pax_reserva = PAX_RESERVA.id_pax_reserva "

ls_cadena_sql = atr_conexion.SyntaxFromSQL(ls_cadena_sql, "", as_error)
lds_datos.Create( ls_cadena_sql, as_error)
lds_datos.SetTransObject(atr_conexion)

ll_filas_boleto = lds_datos.Retrieve()


////////////////////////

How can I get the data of the column.
Sometimes it comes in one way and the other

These are the two ways :

1.- li_id_sucursal = lds_datos.Object.id_sucursal[1]

2.- li_id_sucursal = lds_datos.Object.boleto_pax_id_sucursal[1]


//////////////

Thanks for your help


Enrique Montalvan Arroyo


Jeremy Lakeman Posted on 2008-10-28 23:37:12.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: SyntaxFromSQL
Date: Tue, 28 Oct 2008 16:37:12 -0700 (PDT)
Organization: http://groups.google.com
Lines: 55
Message-ID: <efda040c-53cb-41bd-b6d0-bd4b39fdc4bc@t54g2000hsg.googlegroups.com>
References: <49065c41$1@forums-1-dub>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1225237033 3955 127.0.0.1 (28 Oct 2008 23:37:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 28 Oct 2008 23:37:13 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: t54g2000hsg.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!t54g2000hsg.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88062
Article PK: 417317

On Oct 28, 10:26 am, "Enrique Montalvan"

<emontal...@gruponuevomundo.com.pe> wrote:
> Hello :
>
> I have the follow script
>
> //////////////
>
> ls_cadena_sql = "SELECT boleto_pax.id_sucursal FROM BOLETO_PAX, CLIENTE, PAX_RESERVA " + &
>   " WHERE BOLETO_PAX.numero_de_boleto = " + String(adc_numero_de_boleto)  + &
>   " AND BOLETO_PAX.id_proveedor = " + String(al_proveedor )  + &
>   " AND IsNull(BOLETO_PAX.id_file,0)  > 0 " + &
>   " AND IsNull(BOLETO_PAX.emitido,0)  = 1 " + &
>   " AND BOLETO_PAX.id_cliente = CLIENTE.id_cliente " + &
>   " AND BOLETO_PAX.id_file = PAX_RESERVA.id_file " + &
>   " AND BOLETO_PAX.id_sucursal = PAX_RESERVA.id_sucursal " + &
>   " AND BOLETO_PAX.id_pax_reserva = PAX_RESERVA.id_pax_reserva "
>
> ls_cadena_sql = atr_conexion.SyntaxFromSQL(ls_cadena_sql, "", as_error)
> lds_datos.Create( ls_cadena_sql, as_error)
> lds_datos.SetTransObject(atr_conexion)
>
> ll_filas_boleto = lds_datos.Retrieve()
>
> ////////////////////////
>
> How can I get the data of the column.
> Sometimes it comes in one way and the other
>
> These are the two ways :
>
> 1.- li_id_sucursal = lds_datos.Object.id_sucursal[1]  
>
> 2.- li_id_sucursal = lds_datos.Object.boleto_pax_id_sucursal[1]  
>
> //////////////
>
> Thanks for your help
>
> Enrique Montalvan Arroyo

Adding to Jerry's comments...

SyntaxFromSql is quite a time consuming function that will make a
number of database calls and can have unpredictable results.

I wouldn't recommend using it purely to change the where clause of an
sql statement.
Instead I would recommend having a datawindow object with retrieval
arguments.

If you need to make complex changes to the sql statement you can also
modify it at run time.


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-10-29 01:48:50.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49065c41$1@forums-1-dub> <efda040c-53cb-41bd-b6d0-bd4b39fdc4bc@t54g2000hsg.googlegroups.com>
Subject: Re: SyntaxFromSQL
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4907c102@forums-1-dub>
Date: 28 Oct 2008 17:48:50 -0800
X-Trace: forums-1-dub 1225244930 10.22.241.152 (28 Oct 2008 17:48:50 -0800)
X-Original-Trace: 28 Oct 2008 17:48:50 -0800, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88063
Article PK: 417318

And although some consider it an abomination, if you are after just a single
value there is embedded SQL.

"Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
news:efda040c-53cb-41bd-b6d0-bd4b39fdc4bc@t54g2000hsg.googlegroups.com...
On Oct 28, 10:26 am, "Enrique Montalvan"

<emontal...@gruponuevomundo.com.pe> wrote:
> Hello :
>
> I have the follow script
>
> //////////////
>
> ls_cadena_sql = "SELECT boleto_pax.id_sucursal FROM BOLETO_PAX, CLIENTE,
> PAX_RESERVA " + &
> " WHERE BOLETO_PAX.numero_de_boleto = " + String(adc_numero_de_boleto) + &
> " AND BOLETO_PAX.id_proveedor = " + String(al_proveedor ) + &
> " AND IsNull(BOLETO_PAX.id_file,0) > 0 " + &
> " AND IsNull(BOLETO_PAX.emitido,0) = 1 " + &
> " AND BOLETO_PAX.id_cliente = CLIENTE.id_cliente " + &
> " AND BOLETO_PAX.id_file = PAX_RESERVA.id_file " + &
> " AND BOLETO_PAX.id_sucursal = PAX_RESERVA.id_sucursal " + &
> " AND BOLETO_PAX.id_pax_reserva = PAX_RESERVA.id_pax_reserva "
>
> ls_cadena_sql = atr_conexion.SyntaxFromSQL(ls_cadena_sql, "", as_error)
> lds_datos.Create( ls_cadena_sql, as_error)
> lds_datos.SetTransObject(atr_conexion)
>
> ll_filas_boleto = lds_datos.Retrieve()
>
> ////////////////////////
>
> How can I get the data of the column.
> Sometimes it comes in one way and the other
>
> These are the two ways :
>
> 1.- li_id_sucursal = lds_datos.Object.id_sucursal[1]
>
> 2.- li_id_sucursal = lds_datos.Object.boleto_pax_id_sucursal[1]
>
> //////////////
>
> Thanks for your help
>
> Enrique Montalvan Arroyo

Adding to Jerry's comments...

SyntaxFromSql is quite a time consuming function that will make a
number of database calls and can have unpredictable results.

I wouldn't recommend using it purely to change the where clause of an
sql statement.
Instead I would recommend having a datawindow object with retrieval
arguments.

If you need to make complex changes to the sql statement you can also
modify it at run time.