getting syntax error in teradat. whats wrong in this query? [closed] - teradata

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
SELECT sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/PO_NUMBER/*') AS PO_Number,
sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/DATE/*') AS theDate
FROM COMMON.OrderLog O
WHERE sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/BILLTO/*') = 'Mike';

The CAST is not part of O, and xmlOrder probably is.
So instead of this:
O.CAST(xmlOrder ...
you probably need to do this in all three lines:
CAST(O.xmlOrder ...

Related

When table is select query do it change [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
I want to change charset to select calderma table
when table is select query in oracle I would like to make the following changes
ALTER SESSION SET NLS_NUMERIC_CHARACTERS= ',.';
create or replace TRIGGER alter_session AFTER LOGON ON DATABASE
Begin
if ( osuser='solentra') then
execute immediate
'alter session set nls_date_fomat = ''dd-mon-yyyy hh24:mi:ss'' ';
End if;
End;
OR
create or replace TRIGGER alter_session AFTER LOGON ON DATABASE
Begin
if ( SELECT from calderma ) then
execute immediate
'alter session set nls_date_fomat = ''dd-mon-yyyy hh24:mi:ss'' ';
End if;
End;
I don't have much to do with pl\sql but I faced a problem like this, I will be glad if you help

Change a Column to Primary Key in sqlite [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a table in my app
CREATE TABLE VisitDetails (VisitId INTEGER, UserId TEXT, VisitNumber
TEXT, JobId INTEGER, JobNumber TEXT, StatusId INTEGER, Status TEXT,
SignatureRequired BOOL, StatusDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP
,StartDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, EndDate TIMESTAMP
DEFAULT CURRENT_TIMESTAMP, IsPPMJob BOOL)
and it was working fine but now I need to alter this table to make already existing column 'VisitId' to become the primary key. Can somebody help me please? It might work by adding Unique constraint to VisitId column of the table but I am trying to put some efficient solution !
You can't change SQLite tables field's primary key once the table is created,
Possible solution is,
Create new table with desired primary key
Copy all data
Drop old table
Here is the documentation link : https://www.sqlite.org/omitted.html

How to do inner join, group by and count using linq [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
This is the output of joining 2 tables by inner join.
I want linq query of joing two table as inner join and group by name from one table and sum of total from another table column as taken snapshot as above.pls help
Check this post.
var result = (from a in ctx.TableA
join b in ctx.TableB on a.Id equals b.Id
group a by a.Name into g
select new
{
Name = g.Key,
Sum = g.Sum(i => i.Total)
}).ToList();

Update in multiview using Linq [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to update details using linq to entities. But instead of takin a new aspx page i want to update details in another view. will it work.? and please give the linq to entity update query
Let us assume:
db is the context of your Database Entity.
Table_name is the name of Table you need to update.
row_id is the value you are using to search for the data in the Table.
To update using linq you need to fetch the record first using the below query:
var data = (from r in db.Table_name
where r.id == row_id
select r).FirstOrDefault();
Now to update the values just update them. For example:
data.Name = "Firstname lastname"
data.IsActive = true;
.
.
and so on
After you have updated the values in data you need to Save the changes made by you by this command:
db.SaveChanges();
That's it.

ASP.net / C# Parameter [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
My code is not working. #X is my parameter ans ASP.NET shows error near #X parameter.
Please help.
SqlCommand cmd = new SqlCommand("SELECT top #x * FROM tblname",cn);
cmd.Parameters.AddWithValue("#x",DropDown1.SelectedItem.value);
SqlDataReader dr;
dr=cmd.executeReader();
DataList1.DataSource = dr;
DataList1.DataBind();
Just change SELECT statement this way:
SELECT top (#x) * from tblname
I only includes the brackets around #x parameter

Resources