I keep getting a error that says,
Argument 2 of function Replace cannot be an empty
I can't figure out what I'm doing wrong.
The code:
local.drafts.setSQL( "INSERT messages (tm, draft, linkA, linkB) values (:tm:, :draft:, :linkA:, :linkB:");
local.drafts.addParam(name="tm",value=s,CFSQLTYPE="CF_SQL_TIMESTAMP");
local.drafts.addParam(name="draft",value=1, CFSQLTYPE="CF_SQL_BIT");
local.drafts.addParam(name="linkA",value=h,CFSQLTYPE="CF_SQL_SMALLINT");
local.drafts.addParam(name="linkB",value=b,CFSQLTYPE="CF_SQL_SMALLINT");
local.drafts.execute();
Are you sure the syntax is correct? I don't recall the ending : so would try (keeping note of trailing spaces)
local.drafts.setSQL("INSERT INTO messages (tm, draft, linkA, linkB) VALUES ( :tm , :draft , :linkA , :linkB )");
Might just be that your trailing bracket on the VALUES is on the wrong side of a quote of course
Similar issue was seen in this Error using Query Parameters with cfscript query
If of course this is due to a C+P error please re-post source
This sounds like an issue with Mura's Search Engine Safe (SES) URLs.
This is a replace function error see hasbro's example!
http://webcache.googleusercontent.com/search?q=cache:a0Dxwwp5iPsJ:www.hasbro.com/games/en_US/clue/virtual-mansion/fileSizes.cfm%3Ffn0%3D%26fn1%3Dclue.swf%26&hl=en&gl=us&strip=1
Related
I use UPDATE a SET GR_P = REPLACE(GR_P,'','') FROM mytable a to replace things.
But replace function is not working for below charter:
In Query analyzer it works but when I used SSIS Execute SQL task or OLEDB Source then it is giving me error:
No Connection manager is specified.
In Toad against Oracle (since that's one of your tags), I issued this (pressing ALT-12 to get the female symbol) and got 191 as a result. note selecting it back using CHR(191) shows an upside-down question mark though.
select ascii('♀') from dual;
Given that, this worked but it's Oracle syntax, your mileage may vary.
UPDATE mytable SET GR_P = REPLACE(GR_P, CHR(191));
Note if it does not work, that symbol could be for another control character. You may need to use a regular expression to eliminate all characters not in a-zA-Z0-9, etc. I suspect you'll need to update your tags to get a more accurate answer.
Maybe this info will help anyway. Please post back what you find out.
I find it hard to imagine that this question hasn't been asked before, but I couldn't find it.
I would like to use Linq2Db for Sybase and I need to change the identifier quoting characters from [ and ] to " and ", which is what Sybase uses. Is there anyway to do this? I tried looking at the linq2db source code once and it appears that these characters are hard coded, but I'm not sure (I think it would be silly to hard code them). Using Linq2db as it comes always produces errors around the "[" when Sybase executes the queries.
This is Sybase ASE 12.5, and it does not like [];
Here are some sample queries and the error message:
set quoted_identifier on
select * from "client" where clnt_id=140
select * from [client] where clnt_id=140
the first query works, but the second gives:
Incorrect syntax near '['. [SQLCODE=102, SQLSTATE="42000", Server=testtrng_ss1, Severity Level=15, State=1, Transaction State=1, Line=3]
Please need help! Issuing this problem for couple days cannot understand and find any useful information on how to resolve it
I am getting this error when I am trying to run procedure with call from php
E_AD2005_BAD_DTLEN ADF routine found DB_DATA_VALUE with an invalid length.
E_SC0520_SCS_BAD_DBV SCS_INPUT invalid DBV detected: db_datatype = -20, db_length = 1, db_prec = 0.
E_SC021C_SCS_INPUT_ERROR SCS_INPUT internal error.
any idea how to resolve it and what does it mean ?
also, strange thing i am getting this error only if I do call from php , if I am calling this procedure from Visual DBA its running perfectly with no errors.
The value of one of your parameters is inconsistent with the declaration in the procedure..
Remember php by default does not define its variables until you put something in it so if you are dealing with a string and it has numeric values php will see that as a numeric variable ..
If in doubt cast your variables (string) $variable_name.
I am trying to extract id of Android app from its url but getting extra characters.
Using replace function in sql server, below are two sample urls:
https://play.google.com/store/apps/details?id=com.flipkart.android&hl=en com.flipkart.android
https://play.google.com/store/apps/details?hl=en_US&id=com.surveysampling.mobile.quickthoughts&referrer=mat_click_id%3Df1901cef59f79b1542d05a1fdfa67202-20150429-5128 en_US&id=com.surveysampling.mobile.quickthoughts&r
I am doing this right now:
SELECT
SUBSTRING(REPLACE(PREVIEW, '&hl=en',''), CHARINDEX('?', PREVIEW) + 4 , 50)
FROM OFFERS_TABLE;
But for 1st I am getting com.flipkart.android which is correct, but for 2nd I am getting en_US&id=com.surveysampling.mobile.quickthoughts&r.
I want to remove en_US&id from starting of it and &r from its end.
Can someone help me with any post or url from where I can refer?
What you are actually trying to do is extract the string preceded by id= until the & is found which is separator for variables in URL. Taking this condition I came up with following regex.
Regex: (?<=id=)[^&]*
Explanation: It uses the lookbehind assertion that is the string is preceded by id= until the first & is found.
Regex101 Demo
It seems like you've made some assumptions of lengths. The the &r is appearing because that is 50 characters. You are also getting the en_US because you assumed 4 characters at the beginning but your second string has more. Perhaps you can split on & and then look for the variable that begins with id=.
it seems like a function like this would help.
http://www.sqlservercentral.com/blogs/querying-microsoft-sql-server/2013/09/19/how-to-split-a-string-by-delimited-char-in-sql-server/
I made a couple of reports that are using a data-source for the parameter values. The same query is specified in available values and default values, so that I can select multiple values at once. The query usage is like this:
WHERE (Column.Name IN (#Parameter))
However, I get this error:
Any ideas what could it be? Other reports using same method work fine, but with this one it doesn't.
So i Ran the SQL Profiler and seen that the errors came from the code that is looking is the param a null (#param is null) that was the mistake because i allready sead in the options to now allow null
Thank you Chris Latta you helped me allot :)