|
I have changed the data type of the currencyID and countryID from NUMBER to INTEGER as number is not supported by dotnet.
When I run this query the data_type is still number.
SELECT C.Table_Name ,
C.Column_ID ,
C.Column_Name ,
C.Data_Type,
C.char_length
FROM ALL_TAB_COLUMNS C
WHERE C.TABLE_NAME = 'CURRENCY'
ORDER BY C.column_ID
Any idea how to refresh the ALL_TAB_COLUMNS view or can there be another reason for the change not showing.
Also - any suggestions as to the best Oracle support site. No it's not CP, we are very MS oriented.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In Oracle, Integer is simply Number(38). So if you create a column as an Integer it's converted to number(38)
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
When I look at the table in Schema view (toad) I see integer, if I script the table out I get integer, I'm betting if I used a parameter with a data type it would be integer as well. I have now found that if I create a new table the columns do not show up in the ALL_TAB_COLUMN view, seems it might be a permissions thing.
As NUMBER is not supported by dot net this seems very strange! Do all the orm tools convert number to integer/decimal.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I haven't worked in Toad so I can't say.
But an implicit conversion in dotnet is generally making a widening conversion to decimal unless the scale of the number is specifically 0 then it converts to integer.
If you want a different conversion you have to specify it in the parameters of the dataadapter/datareader.
Here's [^]more info on types.
And here http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1619552483055 is some info on the subject from Tom Kyte, who is an institution in the Oracle World
<edit> fixed link, kind of</edit>
"When did ignorance become a point of view" - Dilbert
modified on Monday, November 8, 2010 5:07 AM
|
|
|
|
|
Thanks for the links Jorgen, it looks like the orm will need to do some dancing around the number conversion in dotnet. Tom's link seems to have died but that could be b/c of my net nazi, I'm at work.
It seems like anything with no scale is an integer, precision seems to range from null to 22 for no discernable reason with both null and 22 being valid for an integer. Numbers in between have a scale and therefore decimal I guess.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It seems to me that the link to Tom's article is destroyed by the hamsters, so here it is as inline code:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1619552483055
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
i want to insert values (into database table) which are calculated from an expression and is stored in a variable, in INSERT INTO statement, how can i do this?
i m doing this in VC++6 MFC using ODBC
constant values goes perfectally in database<
|
|
|
|
|
What you have tried about to insert value you have no mention whatever,
You can easily insert value into your database table by using
Insert into tablename values(your value depend upon table column data type)
|
|
|
|
|
|
for example here is some part of my code:
string str="Birthday";
i have to insert this str variable using:
INTERT into mytable VALUES(str) ;
how can i insert this???
n i dont know how to use parameters...plz tell me some very easy way to do this...
|
|
|
|
|
It partly depends on what language you host your SQL in, also on which database system you use.
INSERT INTO table (field0, field1 ...) VALUES (@Param0, @Param1 ... )
Then create parameters.
Then, as you loop through the data to insert, set the parameters and execute the statement.
|
|
|
|
|
I let you from the beginning step by step to insert data into table
Create a connection by using SqlConnection class as
SqlConnection con = new SqlConnection("connectionString")
then, you need to create Command object by SqlCommand Class as
string str = INTERT into mytable VALUES('"+str+"');
SqlCommand cmd = new SqlCommand(str,con);
then you need to execute query by using ExecuteNonQuery Method as
cmd.ExecuteNonQuery();
This is easiest way to insert data into table. Hope it will work for you.. 
|
|
|
|
|
thanks a lot RaviRanjankr! for ur concern...but i have tried this is a simple one...actually + sign is not recognized in the query, it gives syntex error...but n e ways thanks a lot my problem has been solved now,thanks
|
|
|
|
|
if you don;t want to use parameter then simple make Connction and Command and Execute your command it will save your data.
|
|
|
|
|
Please don't give people bad advice like this. You've basically just advised the poster that they should leave themselves wide open to a SQL Injection attack, and that's not cool.
|
|
|
|
|
|
|
i can't understand your comment? can you describe it?
|
|
|
|
|
Two Words.
First word, Homer.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
please don't advertise your wares the forums please..
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
This is inappropriate, you should be writing an article for CP rather than peppering links to your web/blog.
The only reason it is still here is that it is borderline.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
|
Hello,
I use Microsoft's Oracle client provider.
I have 2 Oracle stored procedures that do the same thing and have only different names:
SP1:
create or replace procedure GetScalar(last_name IN PERSON.LastName%TYPE, row_count OUT INTEGER)
as
begin
SELECT COUNT(*) INTO row_count FROM PERSON
WHERE LASTNAME = last_name;
end GetScalar;
SP2:
create or replace procedure Get_Bool(last_name IN PERSON.LastName%TYPE, r_count OUT INTEGER)
as
begin
SELECT COUNT(*) INTO r_count FROM PERSON
WHERE LASTNAME = last_name;
end Get_Bool;
I use the same C# code for both.
When I use stored procedure SP1 after this code was called:
OracleCommandBuilder.DeriveParameters(objCmd);
int n = objCmd.Parameters.Count;
n is 2, which is ok.
But, when I use stored procedure SP2:
n is 0, which is not ok.
What should I do yo make it work?
When I call both store procedures inside Oracle enviroment both work fine.
|
|
|
|
|
Would help if code tags were used but it appears that the stored proc signature, excluding identifiers, is the same.
If that is the case then you have a faulty assumption.
You are assuming that a difference in identifies makes a difference. Excluding key word usage (which I do not see any) that is not possible.
Since it isn't possible it suggests that you need to look for a difference source of the problem.
So possible reasons are the following. This is not a complete list.
- The proc in your C# code is not named correctly.
- The proc does not exist in the database, or it is an older version with no parameters.
- You are pointing at a different database.
|
|
|
|