Re: [sqlite] Equivalent syntax in sqlite

2017-04-26 Thread J Decker
If you change from an auto increment to a GUID/UUID  you can simply use
'REPLACE INTO' and you don't have to worry about the select, because you'll
already know the ID.

http://www.sqlitetutorial.net/sqlite-replace-statement/



On Wed, Apr 26, 2017 at 4:05 PM, Joseph L. Casale <jcas...@activenetwerx.com
> wrote:

> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
> On
> Behalf Of David Raymond
> Sent: Wednesday, April 26, 2017 3:00 PM
> To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
> Subject: Re: [sqlite] Equivalent syntax in sqlite
>
> > With the comment that the insert or ignore method there will only work if
> > there's an explicit unique constraint on your given criteria.
>
> Yup, the table does have one. Thanks for the help guys.
> jlc
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Equivalent syntax in sqlite

2017-04-26 Thread Joseph L. Casale
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On
Behalf Of David Raymond
Sent: Wednesday, April 26, 2017 3:00 PM
To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Subject: Re: [sqlite] Equivalent syntax in sqlite
 
> With the comment that the insert or ignore method there will only work if
> there's an explicit unique constraint on your given criteria.

Yup, the table does have one. Thanks for the help guys.
jlc
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Equivalent syntax in sqlite

2017-04-26 Thread David Raymond
With the comment that the insert or ignore method there will only work if 
there's an explicit unique constraint on your given criteria.


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Simon Slavin
Sent: Wednesday, April 26, 2017 4:46 PM
To: SQLite mailing list
Subject: Re: [sqlite] Equivalent syntax in sqlite


On 26 Apr 2017, at 9:42pm, Joseph L. Casale <jcas...@activenetwerx.com> wrote:

> Whats the trick with SQLites working set to format a single statement with 
> parameters
> where if a row exists for a given criteria, returns its Id, otherwise insert 
> and return the
> last_insert_rowid()?

It has to be two operations.

INSERT OR IGNORE INTO MyTable …;
SELECT rowid FROM MyTable WHERE …;

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Equivalent syntax in sqlite

2017-04-26 Thread Simon Slavin

On 26 Apr 2017, at 9:42pm, Joseph L. Casale  wrote:

> Whats the trick with SQLites working set to format a single statement with 
> parameters
> where if a row exists for a given criteria, returns its Id, otherwise insert 
> and return the
> last_insert_rowid()?

It has to be two operations.

INSERT OR IGNORE INTO MyTable …;
SELECT rowid FROM MyTable WHERE …;

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Equivalent syntax in sqlite

2017-04-26 Thread Joseph L. Casale
Whats the trick with SQLites working set to format a single statement with 
parameters
where if a row exists for a given criteria, returns its Id, otherwise insert 
and return the
last_insert_rowid()?

For example:
CREATE TABLE Foo (
Id INTEGER PRIMARY KEY NOT NULL,
ColA TEXTNOT NULL,
ColB TEXTNOT NULL
);

So the statement always returns the Id scalar value for an existing row or the 
new
insert? Not sure case can do accomplish that, if/begin/end is not an option...

Thanks,
jlc
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Equivalent Syntax for Oracle row_number() OVER (PARTITION)

2015-09-11 Thread Rousselot, Richard A
What is the equivalent SQLite syntax for the Oracle SQL syntax below?

row_number() OVER (PARTITION BY x ORDER BY y DESC, z) AS aField

Example...

SELECT department_id, first_name, last_name, salary
FROM
(
  SELECT
department_id, first_name, last_name, salary,
ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY salary desc) rn
  FROM employees
)
WHERE rn <= 3
ORDER BY department_id, salary DESC, last_name;


http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions156.htm#SQLRF06100

Thanks in advance,

Richard
This communication is the property of CenturyLink and may contain confidential 
or privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful. If you have received this communication in 
error, please immediately notify the sender by reply e-mail and destroy all 
copies of the communication and any attachments.


[sqlite] Equivalent Syntax for Oracle row_number() OVER (PARTITION)

2015-09-11 Thread Igor Tandetnik
On 9/11/2015 6:51 PM, Rousselot, Richard A wrote:
> What is the equivalent SQLite syntax for the Oracle SQL syntax below?
>
>  row_number() OVER (PARTITION BY x ORDER BY y DESC, z) AS 
> aField
>
>  Example...
>
> SELECT department_id, first_name, last_name, salary
> FROM
> (
>SELECT
>  department_id, first_name, last_name, salary,
>  ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY salary desc) rn
>FROM employees
> )
> WHERE rn <= 3
> ORDER BY department_id, salary DESC, last_name;

I'm not familiar with Oracle analytic functions. Going by the 
description of "finds the three highest paid employees in each department":

SELECT department_id, first_name, last_name, salary
FROM employees t1
WHERE rowid in (
   select rowid from employees t2
   where t2.department_id = t1.department_id
   order by t2.salary desc limit 3
)
ORDER BY department_id, salary DESC, last_name;

-- 
Igor Tandetnik



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread drh
"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> Is cast documented on the sqlite website? I couldn't find it. 
> 

http://www.sqlite.org/lang_expr.html

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
Thanks. Unfortunately my background is sybase and that's anything but
standard :-( 

-Original Message-
From: Kees Nuyt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 6:52 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

On Wed, 31 Jan 2007 17:30:29 -0500, you wrote:

>BTW, what is the concatenation operator? 

Standard SQL:  string || string
-- 
  (  Kees Nuyt
  )
c[_]


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
Thanks, somehow I had missed it. 

-Original Message-
From: Nicolas Williams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 6:43 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

On Wed, Jan 31, 2007 at 06:31:20PM -0500, Anderson, James H (IT) wrote:
> Is cast documented on the sqlite website? I couldn't find it. 

http://www.sqlite.org/

Click on 'syntax', click on 'expression', arrive at:

http://www.sqlite.org/lang_expr.html


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread Kees Nuyt
On Wed, 31 Jan 2007 17:30:29 -0500, you wrote:

>BTW, what is the concatenation operator? 

Standard SQL:  string || string
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread Kees Nuyt
On Wed, 31 Jan 2007 18:31:20 -0500, you wrote:

>Is cast documented on the sqlite website? I couldn't find it. 

http://www.sqlite.org/lang_expr.html
-- 
  (  Kees Nuyt
  )
c[_]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread P Kishor

On 1/31/07, Anderson, James H (IT) <[EMAIL PROTECTED]> wrote:

Is cast documented on the sqlite website? I couldn't find it.


..

http://www.sqlite.org/lang_expr.html

--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread Nicolas Williams
On Wed, Jan 31, 2007 at 06:31:20PM -0500, Anderson, James H (IT) wrote:
> Is cast documented on the sqlite website? I couldn't find it. 

http://www.sqlite.org/

Click on 'syntax', click on 'expression', arrive at:

http://www.sqlite.org/lang_expr.html

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
Is cast documented on the sqlite website? I couldn't find it. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 5:51 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> In the case shown, for example,
> 
> convert(char(3), NULL) CDRefIndustry,
> 
> It creates a char(3) column, sets it to null, and names it
> CDRefIndustry.
> 

Dennis Cote's guess was mostly right then.  A strict equivalent 
in SQLite (and in standard SQL) would be:

  cast(NULL AS char(3)) CDRefIndustry

But the cast is not really necessary in SQLite.  You could
get by with just this:

  NULL CDRefIndustry

So, tell me James, what is MorganStanley doing with SQLite?  ;-)

--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
Experimenting :)  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 5:51 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> In the case shown, for example,
> 
> convert(char(3), NULL) CDRefIndustry,
> 
> It creates a char(3) column, sets it to null, and names it
> CDRefIndustry.
> 

Dennis Cote's guess was mostly right then.  A strict equivalent 
in SQLite (and in standard SQL) would be:

  cast(NULL AS char(3)) CDRefIndustry

But the cast is not really necessary in SQLite.  You could
get by with just this:

  NULL CDRefIndustry

So, tell me James, what is MorganStanley doing with SQLite?  ;-)

--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
OK, thanks, I'll try that. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P
Kishor
Sent: Wednesday, January 31, 2007 5:34 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

On 1/31/07, Anderson, James H (IT) <[EMAIL PROTECTED]>
wrote:
> In the case shown, for example,
>
> convert(char(3), NULL) CDRefIndustry,
>
> It creates a char(3) column, sets it to null, and names it
> CDRefIndustry.

Since SQLite has no datatypes, char(3) doesn't mean anything to it. How
about

SELECT null AS CDRefIndustry

or

SELECT '' AS CDRefIndustry


>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 31, 2007 5:14 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Equivalent syntax?
>
> "Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> > What's the equivalent sqlite syntax for sybase convert function?
>
> Can you describe what the convert function in sybase does?  That
> might help us to find the equivalent function in SQLite for you.
> --
> D. Richard Hipp  <[EMAIL PROTECTED]>
>
>
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
> 
>
> NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
>
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread drh
"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> In the case shown, for example,
> 
> convert(char(3), NULL) CDRefIndustry,
> 
> It creates a char(3) column, sets it to null, and names it
> CDRefIndustry.
> 

Dennis Cote's guess was mostly right then.  A strict equivalent 
in SQLite (and in standard SQL) would be:

  cast(NULL AS char(3)) CDRefIndustry

But the cast is not really necessary in SQLite.  You could
get by with just this:

  NULL CDRefIndustry

So, tell me James, what is MorganStanley doing with SQLite?  ;-)

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread P Kishor

On 1/31/07, Anderson, James H (IT) <[EMAIL PROTECTED]> wrote:

In the case shown, for example,

convert(char(3), NULL) CDRefIndustry,

It creates a char(3) column, sets it to null, and names it
CDRefIndustry.


Since SQLite has no datatypes, char(3) doesn't mean anything to it. How about

SELECT null AS CDRefIndustry

or

SELECT '' AS CDRefIndustry




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 31, 2007 5:14 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> What's the equivalent sqlite syntax for sybase convert function?

Can you describe what the convert function in sybase does?  That
might help us to find the equivalent function in SQLite for you.
--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-





--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread P Kishor

On 1/31/07, Anderson, James H (IT) <[EMAIL PROTECTED]> wrote:

What's the equivalent sqlite syntax for sybase convert function? For
example,

select distinct
date, CDId, CDName, CDTicket,
tradeId, tapsAccount, CDBook, coalesce(CDFid,'') CDFid,
CDStatus, CDTradeDate, CDExpDate, CDNotional,
CDCurr, CDSellBuy, CDType, CDExerType,
CDEntity, CDCusip, CDSetlType, CDCredInit,
CDSingleEntry, CDMaterialType, CDEffDate, CDPremFreq,
CDPaymentType, CDUpfrontSetl, CDPublicInfo, CDCollReq,
CDSpreadCurve, CDPremium, CDOptType, CDAccrue,
CDRefPrice, CDPremiumAmnt, CDLastCoupLength, CDWhoDelivers,
CDCollateralText, CDFactorReason, CDDefStartProt, CDDefEndProt,
CDDefProtType,
convert(char(80), NULL) CDComment,
convert(varchar(100), NULL) CDEvent,
convert(char(11), NULL) CDCurveType,
convert(char(11), NULL) CrvShName,
convert(varchar(90), NULL) CDRefEntity,
convert(char(3), NULL) CDRefIndustry,
convert(char(3), NULL) CDRefCountry,
convert(char(4), NULL) CDRefSNP,
convert(char(4),NULL) CDRefMoody,
convert(char(4),NULL) CDRefMSRating,
CDRefId
into TMP_credDerivOrig
from credDerivOrig_C1



Are you looking for something like ifnull or nullif?





NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.




--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
I don't see the cast function listed in the Core Functions section of
the web page...

BTW, what is the concatenation operator? 

-Original Message-
From: Dennis Cote [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 5:21 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

Anderson, James H (IT) wrote:
> What's the equivalent sqlite syntax for sybase convert function? For
> example,
>
> select distinct
> date, CDId, CDName, CDTicket,
> tradeId, tapsAccount, CDBook, coalesce(CDFid,'') CDFid,
> CDStatus, CDTradeDate, CDExpDate, CDNotional,
> CDCurr, CDSellBuy, CDType, CDExerType,
> CDEntity, CDCusip, CDSetlType, CDCredInit,
> CDSingleEntry, CDMaterialType, CDEffDate, CDPremFreq,
> CDPaymentType, CDUpfrontSetl, CDPublicInfo, CDCollReq,
> CDSpreadCurve, CDPremium, CDOptType, CDAccrue,
> CDRefPrice, CDPremiumAmnt, CDLastCoupLength, CDWhoDelivers,
> CDCollateralText, CDFactorReason, CDDefStartProt,
CDDefEndProt,
> CDDefProtType,
> convert(char(80), NULL) CDComment,
> convert(varchar(100), NULL) CDEvent,
> convert(char(11), NULL) CDCurveType,
> convert(char(11), NULL) CrvShName,
> convert(varchar(90), NULL) CDRefEntity,
> convert(char(3), NULL) CDRefIndustry,
> convert(char(3), NULL) CDRefCountry,
> convert(char(4), NULL) CDRefSNP,
> convert(char(4),NULL) CDRefMoody,
> convert(char(4),NULL) CDRefMSRating,
> CDRefId
> into TMP_credDerivOrig 
> from credDerivOrig_C1
>
>   
Based on context I would say the cast function is the rough equivalent.

But, since all text types in SQLite are equivalent there is no need to 
convert them from one type to another (i.e. from varchar(100) to 
char(80)). I suspect this query would translate to SQLite by simply 
removing the convert(...) clauses.

HTH
Dennis Cote


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
In the case shown, for example,

convert(char(3), NULL) CDRefIndustry,

It creates a char(3) column, sets it to null, and names it
CDRefIndustry.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 31, 2007 5:14 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Equivalent syntax?

"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> What's the equivalent sqlite syntax for sybase convert function? 

Can you describe what the convert function in sybase does?  That
might help us to find the equivalent function in SQLite for you.
--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread Dennis Cote

Anderson, James H (IT) wrote:

What's the equivalent sqlite syntax for sybase convert function? For
example,

select distinct
date, CDId, CDName, CDTicket,
tradeId, tapsAccount, CDBook, coalesce(CDFid,'') CDFid,
CDStatus, CDTradeDate, CDExpDate, CDNotional,
CDCurr, CDSellBuy, CDType, CDExerType,
CDEntity, CDCusip, CDSetlType, CDCredInit,
CDSingleEntry, CDMaterialType, CDEffDate, CDPremFreq,
CDPaymentType, CDUpfrontSetl, CDPublicInfo, CDCollReq,
CDSpreadCurve, CDPremium, CDOptType, CDAccrue,
CDRefPrice, CDPremiumAmnt, CDLastCoupLength, CDWhoDelivers,
CDCollateralText, CDFactorReason, CDDefStartProt, CDDefEndProt,
CDDefProtType,
convert(char(80), NULL) CDComment,
convert(varchar(100), NULL) CDEvent,
convert(char(11), NULL) CDCurveType,
convert(char(11), NULL) CrvShName,
convert(varchar(90), NULL) CDRefEntity,
convert(char(3), NULL) CDRefIndustry,
convert(char(3), NULL) CDRefCountry,
convert(char(4), NULL) CDRefSNP,
convert(char(4),NULL) CDRefMoody,
convert(char(4),NULL) CDRefMSRating,
CDRefId
into TMP_credDerivOrig 
from credDerivOrig_C1


  

Based on context I would say the cast function is the rough equivalent.

But, since all text types in SQLite are equivalent there is no need to 
convert them from one type to another (i.e. from varchar(100) to 
char(80)). I suspect this query would translate to SQLite by simply 
removing the convert(...) clauses.


HTH
Dennis Cote

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Equivalent syntax?

2007-01-31 Thread drh
"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote:
> What's the equivalent sqlite syntax for sybase convert function? 

Can you describe what the convert function in sybase does?  That
might help us to find the equivalent function in SQLite for you.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Equivalent syntax?

2007-01-31 Thread Anderson, James H \(IT\)
What's the equivalent sqlite syntax for sybase convert function? For
example,

select distinct
date, CDId, CDName, CDTicket,
tradeId, tapsAccount, CDBook, coalesce(CDFid,'') CDFid,
CDStatus, CDTradeDate, CDExpDate, CDNotional,
CDCurr, CDSellBuy, CDType, CDExerType,
CDEntity, CDCusip, CDSetlType, CDCredInit,
CDSingleEntry, CDMaterialType, CDEffDate, CDPremFreq,
CDPaymentType, CDUpfrontSetl, CDPublicInfo, CDCollReq,
CDSpreadCurve, CDPremium, CDOptType, CDAccrue,
CDRefPrice, CDPremiumAmnt, CDLastCoupLength, CDWhoDelivers,
CDCollateralText, CDFactorReason, CDDefStartProt, CDDefEndProt,
CDDefProtType,
convert(char(80), NULL) CDComment,
convert(varchar(100), NULL) CDEvent,
convert(char(11), NULL) CDCurveType,
convert(char(11), NULL) CrvShName,
convert(varchar(90), NULL) CDRefEntity,
convert(char(3), NULL) CDRefIndustry,
convert(char(3), NULL) CDRefCountry,
convert(char(4), NULL) CDRefSNP,
convert(char(4),NULL) CDRefMoody,
convert(char(4),NULL) CDRefMSRating,
CDRefId
into TMP_credDerivOrig 
from credDerivOrig_C1

Thanks,

jim


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.