How change value in database with SSH - module

I can access to Odoo project only with ssh (VS Code or Cmd)
when I change Field Type "date" to "datetime" I get this error (Show in the picture)
I want to change it with MySQL Server using SSH in table 'ir_model_fields' name = 'date_start' ttype='datetime'
Please any solution for this?

You have to declare date like this
my_date = fields.Date(string='My Date')

Related

Error: Not found: Dataset my-project-name:domain_public was not found in location US

I need to make a query for a dataset provided by a public project. I created my own project and added their dataset to my project. There is a table named: domain_public. When I make query to this table I get this error:
Query Failed
Error: Not found: Dataset my-project-name:domain_public was not found in location US
Job ID: my-project-name:US.bquijob_xxxx
I am from non-US country. What is the issue and how to fix it please?
EDIT 1:
I change the processing location to asia-northeast1 (I am based in Singapore) but the same error:
Error: Not found: Dataset censys-my-projectname:domain_public was not found in location asia-northeast1
Here is a view of my project and the public project censys-io:
Please advise.
EDIT 2:
The query I used to type is based on censys tutorial is:
#standardsql
SELECT domain, alexa_rank
FROM domain_public.current
WHERE p443.https.tls.cipher_suite = 'some_cipher_suite_goes_here';
When I changed the FROM clause to:
FROM `censys-io.domain_public.current`
And the last line to:
WHERE p443.https.tls.cipher_suite.name = 'some_cipher_suite_goes_here';
It worked. Shall I understand that I should always include the projectname.dataset.table (if I'm using the correct terms) and point the typo the Censys? Or is this special case to this project for some reason?
BigQuery can't find your data
How to fix it
Make sure your FROM location contains 3 parts
A project (e.g. bigquery-public-data)
A database (e.g. hacker_news)
A table (e.g. stories)
Like so
`bigquery-public-data.hacker_news.stories`
*note the backticks
Examples
Wrong
SELECT *
FROM `stories`
Wrong
SELECT *
FROM `hacker_news.stories`
Correct
SELECT *
FROM `bigquery-public-data.hacker_news.stories`
In Web UI - click Show Options button and than select your location for "Processing Location"!
Specify the location in which the query will execute. Queries that run in a specific location may only reference data in that location. For data in US/EU, you may choose Unspecified to run the query in the location where the data resides. For data in other locations, you must specify the query location explicitly.
Update
As it stated above - Queries that run in a specific location may only reference data in that location
Assuming that censys-io.domain_public dataset has its data in US - you need to specify US for Processing Location
The problem turned out to be due to wrong table name in the FROM clause.
The right FROM clause should be:
FROM `censys-io.domain_public.current`
While I was typing:
FROM domain_public.current
So the project name is required in the FROM and `` are required because of - in the project name.
Make sure your FROM location contains 3 parts as #stevec mentioned
A project (e.g. bigquery-public-data)
A database (e.g. hacker_news)
A table (e.g. stories)
But in my case, I was using the LegacySql within the Google script editor, so in that case you need to state that to false, for example:
var projectId = 'xxxxxxx';
var request = {
query: 'select * from project.database.table',
useLegacySql: false
};
var queryResults = BigQuery.Jobs.query(request, projectId);
check exact case [upper or lower] and spelling of table or view name.
copy it from table definition and your problem will be solved.
i was using FPL009_Year_Categorization instead of FPL009_Year_categorization
using c as C and getting the error "not found in location asia-south1"
I copied with exact case and problem is resolved.
On your Big Query console, go to the Data Explorer on the left pane, click the small three dots, then select query option from the list. This step confirms you choose the correct project and dataset. Then you can edit the query on the query pane on the right.
may be dataset name changed in create dataset option. it should be US or default location
enter image description here

String was not recognized as a valid Boolean Error on varchar column

I am getting this error:
String was not recognized as a valid Boolean.Couldn't store <No> in meetsstd Column. Expected type is Boolean
When I am running this query:
SELECT * FROM work_nylustis_2013_q3.nylustis_details WHERE siteid = 'NYLUSTIS-155718' LIMIT 50
From this code:
Adapter.SelectCommand = New NpgsqlCommand(SQL, MLConnect)
Adapter.Fill(subDT) ' This line throws error
The meetsstd field is a varchar(3) and it does store either a 'Yes' or a 'No' value. How is this getting this confused with a boolean - a varchar should not care whether is holds 'Yes', or 'Si', or 'Oui'? And it only happens on 27 records out of the 28,000 in the table.
I usually blame npgsql for this kind of strangeness, but the last entry in the stack trace is: System.Data.DataColumn.set_Item(Int32 record, Object value)
Any clues?
Thanks!
Brad
To check if it is problem with database or with driver you can reduce problem to one row and column using your current environment:
SELECT meetsstd FROM work_nylustis_2013_q3.nylustis_details WHERE sitenum=1
(of course you must change sitenum into primary key)
Then try such query using psql, pgAdmin or some JDBC/ODBC based general editor.
If psql shows such record which raises error with your Npgsql based application then problem is with Npgsql driver or problem is with displaying query results.
If other tools shows such strange errors then problem is with your data.
Have you changed type of meetsstd field? Mayby you try to show it on some grid and this grid used Boolean field which was converted to Yes/No for displaying?

iReport: # sql variable is not recognized

I am using Sybase 15 and have a SP which returns a result set like this:
SELECT foo,
bar,
etc,
xyz,
...
#temp_id
FROM #table
ORDER BY 2,3 DESC
When this gets to iReport the query shows the field name is blank. It knows that the field type is java.lang.Integer but I can see no way to create a field for it in the report. If I give it a name - #temp_id I get an error telling me the field isn't found. Same thing if I try it in JasperReports.
The strange thing - to me anyway - is that in my Eclipse data explorer it also shows no label for that column. Nor does it for the JasperReports Dataset and Query Dialog when I ask it to Read Fields.
I tried just calling it COLUMN_15 but that didn't work either.
What am I missing?

" rake aborted! unknown attribute: date " while running rake db:seed

rake aborted!
unknown attribute: date
I am finally able to migrate my database content but encounter this unfortunate error.
Is it because the date attributes are older than the actual new database or something? Date is not specifically defined in my model but obviously the data was in the old database before and def not manually entered. I think t.timestamp takes care of that initialization, so i guess the question is why I cannot seed into my database? Any ideas
My seed file looks something like this:
Indication.create([
{ :name => "general", :date => "2012-11-09 17:36:25" },
Looks like your Indication model does not have a date field. Do you need to create a migration to add one?
So just in case someone encounters the same problem, here is my solution:
My seed:dump had extracted the data in this case "2012-11-09 17:36:25" and assigned it the variable "date". While I am still not sure why this happened it has to do with the t.timestamp command.
t.timestamp creates 2 variables:
created_at
updated_at
The side file had the 2012-11-09 17:36:25 as "date" variable, which is a reasonable guess based on the format, but nevertheless it is wrong for the Rails application standard. My tables had only two variables that were datetime format which are the ones I named above.
I opened the seeds file and replaced all the ":date" for ":created_at" and it solved the problem. updated_at then acquired the value automatically (updated at was not transferred from my old database to this new one).
The created_as data did transfer and was correct. updated_at acquired the same value in all the data (I noticed it was the date and time and performed the rake db:seed:load command.

How to use constant var in SSIS

I have defined a variable as:
DateSecondsOffset Int default as 1
in a SQL Server Integration Service project. I use it as constant.
In a task, I have the following SQL to set another var NextDT:
SELECT dateadd(s, max(timestamp), 1) DT from myTable
I would like to replace the 1 with DateSecondOffset so that I can change it when needed. Can I just type in the var name there or prefix it with # or something else?
You have to pass package variable as a parameter for SQL task.
You can define do it
- in "Execute SQL Task Editor"->"Parameter Mapping" section
- or in ReadOnlyVariables options (ReadWriteVariables options if you want to be able to change variable value during the task) in the "Script Task Editor" window
Then declare variable inside sql query and init it with first parameter:
DECLARE #DateSecondsOffset INT
SET #DateSecondsOffset = ?
SELECT dateadd(s, max(timestamp), #DateSecondsOffset ) DT from myTable
See Patrick Index: Passing Variables to and from an SSIS task
If you're in a Script..
Dts.Variables("DateSecondOffset").Value
If you're referring to it in a field..
Scope::DateSecondOffset
Replace Scope with your scope which can be found in the "package explorer" tab under variables.
If you're referring to it in a SQL...
SELECT #DateSecondOffset
Be sure to setup your input/output parameters in a SQL Task and ReadOnly/ReadWrite Variables on a script task.
The syntax for referencing a parameter in an Execute SQL task depends on the type of connection you're using.
For example ADO.NET connections you use #ParameterName. For OleDB connections you use ?.
Full details can be found here
http://msdn.microsoft.com/en-us/library/cc280502.aspx