Solved

Octets in teradata

Posted on 2013-10-24
3
116 Views
Last Modified: 2015-02-17
I get an error when I use octets to read byte data;

cast(SUBSTR(a.user_agt,1, 100, OCTETS) as char(255))) as kiyu
from a
Where end_dt >= '2013-09-01'
  and cr_dt >= '2013-09-01'
  and cr_dt < '2013-09-15'

[3707] syntax error, expected something like ')' between integer and ','
0
Comment
Question by:dfn48
3 Comments
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
ID: 39598145
May be an extra ")". check this.
cast(SUBSTR(a.user_agt,1, 100, OCTETS) as char(255)) as kiyu
from a
Where end_dt >= '2013-09-01'
  and cr_dt >= '2013-09-01'
  and cr_dt < '2013-09-15'

Open in new window

0
 

Author Comment

by:dfn48
ID: 39598175
I am still getting the same error after I removed the extra ')'

cast(SUBSTR(a.user_agt,1, 100, OCTETS) as char(255)) as kiyu
from a
Where end_dt >= '2013-09-01'
  and cr_dt >= '2013-09-01'
  and cr_dt < '2013-09-15'

syntax 3707
0
 
LVL 13

Expert Comment

by:magarity
ID: 39667909
SUBSTR takes 3 arguments but you have 4. Are you thinking of the OCTET_LENGHT function?
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Note: You must have administrative privileges in order to configure lead or case queues. Salesforce.com (http://www.Salesforce.com) is a cloud-based customer relationship management (CRM) system. It is widely used around the world by sales and ma…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question