YDN DB "In"-statement - ydn-db

I want to fetch all records from my database where the id is 20, 21, 22.
In sql you could say: Select * from moo where id in (20,21,22)
How can I do this in ydn db?
Unfortunately I found no working example for this issue.
Thanks for reply.

YDN-DB is yet to implement multi-query. Currently you have to query one by one.

Related

how to sqlDrop an existing query (not table!) in R // delete existing query that is stored in an Access database

I often use RODBC to work with MS Access files in R. For removing existing tables sqlDrop works fine, e.g.:
db <- odbcConnectAccess(choose.files(caption="select database"))
sqlDrop(db, "existing_dummy_table")
What I need to do now is to delete an existing query that is stored in the Access database. sqlDrop does only seem to work with tables, not with querys.
sqlDrop(db, "existing_dummy_query")
brings up:
Error in odbcTableExists(channel, sqtable, abort = errors) :
‘existing_dummy_query’: table not found on channel
Is there any solution how to delete/remove existing queries?
Thank you!
After a lot of testing I found a soultion myself:
sqlQuery(db, "DROP TABLE existing_dummy_query";)
Maybe its helpful for others. DROP VIEW did not work. I don't know why.

Invalid object name 'product_Design'

I am getting this error while saving my data into the table. I have already created a 'product_Design' table in my database. I am using Sql Server 2008. Everything is working fine on local host but not on the server. I also tried to insert data in different tables and its working but I am just not able to insert data in this(product_Design) table ? I really need help regarding this thing.
here is my sql query
insert into z3ctjholo.dbo.product_Design values(#prodID, #productName, #designName, #designPath, #finalDesign, #front, #cont, #divHeight, GETDATE(), 0, 1)
I also tried this query
insert into product_Design values(#prodID, #productName, #designName, #designPath, #finalDesign, #front, #cont, #divHeight, GETDATE(), 0, 1)
Both the queries are generating error. Please help me out.
Thanks..
So finally i found what is the problem. if you ever face such kind of problem then execute this command in sql server and see whether your table is connected to any schema apart from dbo. Use this statement to check whether the table is connected to any other schema.
use yourDatabaseName
Then
SELECT * FROM INFORMATION_SCHEMA.TABLES
after that if you find that your table is connected with other schema apart from dbo then use your any statement like this
select * from schemaName.tableName
(eg. my schema name is z3ctjholo and my table name is product_Design)
so my statement would be like this
select * from z3ctjholo.product_Design
what i was doing wrong, i was using two schema names (z3ctjholo.dbo.product_Design).
I hope it will help someone..
Thanks...
There are two reasons, I can find so far.
1. Either the connection settings in web.config is incorrect.
2. your database is case sensitive collation and so check the name with case. May be you have created the table with name Product_Design and trying to insert in product_Design, in this case also, the command may not work.
Please check both the points.

Sort fetched data by date in ydn db

I have an issue in ydn db.
I need to fetch records by ids. Because it is not possible yet to say something like
"WHERE id IN (10, 11, 12)" you have to fetch id to id.
The problem comes here... I do not have to oppurtunity to sort fetched data by date with ydn db.
Now the question: Currently I sort the records with my own algorithm.
Is a indexeddb wrapper out there which is able to fetch records like my example above? If not so, is there a library which sorts an array of objects by given object key? (In my case it would be the date)
Thanks in advance. :-)
It is not possible. Not all sorted query are possible in IndexedDB. In this case, you have to resolve to in-memory sorting or using temporary object store. There is incomplete implementation ydn.db.Buffer to do this.

select Oracle Table from toad without specifying the Schema

Hi Guys I am running an Oracle DB and I have to Write the Schema(Owner) name before selecting the Table. I find this Quite Unnecessary especially when am Logged in as the Table Owner Like:
select * from MUNGAI.Employees;
When am Actually Logged in as user MUNGAI the same Who Created the table. I want to be able to select like:
select * from Empployees;
From this I get the Error On Toad....On SQLDEVELOPER I get No Error and I want to Use TOAD
ORA-00942: table or view does not exist
Any Ideas on How to Achieev this??
I have to Write the Schema(Owner) name before selecting the Table.
No, you don't have to. Why do you think so? Did you even try it?
When you are logged in as the owner of the table you do not have to specify the schema.
Any Ideas on How to Achieev this??
Yes, simply write
select * from Employees;
Again: this works if - and only if1)) - you are logged in as MUNGAI.
1) leaving things like public synonyms aside

Community server Username issue - User Username not found in membership store does not exist

I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx is traversed on a specific sectionID. I suspect that a username has been amended but the posts havn't recached to reflect this.
Is there a way a can check the data integruity by performing a select statement on the database, alternatively is there a way to force the database to recache?
This error could be thrown by community server if it finds users that aren't in the instance of MemberRoleProfileProvider.
See CommunityServer.Users AddMembershipDataToUser() as an example
UPDATE:
I Solved this problem for my case by noticing that the usernames are stored in two tables - cs_Users and aspnet_Users. Turns out somehow the username was DIFFERENT in each table. Manually updating so the names were the same fixed this problem.
Also, the user would left out of membership in the following line of the stored procedure cs_Membership_GetUsersByName:
INSERT INTO #tbUsers
SELECT UserId
FROM dbo.aspnet_Users ar, #tbNames t
WHERE LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = #ApplicationId
The #tbNames is a table of names comes from cs_Users(?) at some point and therefore the usernames didn't match and user was not inserted in to the result later on.
See also: http://dev.communityserver.com/forums/t/490899.aspx?PageIndex=2
Not so much an answer, but you can find the affected data entries by running the following query...
Select *
FROM cs_Posts
Where UserID Not In (Select UserID
From cs_Users Where UserAccountStatus = 2)

Resources