|
Hello,
I need to write a stored procedure in MySQL that loops through all rows in a table (the column types are TEXT and VARCHAR) and replaces certain characters in the column values with another character. For example, a certain column contains the text "ababa" and I want to change it to "acaca".
I can't quite figure out the part about replacing a character in a string with another and could use some help with this!
Thank you!
Sylv
|
|
|
|
|
Sylv33 wrote: the part about replacing a character in a string
There's a Replace [^]-function in MySQL. You'd have to test if it also works for the TEXT -type field though
I are Troll
|
|
|
|
|
Sylv33 wrote: loops through all rows in a table
The engine should do that; you shouldn't.
|
|
|
|
|
Hello friends,
I restored My database in SQL 2005 of size more than 4 GB but it creates problem when i save picture (image data) in database.i.e i can't save it.So i searched for that problem and came to know that SQL Express 2005 has database size limit of 4 GB.
i upgraded it to SQL EXPRESS 2008 and restored it to there.Still it has the same prblem means i can't able to save data..
So what may be the problem.
Thanks in advance.
RAHUL PATEL.
rahulpatel112@live.in
|
|
|
|
|
AFAIK SQL Server Express 2008 and 2005 have the same set of limitations, one of them being file size is 4GB maximum.
There are a couple of solutions:
- split your database over two or more files;
- don't store big objects (images) inside the database (keep them as individual files, just store the path in the DB);
- switch to a full-blown DB (SQL Server, non-Express).
|
|
|
|
|
Use Sql Express 2008 R2. That has a size limit of 10GB
"An eye for an eye only ends up making the whole world blind"
|
|
|
|
|
I learn something new each day. 10GB is confirmed here[^].
|
|
|
|
|
Thanks for your reply.
i upgraded sql 2005 express to sql 2008 EXPRESS WITH TOOLS that is
R2 version of SQL EXPRESS.
But still the same problem there....
|
|
|
|
|
Then I suggest you provide a detailed and accurate problem description: describe your set-up, show the failing code and the observations or error messages with all their detail. That should allow people to give a precise answer. We need more than "it doesn't work".
|
|
|
|
|
Thanks a lot dear friends for your valuable time.
I have installed SQL EXPRESS 2008 but it was not EXPRESS R2 version thats why its creating problem.
I came to know that thing when i was changing the initial size of database to 5500 MB.
Thankx.
|
|
|
|
|
Please do not cross post in more than one area, you have also posted this in the Q&A's.
Cross posting is bad for splitting up topic responses. I am going to delete the Q&A post as no response there yet.
|
|
|
|
|
I have 10000 rows of schools database. i want to write query such that schools wise ,subject wise ,no_of_students scored < 35 marks. i want to use group by command how do i ???? please help me
************ S G KORE *******************
|
|
|
|
|
|
Cmon be generous, what have you got so far, give us something more that the bare question to work with.
Select School,Subject, count(*) <br />
from suitable tables<br />
where score < 35<br />
group by School,Subject
Suitable tables will be the only challenge
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you Mycroft Holmes.
I tried this. but i am getting only one subject grouping data. i want is :-
School name ,count(lan1 marks <35), count(Lan2 marks < 35),count(Lan3 marks <35) ......I want to know school wise No of students who have failed in all subjects. Please tell me
************ S G KORE *******************
|
|
|
|
|
shiva.kore wrote: lan1 marks
What does this represent in your ideas.
Do you want a count of all students who scored < 35 in EVERY subject. This is quite a bit more complex and requires more knowledge of your data.
Basically get a distinct list of all student/scores > 35 then get a list of all student/scores who are NOT IN the > 35 list.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
We did a program 5 years ago to read a dbf table. The user now updated to Windows 7 and the program now gets this error
err=-2147467259 (80004005) [Microsoft][ODBC Driver Manager] Driver does not support this function
Connection string=Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=E:\\SPEC.DBF;Exclusive=No
It does NOT fail on the development machine which has Visual Studio 6, and Vis Studio 2005 .Net and Vis Studio 2010 are installed.
It did fail on a new Win 7 virtual machine after install the Visual Fox Pro 9 Driver (prior to the VFP driver it was getting a 429 activex failure).
It is not clear what the correct driver is to resolve this.
Can anyone help?
|
|
|
|
|
So you need to work out if it is win 7 or the virtual machine. I seem to have heard a number of complaints about drivers and virtual environments.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I think if you install MDAC_TYP 2.8 or earlier may solve your issue.
|
|
|
|
|
Hi,
I've tables, procedures and functions scripts of a oracle database. i need to convert it to sql server scripts. how to do that?.
we don't have oracle database but we have only scripts for the oracle database objects, is it possible to convert those scripts to sql server and create those objects in sql server database.
sql server version is 2005.
Thanks in Advance
|
|
|
|
|
try this oracle to sql server conversion
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.
|
|
|
|
|
SQL Server Migration Assistant for Oracle (SSMA for Oracle), does it requires oracle client in my system, i don't have any oracle in my system at the same time i'm very new to oracle.
i've tried some trial tools but everything require oracle database but i've only oracle script.
how to convert those scripts to sql server based one.
|
|
|
|
|
best thing I could suggest is to post some of the code and we'll give you a head start on its conversion
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.
|
|
|
|
|
Hi,
I'm posting sample table script
CREATE TABLE "DEV"."APP_ID"
( "AID" NUMBER NOT NULL ENABLE,
"ID_TYPE" NUMBER NOT NULL ENABLE,
"CREATED" DATE DEFAULT sysdate NOT NULL ENABLE,
"CREATED_BY" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"UPDATED" DATE DEFAULT sysdate NOT NULL ENABLE,
"UPDATED_BY" VARCHAR2(30 BYTE) NOT NULL ENABLE,
PRIMARY KEY ("AID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "APPLICATION_DATA" ENABLE,
FOREIGN KEY ("ID_TYPE")
REFERENCES "DEV"."ID_TYPE" ("ID_TYPE") ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "APPLICATION_DATA" ;
CREATE OR REPLACE TRIGGER "DEV"."T_APP_ID"
BEFORE INSERT OR UPDATE ON APP_ID
FOR EACH ROW
BEGIN
:new.updated := sysdate;
:new.updated_by := username;
if inserting then
:new.created_by := username;
end if;
END T_APP_ID;
/
ALTER TRIGGER "DEV"."T_APP_ID" ENABLE;
|
|
|
|
|
CREATE TABLE App_ID
(
aid INTEGER PRIMARY KEY NONCLUSTERED,
id_type INTEGER FOREIGN KEY REFERENCES dev.id_type,
created DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
created_by varchar(30) NOT NULL,
updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_by varchar(30) NOT NULL,
)
drop table app_id
been a bit too long since I've done Oracle to remeber triggers so here an msnd refernce link triggers
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.
|
|
|
|