|
how to create a chart from a database in android eclipse ..
how to create a chart from a database in android eclipse ..
Thanks.
please I'm the project as an example
thanks ...
|
|
|
|
|
A database does not create a chart, it only supplies the data to support the chart. So you need to get the charting help from the android forum.
If you need help with the database query, here is the correct place.
And if you think we will do your job for you by supplying a completed sample project you are sadly mistaken.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How do we open a .ndf file?
|
|
|
|
|
What is an ndf file?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
Assuming this is a secondary data file for an MS SQL database[^], you don't. If it's not already opened by SQL, you attach the main .mdf file[^], and SQL will pick up the associated files at the same time.
If it's some other file format, you'll need to enlighten us.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi everyone,
I'm strugling with a string function.
I have a PRODUCT field and it contains 4 kind of values:
a) 000000000000001234
b) 000000000000123456
c) 000000000001234567
d) 000000000123456789
I want the values to look like this:
[1] if the length of PRODUCT without zeros is smaller then
7 the output is:
a) 0001234
b) 0123456
[2] if the length of PRODUCT without zeros is equal to 7 then output is:
c) 1234567
[3] If the lengt of PRODUCT without zeros is equal to 9 then output is:
d) 123456789
The If statements [1] and [2] are taken care of with af function that I call in my statement:
ALTER FUNCTION [dbo].[LPAD]
(
-- Add the parameters for the function here
-- Test with data as nvarchar like in Staging
@SourceString nvarchar(MAX), --Varchar(MAX),
@FinalLength int,
@PadChar Char(1)
)
RETURNS nvarchar(MAX) --Varchar(MAX) --<Function_Data_Type, ,Int>
WITH SCHEMABINDING
AS
BEGIN
RETURN --<@ResultVar, sysname, @Result>
(Select REPLICATE(@PadChar,@FinalLength - Len(@SourceString)) + @SourceString)
END
SQL statement:
, CAST(RTRIM(dbo.LPAD(SUBSTRING(dbo.SD.PRODUCT, PATINDEX('%[^0]%',dbo.SD.PRODUCT+ ''), LEN(dbo.SD.PRODUCT)), 7, 0))
AS nvarchar(255)) AS PRODUCT
So if PRODUCT is smaller then 7 chars I need a zero to make a maximum length of 7 chars. The first 11 zero's need to dissapear and thats taken care of with the above function and statement.
It's the third statement that gives me a headache, I also want the PRODUCT with 9 chars without any leading zero.
Does anyone know how I can integrate the 3rd if please ???
Kind regards,
Ambertje
|
|
|
|
|
SELECT RIGHT('0000000' + @STR, CASE WHEN LEN(CAST(CAST(@STR AS INT) AS NVARCHAR(MAX))) < 7 THEN 7 ELSE LEN(CAST(CAST(@STR AS INT) AS NVARCHAR(MAX))) END )
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Hi Peter,
This isn't working, I get no values at all.
I think I didn't mention that I'm working with a View.
I used your solution like this:
,RIGHT('0000000' + dbo.SD.PRODUCT, CASE WHEN LEN(CAST(CAST(dbo.SD.PRODUCT AS INT) AS NVARCHAR(MAX))) < 7 THEN
7 ELSE LEN(CAST(CAST(dbo.SD.PRODUCT AS INT) AS NVARCHAR(MAX))) END)
|
|
|
|
|
This one will work assuming the product codes are always numeric:
DECLARE @INPUT NVARCHAR(MAX) = 'your product code with or without leading zeros goes here'
DECLARE @TMP_INPUT INT = CAST(@INPUT AS INT)
SELECT
CASE
WHEN LEN(CAST(@TMP_INPUT AS NVARCHAR)) < 7 THEN SUBSTRING(@INPUT, 1, 7)
ELSE CAST(@TMP_INPUT AS NVARCHAR)
END
Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
am new to vb.net and trying to do some reporting but while trying to retrieve records i got problems in the format of the report.
I have the following tables in the database:
1. Exams
ExamType ExamId
EXAM I 1
EXAM II 2
EXAM III 3
2. SUBJECTS
SUBJECTID SUBJECTNAME
1 ENGLISH
2 GEOGRAPHY
3 MATHEMATICS
4 BIOLOGY
5 CHEMISTRY
6 PHYSICS
3. MARKS
STUDENTNO TOTALSCORE ENGLISH GEOGRAPHY MATHEMATICS BIOLOGY C.
20 240 50 60 70 60
21
23
34
56
...
now i wish to retrieve records in the format:
SUBJECTNAME Exam I Exam II Exam III Avg
ENGLISH 50 78 67
GEOGRAPHY 60 67
MATHEMATICS 70 56
BIOLOGY 60 90
CHEMISTRY -
PHYSICS -
Any idea on i can go about this?. any help will be appreciated
modified 21-Mar-15 13:18pm.
|
|
|
|
|
First thing first, redesign the marks table as follows:
studentno subjectid mark
20 1 50
20 2 60
20 3 70
20 4 60
21 1 70
... ... ...
The subjectid of the marks table will be the foreign key referencing the subjectid (primary key) of the subject table
The SQL query to retrieve the desire marks by subject by student will be:
SELECT s.subjectname, m.mark FROM marks m inner join subjects s
on m.subjectid = s.subjectid WHERE studentno = 20
Find out more on http://www.datanamic.com/support/lt-dez005-introduction-db-modeling.html[^]
|
|
|
|
|
Unless you have omitted in your post something from your database-model, my first suggestion would be to rework your database-model a bit. You're missing some stuff there which would make a lot of sense:
Table ExamType
ExamTypeId (Primary Key)
ExamTypeName (Exam I / Exam II / Exam III)
Table Subject
SubjectId (Primary Key)
SubjectName (English / Geography / ...)
Table Student
StudentId (Primary Key)
StudentName
Table Exam
ExamId (Primary Key)
ExamTypeId (Foreign Key referencing ExamType.ExamTypeId)
SubjectId (Foreign Key referencing Subject.SubjectId)
ExamTakenDate
Table Mark
ExamId (Foreign Key referencing Exam.ExamId) \_ Primary Key
StudentId (Foreign Key referencing Student.StudentId) /
Score
Then you can get the marks with a query like this:
SELECT St.StudentName,
Sj.SubjectName,
Et.ExamTypeName,
Ex.ExamTakenDate,
Mk.Score
FROM Student AS St
JOIN Mark AS Mk ON St.StudentId = Mk.StudentId
JOIN Exam AS Ex ON Mk.ExamId = Ex.ExamId
JOIN ExamType AS Et ON Ex.ExamTypeId = Et.ExamTypeId
JOIN Subject AS Sj ON Ex.SubjectId = Sj.SubjectId
WHERE
StudentId = ...
ExamId = ...
SubjectId = ...
Edit: What you can read when following the link Peter Loew has posted in his answer is basically the reasoning for my suggested rework of your database-model.
Recursion: see Recursion.
modified 21-Mar-15 11:42am.
|
|
|
|
|
thanks for replying...i have tried and it assists. But sorry for this. I forgot something in the final report form
SUBJECTNAME Exam I Exam II Exam III Avg
ENGLISH 50 78 67
GEOGRAPHY 60 67
MATHEMATICS 70 56
BIOLOGY 60 90
CHEMISTRY -
PHYSICS -
Kindly assist...Will be grateful
modified 22-Mar-15 13:54pm.
|
|
|
|
|
Hi everybody.
My problem: I have a query and it takes too much time to fetch, when I use substr funtion to create an inner join between a table and a view... my code:
select *
from myview@rs T
inner join myTable D on T.CODE_ONE= substr(D.NUM,0,3) and T.CODE_TWO=substr(D.NUM,3,15)
where D.NUM='1344628596434'
The problem is:
on T.CODE_ONE= substr(D.NUM,0,3) and T.CODE_TWO=substr(D.NUM,3,15)
The query doesn't take too long time, when I do this:
select *
from myview@rs T
inner join myTable D on T.CODE_ONE= '134' and T.CODE_TWO='4628596434'
where D.NUM='1344628596434'
But I cannot use static values... thanks for the help
modified 20-Mar-15 16:03pm.
|
|
|
|
|
Ludwing RS wrote: I have a query and it takes too much time to fetch How much time would be allowed?
There's no faster alternative to splitting a string, but it does count as a design-mistake. Each attribute in the tupel should be atomic. You should not need to separate the facts from a single field. They should have been two separate columns.
You "could" try to create an view that does the splitting, and making sure that those calculated columns are materialized. It would effectively move the extra processing required to when the view is created, rather then when the data is requested.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Function based index to the rescue.
create index myTable_num_fnix
on myTable (substr(NUM,0,3),substr(NUM,3,15)); Yes, both conditions needs to be in the same index. Oracle is using only one index per table and query.
<edit>Fixed typo</edit>
modified 21-Mar-15 4:02am.
|
|
|
|
|
Thanks for the answers... I don't have permissions to modify the tables, creating indexes, etc
|
|
|
|
|
Hi All,
I have an SSRS report which has two columns X and Y value but it is same category, so for example, Axis is the main column under this I have X and Y values, for showing it in more sensible way I want to have a a row in the header which has Axis and from the next row I want to have X, Y headers under these I want to display V values and Y Values, I could have done same by taking two columns and keeping the X Axis and Y-Axis as column headers but I want to show them in more readable format.
Can I do it by using SSRS, please help me but any suggestion, link or code snippet, it would be great help for me.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi All,
I have an SSRS report in which I want to change the name of the field from FundingModel to ClassFundingModel and I want to add a new field called "FundingModels", for this I have added the same in the ReportDataset and refreshed the fields, the new fields shows up in the query when I run it but when I copy this same report on to IIS folder and call it from Report Viewer, it gives me the following error. Please help me what should I do to make it working through report viewer also.
I tried to open the table1_Details_Group by right clicking to see if I can edit it at all it is using the old field name ie. ‘FundingModel’, but it doesn't show me any field names, where is it setting and how can I edit table1_Details_Group, if I can't or if I have done any mistake in editing the field names and in adding the new fields please help me with that, please help me any link, code snippet or advice is very helpful.
Thanks in advance.
The SortExpression expression for the grouping ‘table1_Details_Group’ refers to the field ‘FundingModel’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Your group is still set to sort by the old field name. Within the group properties, look for the "Sorting" tab.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you got it resolved thanks for your help.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I'm working as devops in a SSAS project with SQL Server .
My final goal is automatise the deploy process of the olap cube (or SASS), I'm getting hard time try to do it.
Anyone have experience in this kind project?.
Can provide me information or material to study
What I need to do is find a way to do all the process by command line.
I have some parts of the overall process already resolved.
But what keep me frustrate is find a way to process the cube by command line
Background of the project
The datasource of the project is a virtual database,in consecuence, it's can read information for any data sources (other databases like SQL Server, Mysql or even documents like XML, spreadsheets ) and expose as single source to the cube.
more info in this link.
Before to start process, for performance reason it's necessary to stop any scheduled jobs in the cube.
When the process start, it's going to fetch the information from the vdb if there are 50 million records from legacy datasources. Then they are going to stored into the cube cannot do anything to avoid this
After finish to process, The final step is run some unit test made with NBI testing framework .
After finish to process i need to run some test made with NBI testing framework over the cube.
For example
> > If the field fiscal_year exists in the date dimension
> > the query X is not doing a fullscan
more info in NBI codeplex site
|
|
|
|
|
Hello guys, this is my first message in codeproject.
My problem is the next, I have two databases in two different servers of SQL SERVER 2012, both, and I am using indexed views, functions that calling to that indexed views, Full-text catalogs ...
I need to have the same structure in both, I do change the database 1 and, I want to have the changes in the second without creating everything from the start. I have tried using scripts and tools like db comparer. I choose the elements or the execution of the script step by step, by order, for avoiding impact problem.
Well, I have the following error:
You can not use the CONTAINS or FREETEXT predicate on table or indexed view 'dbo.vwProducts', because it is not full-text indexed.
When I create the script, I select the option of creating "Full-text catalog", but definitely it doesn't create the Full-text catalog correctly. Is there any option of creating a script respecting the data from the database 2 and also incorporating "Full-text catalog" and other changes?
|
|
|
|
|
Caveat - we don't use indexed views or full text so...
Have you tried using SQL Compare from Red-Gate, for us, it does an excellent job.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|