Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Don't fear the pen. When in doubt, draw a pretty picture." -- Baker's Third Law of Design.


devel / comp.lang.clipper.visual-objects / Re: Vo2Ado Empty dates

SubjectAuthor
* Vo2Ado Empty datesCarlos Vazquez
+* Re: Vo2Ado Empty datesPhil McGuinness
|`- Re: Vo2Ado Empty datesCarlos Vazquez
`* Re: Vo2Ado Empty datesJamal
 `- Re: Vo2Ado Empty datesCarlos Vazquez

1
Vo2Ado Empty dates

<b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=809&group=comp.lang.clipper.visual-objects#809

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:622a:148a:: with SMTP id t10mr10712514qtx.214.1621428009795;
Wed, 19 May 2021 05:40:09 -0700 (PDT)
X-Received: by 2002:ac8:544f:: with SMTP id d15mr11371933qtq.380.1621428009621;
Wed, 19 May 2021 05:40:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Wed, 19 May 2021 05:40:09 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=80.32.130.199; posting-account=y25v8QoAAACSc7riUyaoZvUyK7P_Is2q
NNTP-Posting-Host: 80.32.130.199
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>
Subject: Vo2Ado Empty dates
From: frinchis@gmail.com (Carlos Vazquez)
Injection-Date: Wed, 19 May 2021 12:40:09 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Carlos Vazquez - Wed, 19 May 2021 12:40 UTC

Hi!
I'm converting some DBF table to SQLServer. When there is an empty date value, the following code throws an error "type conflict: text is not compatible with date".

How can I pass empty date values to SQLServer?

Thanks!!
****************

aParametros := ArrayCreate(2)

oCmd:CommandText := "INSERT INTO [Ark].[dbo].[Cliente] ( [Ark].[dbo].[Cliente].[Codigo], [Ark].[dbo].[Cliente].[Fecha] ) VALUES (?,?)"

sCliente:GoTop()
WHILE !sCliente:EoF
aParametros[ 1] := sCliente:FIELDGET( #CODIGO )
aParametros[ 2] := sCliente:FIELDGET( #FECHA )
//
oCmd:Execute(@uResult,aParametros,NIL)
IF uResult != 1
MostrarError( oCmd:Error:description )
BREAK
ENDIF
sCliente:Skip()
ENDDO

Re: Vo2Ado Empty dates

<d492233a-1e02-4fb0-b47e-f263f6725673n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=812&group=comp.lang.clipper.visual-objects#812

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a37:4484:: with SMTP id r126mr12616221qka.18.1621606559686;
Fri, 21 May 2021 07:15:59 -0700 (PDT)
X-Received: by 2002:a05:620a:11ba:: with SMTP id c26mr11930786qkk.497.1621606559515;
Fri, 21 May 2021 07:15:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Fri, 21 May 2021 07:15:59 -0700 (PDT)
In-Reply-To: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=220.233.162.254; posting-account=DLsZHwoAAADZjAB6-BmLUbnomrA9rubZ
NNTP-Posting-Host: 220.233.162.254
References: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d492233a-1e02-4fb0-b47e-f263f6725673n@googlegroups.com>
Subject: Re: Vo2Ado Empty dates
From: sherlocksoftware@gmail.com (Phil McGuinness)
Injection-Date: Fri, 21 May 2021 14:15:59 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Phil McGuinness - Fri, 21 May 2021 14:15 UTC

On Wednesday, May 19, 2021 at 10:40:10 PM UTC+10, Carlos Vazquez wrote:
> Hi!
> I'm converting some DBF table to SQLServer. When there is an empty date value, the following code throws an error "type conflict: text is not compatible with date".
>
> How can I pass empty date values to SQLServer?

FUNCTION dtosSQL( dDate AS USUAL ) AS STRING

LOCAL cDate AS STRING

IF IsString(dDate) .OR. dDate = NULL_DATE
cDate := [null]
ELSE
cDate := ['] + Stuff(Stuff(DToS(dDate),5,0,[-]),8,0,[-]) + ['] // 20071201 return "2007-12-01"
ENDIF
//
RETURN cDate

Re: Vo2Ado Empty dates

<961d4f8b-1ce6-4e21-a4e4-63db183f19adn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=814&group=comp.lang.clipper.visual-objects#814

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:620a:11ba:: with SMTP id c26mr17015392qkk.497.1621683435984;
Sat, 22 May 2021 04:37:15 -0700 (PDT)
X-Received: by 2002:ac8:149a:: with SMTP id l26mr15944576qtj.297.1621683435804;
Sat, 22 May 2021 04:37:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Sat, 22 May 2021 04:37:15 -0700 (PDT)
In-Reply-To: <d492233a-1e02-4fb0-b47e-f263f6725673n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.32.130.199; posting-account=y25v8QoAAACSc7riUyaoZvUyK7P_Is2q
NNTP-Posting-Host: 80.32.130.199
References: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com> <d492233a-1e02-4fb0-b47e-f263f6725673n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <961d4f8b-1ce6-4e21-a4e4-63db183f19adn@googlegroups.com>
Subject: Re: Vo2Ado Empty dates
From: frinchis@gmail.com (Carlos Vazquez)
Injection-Date: Sat, 22 May 2021 11:37:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Carlos Vazquez - Sat, 22 May 2021 11:37 UTC

El viernes, 21 de mayo de 2021 a las 16:16:00 UTC+2, Phil McGuinness escribió:
> FUNCTION dtosSQL( dDate AS USUAL ) AS STRING
>
> LOCAL cDate AS STRING
>
> IF IsString(dDate) .OR. dDate = NULL_DATE
> cDate := [null]
> ELSE
> cDate := ['] + Stuff(Stuff(DToS(dDate),5,0,[-]),8,0,[-]) + ['] // 20071201 return "2007-12-01"
> ENDIF
> //
> RETURN cDate

Phil, that function returns a string. I've tried to use that concept but then i get "error converting string to date". I've tried also to return NIL, NULL, NULL_DATE... to no avail.
The only thing that works is returning a valid date, say CToD( '01/01/1900' )

Re: Vo2Ado Empty dates

<s8bc93$1p6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=815&group=comp.lang.clipper.visual-objects#815

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nospam@example.com (Jamal)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado Empty dates
Date: Sat, 22 May 2021 12:42:11 -0400
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <s8bc93$1p6$1@dont-email.me>
References: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 22 May 2021 16:42:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="977ae330230d2333ccd4a8110a448eae";
logging-data="1830"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PQl3P/BSFp7srAfleK+5j002EJ/LWqHU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:23/YfC2Hq4cLhsz4qnNlAMtSULE=
In-Reply-To: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com>
Content-Language: en-US
 by: Jamal - Sat, 22 May 2021 16:42 UTC

In your app, try calling

AdoConvertNullStringToNull ( TRUE )

P.S. I don't use the Vo2Ado, but I looked at the documentation. Source:

FUNCTION AdoConvertNullStringToNull ( lSet ) AS

Argument(s)

lSet When TRUE, NULL_STRINGS will be converted to NULL, else an Empty
value is passed to COM. The default behaviour is NOT to convert them to NULL

Return

The process of converting NULL_STRINGS can be switched ON/OFF by calling
the AdoCheckNullString function

See Also

Support functions, AdoCheckNullString, Data Types

HTH,
Jamal

On 5/19/2021 8:40 AM, Carlos Vazquez wrote:
> Hi!
> I'm converting some DBF table to SQLServer. When there is an empty date value, the following code throws an error "type conflict: text is not compatible with date".
>
> How can I pass empty date values to SQLServer?
>
> Thanks!!
> ****************
>
> aParametros := ArrayCreate(2)
>
> oCmd:CommandText := "INSERT INTO [Ark].[dbo].[Cliente] ( [Ark].[dbo].[Cliente].[Codigo], [Ark].[dbo].[Cliente].[Fecha] ) VALUES (?,?)"
>
> sCliente:GoTop()
> WHILE !sCliente:EoF
> aParametros[ 1] := sCliente:FIELDGET( #CODIGO )
> aParametros[ 2] := sCliente:FIELDGET( #FECHA )
> //
> oCmd:Execute(@uResult,aParametros,NIL)
> IF uResult != 1
> MostrarError( oCmd:Error:description )
> BREAK
> ENDIF
> sCliente:Skip()
> ENDDO
>

Re: Vo2Ado Empty dates

<8e08b5f7-500f-45ea-bb89-0beb90591229n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1425&group=comp.lang.clipper.visual-objects#1425

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:ad4:48d4:0:b0:66d:7ee:670d with SMTP id v20-20020ad448d4000000b0066d07ee670dmr253504qvx.10.1698777762499;
Tue, 31 Oct 2023 11:42:42 -0700 (PDT)
X-Received: by 2002:a05:6870:d1d0:b0:1e9:a86f:ec44 with SMTP id
b16-20020a056870d1d000b001e9a86fec44mr1646498oac.2.1698777762263; Tue, 31 Oct
2023 11:42:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Tue, 31 Oct 2023 11:42:41 -0700 (PDT)
In-Reply-To: <s8bc93$1p6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=80.32.130.199; posting-account=y25v8QoAAACSc7riUyaoZvUyK7P_Is2q
NNTP-Posting-Host: 80.32.130.199
References: <b068bd7d-14db-46d7-a927-43c69640f2a6n@googlegroups.com> <s8bc93$1p6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8e08b5f7-500f-45ea-bb89-0beb90591229n@googlegroups.com>
Subject: Re: Vo2Ado Empty dates
From: frinchis@gmail.com (Carlos Vazquez)
Injection-Date: Tue, 31 Oct 2023 18:42:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Carlos Vazquez - Tue, 31 Oct 2023 18:42 UTC

Jamal, sorry for ultra-late response... :)
I was (again) looking for an answer to "How to send NULL values to SQL servers" and see this message. Your anwser is the one I needed. Thx!!!

El sábado, 22 de mayo de 2021 a las 18:42:13 UTC+2, Jamal escribió:
> In your app, try calling
>
> AdoConvertNullStringToNull ( TRUE )
>
>
> P.S. I don't use the Vo2Ado, but I looked at the documentation. Source:
>
>
> FUNCTION AdoConvertNullStringToNull ( lSet ) AS
>
> Argument(s)
>
> lSet When TRUE, NULL_STRINGS will be converted to NULL, else an Empty
> value is passed to COM. The default behaviour is NOT to convert them to NULL
>
>
> Return
>
>
> The process of converting NULL_STRINGS can be switched ON/OFF by calling
> the AdoCheckNullString function
>
>
> See Also
>
> Support functions, AdoCheckNullString, Data Types
>
>
> HTH,
> Jamal
> On 5/19/2021 8:40 AM, Carlos Vazquez wrote:
> > Hi!
> > I'm converting some DBF table to SQLServer. When there is an empty date value, the following code throws an error "type conflict: text is not compatible with date".
> >
> > How can I pass empty date values to SQLServer?
> >
> > Thanks!!
> > ****************
> >
> > aParametros := ArrayCreate(2)
> >
> > oCmd:CommandText := "INSERT INTO [Ark].[dbo].[Cliente] ( [Ark].[dbo].[Cliente].[Codigo], [Ark].[dbo].[Cliente].[Fecha] ) VALUES (?,?)"
> >
> > sCliente:GoTop()
> > WHILE !sCliente:EoF
> > aParametros[ 1] := sCliente:FIELDGET( #CODIGO )
> > aParametros[ 2] := sCliente:FIELDGET( #FECHA )
> > //
> > oCmd:Execute(@uResult,aParametros,NIL)
> > IF uResult != 1
> > MostrarError( oCmd:Error:description )
> > BREAK
> > ENDIF
> > sCliente:Skip()
> > ENDDO
> >

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor