|
Hi every body!
Please tell me! how can i get list of all tables in oracle database and all fields of a table?
Thanks!
xyz
|
|
|
|
|
This is the ANSI SQL way to get all tables:
select TABLE_NAME from INFORMATION_SCHEMA.TABLES
|
|
|
|
|
test
|
|
|
|
|
you can use
select * from tab
to get the list of all tables
vaibhav.
|
|
|
|
|
SELECT * FROM USER_TABLES
Free your mind...
|
|
|
|
|
i need to insert inside a column field a null value.
I'm tring with this but it doesn't works infact insert a string:
cmd.Parameters.Add("@Data_p", "Null");
what is the correct sentence?
|
|
|
|
|
try cmd.Parameters.Add("@Data_p", DBNull.Value);
|
|
|
|
|
I need to update a row of a table made by:
auto counter | string | integer
my table name is myTable and the columns are:
ID | Text | number
i use database access and c#
|
|
|
|
|
Well you can't update the autocounter, that is 1. The rest is ass follows:
UPDATE myTable SET Text = 'My new Text', number = 645
I guess you know how to make a SQLconnection and sqlcommand in C#. And in this case you can use the ExecuteNonQuery() method of the SqlCommand, because this update doesn't return any values.
Btw. it is best practice to but this query inside a stored procedure (for security + performance reasons).
Gidon
|
|
|
|
|
Hi
MySQL stores database files in the data folder specified in the configuration file.
But I want to use different location when creating new databases.
Is this possible ? And How ?
|
|
|
|
|
I want to create an Access database on my PocketPC (WinCE4.2, PocketPC 2003 OS). Then using C# to populate tables, query tables, ...
From a simple search on Google.com I find that I must use ADOCE.NET but I didn't succeed to download it and also didn't see any control that I can use from Visual Studio 2003 (I created a project for Smart Mobile Device).
Is there any one has experiences doing such kind of work?
Best regards,
A. Riazi
|
|
|
|
|
|
This is part of Platform Builder 3.0 and if you have not it, the setup will fail.
A. Riazi
|
|
|
|
|
Hello all,
I made a database on the deployment server and i made some changes in the development server on the database struction releation data types etc...
the database on the deployment server filled with data.
how can i apply the changes from the develpement server on the deployment server without wast the data.
Regards,
Hay
|
|
|
|
|
Create deployment scripts.
Take a copy of the production database (what you are calling the deployment server). Back up the production database and restore it to a test environment. e.g. a second SQL server instance on your development machine.
Write scripts that change the data model and run it on the copy. You may have to do this several times to get the scripts right so they don't fail.
Once you have written and debugged the change scripts you can run them on the production system.
As a general note, you should think about how to deploy changes to a database before making the changes. The first thing I do is to create the change scripts and repeatedly test them as development progresses so that I don't have any nasty surprises at the end. Also, because the restore process can be lengthy it means that will your test environment is restoring in the background you can do other development.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Thanks so much ,
yes it is very helpful but i did the changes in the database how can i make script from the changes only.
Regards
Hay
|
|
|
|
|
When you make changes in "the database" (by that I'm assuming you actually mean you used the Enterprise Manager") all that is happening is that the application is creating SQL scripts and running them.
All you need to do is to write scripts based on that. Enterprise manager can help by creating scripts for you. This will be a good starting point if you've created new tables, but you can take these scripts and modify them for just the changes.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Thanks Colin i aprictiat your replyes .
I am useing Enterprise Manager but the script from the it for all database not for my chages only. and modifyed the hole script or take parties from it so hard if the database is large do you know any way we can do that.
I thinking about make new database with the new chages and make a database maping to transfer the data from the old database to the new database.What do you think?
Regares,
Hay
|
|
|
|
|
In Enterprise manager,
1)Right click on the table you wish to alter.
2)Right click and choose Design Table.
3)As soon as you make a change, a "Save Change script" Icon on the toolbar becomes active.
This will allow you to save your changes to a text file.
hth
Gregg
|
|
|
|
|
Hi,
I'm using the ATL OLEDB classes and I get the following error:
"Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
when I query the database with a query that uses the "DISTINCT" keyword. Here is a sample of my code.
<br />
HRESULT hr;<br />
CDataSource ds;<br />
CSession session;<br />
CCommand<CDynamicAccessor, CRowset> myAccessor;<br />
<br />
CComBSTR bstrUser(strUserId);<br />
CComBSTR bstrPassword(strPasswd);<br />
CComBSTR bstrServer(strSvrName);<br />
CComBSTR bstrDatabase(strDbName);<br />
<br />
CDBPropSet dbinit(DBPROPSET_DBINIT);<br />
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, bstrPassword);<br />
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);<br />
dbinit.AddProperty(DBPROP_AUTH_USERID, bstrUser);<br />
dbinit.AddProperty(DBPROP_INIT_CATALOG, bstrDatabase);<br />
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, bstrServer);<br />
<br />
hr = ds.Open(_T("SQLOLEDB"), &dbinit);<br />
<br />
if ( SUCCEEDED(hr) )<br />
{<br />
hr = session.Open(ds);<br />
}<br />
else<br />
{<br />
session.Close();<br />
ds.Close();<br />
exit(1);<br />
}<br />
<br />
CDBPropSet propset(DBPROPSET_ROWSET);<br />
propset.AddProperty(DBPROP_IRowsetChange, true);<br />
propset.AddProperty(DBPROP_IRowsetScroll, true);<br />
propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);<br />
propset.AddProperty(DBPROP_UPDATABILITY, <br />
DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );<br />
<br />
char Query[] = "select distinct dl_num from deal"<br />
LONG lRowsAffected = 0;<br />
<br />
hr = myAccessor.Open(m_session, Query, &propset, lRowsAffected);<br />
If I remove the DISTINCT keyword, the query works fine
Are there some things I need to set for the DISTINCT and GROUP BY keywords to work? We are using SQL Server 2000. Thanks for your help.
|
|
|
|
|
Hi,
I am trying to find an article that clearly explains the various joins in the DataBases Can any one give me the link that explains well about these.
Thanking you in advance,
Satish.
|
|
|
|
|
Lets say you have 2 tables A and B which cotains the following data
A B
-- --
1 1
2 2
4 3
6 4
7 5
8 6
An INNER JOIN will only match rows from two tables where the join condition matches on BOTH sides of the join.
SELECT * FROM A INNER JOIN B ON A.A = B.B
A B
----
1 1
2 2
4 4
6 6
A LEFT OUTER JOIN will return everything on the left side and the matches on the right side leaving nulls if there is no match
SELECT * FROM A LEFT OUTER JOIN ON A.A = B.B
A B
------
1 1
2 2
4 4
6 6
7 null
8 null
A RIGHT OUTER JOIN is similar but it will return everything on the right side and the matches on the left side leaving nulls if there is no match
SELECT * FROM A RIGHT OUTER JOIN ON A.A = B.B
A B
-------
1 1
2 2
null 3
4 4
null 5
6 6
A FULL OUTER JOIN returns everything on both sides leaving nulls if there is no match
SELECT * FROM A FULL OUTER JOIN ON A.A = B.B
A B
-------
1 1
2 2
null 3
4 4
null 5
6 6
7 null
8 null
Does this help you see the patterns that are created by these join types?
DISCLAIMER: I created these results from my head. There may be errors
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
hi Colin Angus,
Thank you very much for the explanation.It is very clear.I heard of few more joins that are equi join,self join Under what category does this belong to and what are they.
Thank you in advance,
Satish.
|
|
|
|
|
A self join is just when you join a table onto itself. There is no special types of join.
Consider a table with a primary key, PK, and a foreign key, FK, and the foreign key refers to the primary key of a different row in the same table.
For instance:
PK FK
-------
1 3
2 3
3 7
4 7
5 8
6 3
7 null
8 null Now, do a join onto itself like this:
SELECT * FROM table AS t1 INNER JOIN table AS t2 ON t1.fk = t2.pk
t1.PK t1.FK t2.PK t2.FK
------------------------
1 3 3 7
2 3 3 7
3 7 7 null
4 7 7 null
5 8 8 null
6 3 3 7
Remember that t1 and t2 are actually the same table, you need the aliases so you can treat the table as if it were actually two separate tables. Once you have the aliased, you can do any type of join you like that you could on two separate tables. Also, thinking about it as being two separate tables, that happen to both hold exactly the same data makes it easier to comprehend.
Does this help?
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
i get sintax error in this query, why?
query = "UPDATE TmyTable SET Title = '" + labelTitle.Text + "', Text = '" + TextBox1.Text + "', Left = " + this.Left + ", Top = " + this.Top + ", Color = " + panelColor.BackColor.ToArgb() + " WHERE ID = " + id;
the table is made:
[id][title][text][timer][info][Left][Top][Color]
counter | string | string | date | string | int | int | long
|
|
|
|