[CODE=mysql]SET @qry = 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
PREPARE stmt2 FROM @s;
SET @first_param = 6;
SET @sec_param = 8;
EXECUTE stmt2 USING @first_param, @sec_param;
[/CODE]
These are few lines in my stored procedure. Here if I change the identifiers @qry, @first_param, @sec_param to qry, first_param, sec_param respectively
mysql doesn't allow to compile the stored procedure....
User Profile
Collapse
-
Prepare statement allows only global variables?
-
For joins you can specify multiple join conditions between two tables
for eg:
select * from table1 inner join table2 on (table1.id = table2.id and table1.name = table2.name) -
Here I assume application_no is unique, table name is "test_resul t"
select * from
(select qualification, application, max(obtainedmar ks) obtainedmarks
from test_result group by qualification, application) summary
inner join test_result details
on summary.qualifi cation = details.qualifi cation and summary.obtaine dmarks = details.obtaine dmarks and summary.applica tion= details.applica tion...Leave a comment:
-
As I understand,
In first method all the rows in the first table is taken into joining, so all the records of employee_master table has to be joined with salary_payment. Then it does the filtering out of emp_rid to match 10234.
In the second method only one record from employee_master table will be considered and then the join operation is less expensive.
So the second method will be better. I have no solid idea...Leave a comment:
-
Querry optimization to have better performance
I have the folowing two tables.
employee_master (
emp_rid int primary key identity,
emp_no char(20) not null,
emp_name varchar(100)
);
salary_payment(
sp_rid int primary key,
sp_emp_rid int COMMENT 'Maping employee_master .emp_rid',
sp_pay_date date COMMENT 'Payment Date',
sp_amount varchar(100)
);
Assume in index is created on the fields salary_payment( sp_emp_rid).... -
I am doing to work on IE 6.0.
First I tried with dynamically loading then I include initially itself. The error populates when the script inclusion happens....Leave a comment:
-
In line comment //@@ gives Invalid character
I have the following function in my javascript file
CODE:
[CODE=javascript]function displayFullName (firstName, lastName) {
if(lastName != null) { //@@ Appnds only when last name exists
return (firstName + ' ' + lastName);
} else {
return firstName;
}
}
[/CODE]
Here the inline comment gives me error "Invalid character".
When I remove @@ it... -
Function to refresh the screen
CODE:
function checkAll() {
var now = new Date();
var chkBoxes = document.getEle mentsByName('ch kMe');
for (var limit = 0; limit < chkBoxes.length ; limit ++) {
while(((new Date()).getTime () - now.getTime()) < 1000) {} //Delay 1 sec.
chkBoxes[limit].checked = true;
}
}
I have so many check boxes in my screen, the above function will check the check... -
Hello,
For running a script file we can give commands in different ways,
My command: mysql -u<user name> -p<password> -D<database> < "<file name in same directory>"
The command i have given is right, also the your syntax is correct.
If you still doubt you can try with the command I have given.
But my doubt is not about "how to execute a script file"....Leave a comment:
-
Zero rows fetch error when executing dump file
Hi all,
I have run a batch file contains,
mysql -uroot -proot -Dsample_db < "create_sp. sql"
The "create_sp. sql" file contains definition for the stored procedure by the name get_account_det ails()
Now i opened SQLyog and when I executed get_account_det ails() it generates error with message "zero rows fetched, selected, or processed"
But when i move... -
Thanks for your solution.
I don't have very good idea in specifying print medial through style sheet. I have searched for it in web but i couldn't find out.
Can you send me some examples that specifies print media through stylesheet , or some url for the reference.Leave a comment:
-
Printing document in text mode
Hi all,
[CODE=javascript]function printReport() {
frames['iframeReport'].print();
}[/CODE]
The function printReport prints the specified iframe, iframeReport.
I am using dot matrix printer. I want it to be printed in text mode so that the printing will be done much faster.
How can i print this in text mode.
Thank you, -
Is there any function that escapes the special characters
Hi All,
select '\';
The above will give me error because mysql uses '\' as escape character.
So i changed the query to,
select '\\';
Here i don't want to worry with escape character stuff. So i need a function
which takes the parameter
1> parameter value = '\'
return value = '\\'
2> parameter value = '\t'
return value = '\t'
2>... -
Replace all "\\" substring with "\\\\"
Hi all,
String x = "\\";
This string will have the value \.
Now for any string contains \, i need to replace with \\.
But when i use x = x.replaceAll("\ \", "\\\\");
I am getting runtime exception.
How can i replace this. -
To print directly without showing the window
Hi,
I have a code like this
[CODE=javascript]function printDocument(u rl) {
var newWindow = window.open(<ur l>, '_blank');
newWindow.print ();
setTimeout(<fun ction name>,2000); // code for delaying to complete printing
newWindow.close ();
}
[/CODE]
Here the specified window gets opened and printed. But I actually need to just print the window(newly... -
Thank you very much for your solution.
Can you send me the proper code on vbscript which will do this functionality (Working only in IE is fine)....Leave a comment:
-
Print the window without opening Printer Dialogue Box
Hi All,
In javascript i am using the code window.print().
It opens the printer dialogue box and user has to confirm.
I need the code to print the page directly without promoting Printer Dialogue Box.
Thanking you, -
Which querry will give more performance
I have the following tables,
1> employee_master (emp_id int primary key, emp_name varchar(100));
2> employee_salary _payment(salary _rid int primary key, emp_id int, sal_date date, paid_amt int);
The tables, employee_master and employee_salary _payment have one to many relation.
I need to list the salary payment done for the employee having id = 10. Here I use two different querry to work.
... -
Yes, I know this is not the right way of designing. But it was already made.
Here i need the solution with query....Leave a comment:
-
How to get datetime from both date and time fields
Hi all,
I have a table,
account_transac tions(trans_rid int primary key COMMENT 'Transaction ID',
trans_date date COMMENT 'Date of transaction',
trans_time time COMMENT 'Time of transaction')
I need a query which returns me two fields "Transactio n ID" and "Transactio n Date" time.
The "Transactio n...
No activity results to display
Show More
Leave a comment: