|
Hey guys,
What is wrong with the below format specifier for to_number?
SELECT TO_NUMBER('0,22', '0,99') * 100 FROM DUAL;
The result is 2200 instead of 22 -- what am I doing wrong?
Answer Snippets (Read the full thread at stackoverflow):
To change the separator for a single query, you could:
select TO_NUMBER('0,22','9D99','nls_numeric.
Try:
TO_NUMBER('0,22', '9D99')
Unlike a literal comma, the D will only match the decimal separator.
|
|
When i give wrong number of parameters in a function , i get errors. How do I handle it?
I gave
def fun_name(...): try: ... except TypeError: print 'Wrong no of arg'
It is not working.
Help please.
Answer Snippets (Read the full thread at stackoverflow):
(...) except TypeError: print "error!"
If you call a function with the wrong number of parameters then there are two possibilities:
Either you design your function to handle an arbitrary number.
|
|
Sometimes we receive stack traces from our customer with wrong line numbers. It happens not so often, but sometimes it puzzles us.
Customers have release assemblies with optimizations and with "pdb only" debug information.
And yes, we compare line numbers...
Answer Snippets (Read the full thread at stackoverflow):
This can and often does make it very difficult to pin the source of an error down to a particular line... .
Not a .net expert, but at least in other languages, when high compiler optimizations are chosen, the compiler may make significant reordering of code .
|
Ask your Facebook Friends
|
Showing app/views/frontend/get_months.html.erb where line #1 raised:
wrong number of arguments (0 for 1) Extracted source (around line #1): 1: <%= render :partial => "months", :locals => {:form => form} %> RAILS_ROOT: /rails_workcopy/er...
Started by Yang on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If there's only one....
Try (assuming you're passing the form through a block in form_for:
<%= render 'months', :f => form %>
Any luck?
According to http://api.rubyonrails.org/classes/ActionView/Partials.html your render partial syntax is correct .
|
|
__int64 i64FreeBytes unsigned __int64 lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes; // variables used to obtain // the free space on the drive GetDiskFreeSpaceEx (Manager.capDir, (PULARGE_INTEGER)&lpFreeBytesAvailableToCaller...
Started by rboorgapally on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
LpTotalNumberOfBytes [out, optional]-
A pointer to a variable that receives the... .
That receives the total number of free bytes on a disk that are available to the user who is associated be less than the total number of free bytes on a disk.
|
|
I am really really stuck and annoyed with this right now.
I am running Rails 2.3.5
My View/pages/customers.html.erb simply has:
<% form_tag do %> First Name <%= text_field_tag :firstName, params[:firstName] %> Last Name <%= text_field_tag...
Started by Omnipresent on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Instead of @cust = Customer.new(params[:firstName], params....
The crucial part - "pass a hash with key names matching the associated table column name" .
Http://apidock.com/rails/ActiveRecord/Base/new/class here is a little explanation of the new function .
|
|
Hi,
Below is my Oracle Procedure. When i call this procedure using java, it throws error like this.
CREATE OR REPLACE PROCEDURE sp_Get_Menu_Parents ( v_inMenuID IN VARCHAR2 DEFAULT NULL, cv_1 IN OUT SYS_REFCURSOR ) AS BEGIN OPEN cv_1 FOR SELECT MenuItemId...
Started by Srinivasan on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You have to provide the second parameter SYS_REFCURSOR ....
Your procedure
CREATE OR REPLACE PROCEDURE sp_Get_Menu_Parents ( v_inMenuID IN VARCHAR2 DEFAULT NULL, cv_1 IN OUT SYS_REFCURSOR )
expects two arguments but you only provide one in your java code .
|
|
This could be an sql server database setup issue, but I am not to sure where to start looking.
I have a stored procedure :
CREATE PROCEDURE aStoredProcedure @dteSince DATETIME = null AS ...
The c# code to call the stored procedure is :-
using (IDataReader...
Started by Ferds on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
It is obvious that something is happening under the hood that is different in both environments but when you are explicit about the command type... .
IMHO the CommandType should always be specified anyway - explicitness is always preferable to implicitness .
|
|
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY hrl.Frn) as Row, hrl.unq, hrl.LcnsId, hc.Business,hc.Name,hc.Phone, hrl.Frn,hrl.CallSign, hrl.gsamarkettypeid, gmt.[Market Type Code] + ' - ' + gmt.gsamarkettype, hrl.gsalatitude,hrl.gsalongitude, rsc....
Started by Xaisoft on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
WHERE do this using a CTE:
WITH NumberedRows....
ROW_NUMBER() OVER (ORDER BY hrl.Frn)) < 20,
or without usingt Row_Number at all,
Where (Select into the outer select
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY hrl.Frn) as Row, ...
|
|
Hi there
According to the official (gregorian) calendar , the week number for 29/12/2008 is 1, because after the last day of week 52 (i.e. 28/12) there are three or less days left in the year. Kinda weird, but OK, rules are rules.
So according to this...
Started by rodbv on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Edit: Wikipedia supports my vague recollection that these numbers differ based on country: http://en.wikipedia.org/wiki/Week_number#Week_number
I would expect a respectable the week number....
If I'm not entirely wrong.
|