SS truncates data from DB
I'm using Appleworks 6 to figure taxes. Have inputted the info on my DB, and now I'm trying to convert it to a SS, as I've always done. My tax DB has 47 fields and 1014 records. When I try to paste the figures into a SS, it truncates the data and does not create as many fields and records as I need. Can I expand the amount of fields and records beyond the template of the SS? Thanks...
Tom Fuller in Texas
<Edited by Moderator>
Can I expand the amount of fields and records beyond the template of the SS?
Sure. Open a new spreadsheet window. From the Format menu, choose "Document". In the resulting dialog, enter the number of rows that equal or exceed the number of records in your database. Adjust the number of columns to equal or exceed the number of fields in your database.
Close the dialog and drag the icon of your database file into the open spreadsheet window to populate it with your data.
Similar Messages
-
Recovering Data from a truncated table in OraXE?
A funny thing happened, i truncated a table containing BLOBs and other stuff, with over 700 entries!!, now i wanna know if it´s feasible to recover that truncated data, i'm just wondering about it, i know it sounds silly i know, but the storage space didn´t get shorter after the data was truncated from the table, so after this´s been said, can any body explain me what happened, can i retrieved this truncated data that i truncated from the table (without any previous backup)?
Message was edited by:
efebo_abel2002
Message was edited by:
efebo_abel2002
Mensaje editado por:
efebo_abel2002Truncate simply resets the pointer that marks the 'end of data' in a table to the beginning of the table. The storage is still allocated, on the assumption that you want to reuse the table and want to avoid the overhead associated with extending the table. The system knows there are never any rows past the 'end of data' and it won;t bother looking past that point.
Recovering that data from the actual current database - about as likely as recovering data from the Windows recycle bin when you've set the max allowable storage in the recycle bin to '0'. Technically possible, but needing someone with a lot of experience and patience ... and absolutely no changes to the database after truncate. An expensive proposition.
You have, of course, switched to archive log mode and been taking regular backups. (Have you not?) In which case, a 'point in time' recover, to just before the truncate, would be the solution. This brings back the database (or at least a tablespace) back to a former 'life', and is quite different from restoring a table. -
JCo getting truncated value from SAP when field data type is RAW
We are trying to fetch data from a SAP-AII table by using JCo using the RFC RFC_READ_TABLE.
We are getting incomplete data when the data type of the column is RAW in a particular table.A typical case is:
Table Name: /AIN/DM_DEVCTR
Field : CLIENT Type: CLNT Length:3 Value: 100 (SAP Generated)
Field: DEVCTR_GUID Type:RAW Length:16 Value: 306F50F53805ED488DE9797AC86B5728 (SAP Generated)
Filed: DEVCTR_ID Type:CHAR Length:128 Value: KDEVICECONTROLLER (User input)
For the fields CLIENT and DEVCTR_ID we get the entire value (including blank spaces) but for DEVCTR_GUID we get only 16 characters whereas SAP-AII stores a value that is 32 characters in length. How do we fetch the actual value instead of the truncated value?
Sample code is attached.
try {
mConnection = JCO.createClient("100", // SAP client
"User", // userid
"Password", // password
"EN", // language
"SAP", // host name
"00"); // system number
mConnection.connect();
if (mConnection == null) {
System.out.println("Connection to SAP Server failed.");
mRepository = new JCO.Repository("User", mConnection);
ftemplate = mRepository.getFunctionTemplate("RFC_READ_TABLE");
} catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
JCO.Function function = ftemplate.getFunction();
JCO.ParameterList importParamList = function.getImportParameterList();
importParamList.setValue("/AIN/DM_DEVCTR", "QUERY_TABLE");
importParamList.setValue(";", "DELIMITER");
JCO.Table tableData = function.getTableParameterList().getTable("DATA");
JCO.Table fields = function.getTableParameterList().getTable("FIELDS");
mConnection.execute(function);
if (tableData.getNumRows() > 0) {
do {
for (JCO.FieldIterator e = tableData.fields(); e
.hasMoreElements();) {
JCO.Field field = e.nextField();
String str = field.getString();
String[] values = str.split(";");
for(int i = 0; i < values.length; i++){
System.out.println(values<i>);
} while (tableData.nextRow());
} else {
System.out.println("No results found");
mConnection.disconnect();Hi Kaanu,
You have to modify your java code.
String val = new String( field.getByteArray());
PS: Please reward points for helpful answer or problem resolved. -
DB:10.2.0.4
can any one help me to know how to insert the data from excel to a table?
Regards,
BKhi
have a look at how i performed it
DECLARE
l_start_file_name varchar2(50) := 'invoice_excel_c';
l_end_file_name varchar2(50) := '.csv';
l_file_name varchar2(100);
l_sql varchar(32767);
refresh_cdc varchar2(5) := '00304';
begin
l_file_name := l_start_file_name||REFRESH_CDC||l_end_file_name;
l_sql :=
'create table exter_invoice_excel '||
'( '||
'Product_name varchar2(255), '||
'Net_Sales Number, '||
'Net_Adjustments Number, '||
'Cancels_Count Number, '||
'Cancels_Amount Number, '||
'Cashes_Count Number, '||
'Cashes_Amount Number, '||
'Claims_Count Number, '||
'Claims_Amount Number, '||
'Returns_Count Number, '||
'Returns_Amount Number, '||
'Free_Prize_Count Number, '||
'Free_Prize_Amount Number, '||
'Free_Promo_Count Number, '||
'Free_Promo_Amount Number, '||
'Promo_Credit_Count Number, '||
'Promo_Credit_Amount Number, '||
'Return_Commission Number, '||
'Net_Discounts Number, '||
'Total_Fees Number, '||
'Sales_Commission Number, '||
'Cash_Commission Number, '||
'Tkt_Charge Number, '||
'Subscription_Commission Number, '||
'Interim_Sweeps Number, '||
'Net_Due Number, '||
'Retailer_id Number, '||
'Retailer_Name varchar2(255) '||
') '||
'ORGANIZATION EXTERNAL ( '||
' TYPE oracle_loader '||
' DEFAULT DIRECTORY GTECHFILES '||
' ACCESS PARAMETERS ( '||
' RECORDS DELIMITED BY NEWLINE '||
' CHARACTERSET WE8MSWIN1252 '||
' BADFILE ''invoice_excel.bad'' '||
' DISCARDFILE ''invoice_excel.dis'' '||
' LOGFILE ''invoice_excel.log'' '||
' FIELDS TERMINATED BY '','' RTRIM '||
' MISSING FIELD VALUES ARE NULL '||
' ) '||
' LOCATION ('''||l_file_name||''') '||
' ) '||
'PARALLEL '||
'REJECT LIMIT UNLIMITED ';
execute immediate l_sql;
l_sql:= 'INSERT INTO INVOICE_EXCEL_TEMP '||
' ( Product_name , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' SOURCE , '||
' INSERTED_DATE , '||
' CDC , '||
' UPLOADED '||
') '||
' select '||
' ltrim(rtrim(product_name)) , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' '''||l_file_name ||''', '||
' sysdate , '||
' '''|| REFRESH_CDC ||''', '||
'''N''' ||
'FROM '||
'exter_invoice_excel '||
'WHERE retailer_id is not null and ltrim(rtrim(product_name)) in (''Loto'',''Inst Tk'')';
execute immediate l_sql;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
exception
when others then
rollback;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
debug_message('INVOICE_EXCEL_UPLOAD/'||REFRESH_CDC,'Unexpected Error '||sqlerrm);
END;
--truncate table invoice_excel_temphope this helps -
Delete file data from Application Server
Hello,
How do we delete data from the file on application Server.
For deleting the file, we use DELETE DATASET <filename>.
If we want to delete only the data and not the file, how to address it?
Please let me know.Hi , please check the following links, maybe using the truncate dataset can be helpful.
http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/d5/c3f58e9f3b11d2960000a0c9308b1f/frameset.htm
Another way could be get the file name and store in a var , then delete the file and afterwards
create a new one with the same name as stored in the var.
Thanks,
Walter Oliveira. -
Copy data from one Table to another Table
How can I copy data from one Oracle Table to another Oracle Table on a different server? Question 2: How can I clear all of the data in one Table with a single SQL script?
Thanks...Question 1:
I assume you have the privileges. If you don't, ask the DBA to give them to you. Then
1. Login to database_source (It could be either the source or the target. Let's assume it's the source.)
2. Create a database link to database_target: CREATE DATABASE LINK link_to_database_target CONNECT TO myuserid IDENTIFIED BY mypassword USING 'database_target'; Note the single quotes.
3. Copy the table data: INSERT INTO targetowner.mytable@link_to_database_target SELECT * FROM sourceowner.mytable; COMMIT;
Question 2:
You have two options, but you may not have privileges for both.
Option 1:
DELETE FROM tableowner.tablename; COMMIT;
Advantage: Since this is a DML (Data Manipulation Language) statement, you have to commit the transaction. Also, the data will be gone but the table size is NOT changed, so it's ready for accepting replacement data. DML statements can simply be executed not only from SQL scripts, but from PL/SQL scripts as well.
Disadvantage: Slow, because all record deletion is logged, so you can recover from it by issuing a ROLLBACK; instead of the COMMIT; above. The table size is NOT changed, so if you are short of disk space or tablespace space, you have not resolved the issue.
Option 2:
TRUNCATE TABLE tableowner.tablename;
Advantage: Since this is a DDL (Data Definition Language) command, you do NOT have to commit the transaction. (DDL commands automatically commit both before and after their execution.) The table size will be changed back to the initial extent size which is the minimum size a table can have and can only be set when the table is created. If it needs to be changed, the table has to be dropped and recreated with a different initial extent size. The statement execution of this command is not logged, therefore it's much faster then the DELETE.
Disadvantage: No rollback. Being a DDL, this command cannot be executed straight from PL/SQL. If you need to issue this within PL/SQL, you will have to use dynamic SQL. -
Hi,
I have a situation where i have to load data from one server/database table to multiple servers/databases.
Example:
I need to load data from dbo.TABLE_A (on Server: Server_A & Database: Database_A) to the same table on the list of server databases like
Server: Server_B , Database: Database_B
Server: Server_C , Database: Database_C
Server: Server_D , Database: Database_D
Server: Server_E , Database: Database_E
Server: Server_F , Database: Database_F
Server: Server_G , Database: Database_G
Server: Server_H , Database: Database_H
so on and so forth on 250 such server database combinations.
The table structure is the same on all the servers.
If i make the source or destination dynamic, it throws an error while mapping ?
I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
Please suggest on how to load data from one source to multiple server/databases.
Thank you.I just need to transfer one table's data. its like i have to use a query to pick data for
the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
to append the new records. -
Deleting data from a partition in a table
There is a requirement to delete data from a particular partition in our PROD Env.
Please let me know the syntax for the same.
Also is it possible to truncate a partition?
The DB version is 10.2.0.4 and OS is Solaris 10
Regards,
Narayan
Edited by: user7202581 on Apr 14, 2013 12:11 AMHi, You can use the following Syntex.
-- For Truncate
ALTER TABLE <table_name> TRUNCATE PARTITION <Partition_name>;
-- For Delete
DELETE FROM <table_name> PARTITION <partition_name>; -
Error while exporting data from sql server to excel
Hi,
I am trying to export data from sql server to excel.
The query that I used is s follows
INSERT INTO OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Folder1\abc.xls','select * from [Sheet1$A1:IV65000]')
select
column1,column2.... from Table1
I get the following error message while doing so..
String or binary data would be truncated.
The statement has been terminated.
One of the column's holds data more than 225 characters.
What is the way to correct this, i want the whole data of the colum in the excel sheet.I haven't had great luck with the INSERT INTO OPENROWSET method. Can you try one of the many samples from one of these 3 links?
http://www.excel-sql-server.com/excel-sql-server-import-export-using-vba.htm#Excel%20Data%20Export%20to%20SQL%20Server%20Test%20Code
http://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/
https://www.simple-talk.com/sql/database-administration/getting-data-between-excel-and-sql-server-using-odbc--/
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
Need to delete specific Months Data from SQL Server Table
Greetings Everyone,
So i have one table which contains 5 years old data, now business wants to keep just one year old data and data from qurter months i.e. (jan, mar, June, sep and December), i need to do this in stored procedure. how i can achive this using month lookup table.
Thank you in advance
RHi Devin,
In a production environment, you should be double cautious about the data. I have no idea why you’re about to remove the data just years old. In one of the applications I used to support, the data retention policy is like to keep raw data for latest month
and the elder data would get rollup as max, min, average and so on to store in another table. That’s a good example for data retention.
In your case I still suggest you keep the elder data in another table. If the data size is so huge that violates your storage threshold, get the data rollup and store the aggregated would be a good option.
Anyway if you don’t care about the elder data, you can just delete them with code like below.
DELETE
FROM yourTable
WHERE YEAR(dateColumn) < YEAR(CURRENT_TIMESTAMP) OR (MONTH(dateColumn) not in (1,3,6,9,12) AND YEAR(dateColumn) = YEAR(CURRENT_TIMESTAMP))
In some cases to remove data from very large table, DELETE performs bad. TRUNCATE would be a better option which works faster. Read more by clicking
here. In your case, if necessary, you can reference the below draft code.
SELECT * INTO tableTemp FROM yourTable WHERE YEAR(dateColumn) = YEAR(CURRENT_TIMESTAMP) AND MONTH(dateColumn) IN(1,3,6,9,12)
TRUNCATE yourTable;
INSERT INTO yourTable SELECT * FROM tableTemp
As you mentioned, you need to do the deletion in Stored Procedure(SP). Can you post your table DDL with sample data and specify your requirement details so that I can help to compose your SP.
If you have any question, feel free to let me know.
Best regards,
Eric Zhang -
When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI( I am not getting any error message in E$_TARGET_ANI_TEST).
When i am running the interface i am getting the below error against the errored step
"ORA-01045: user ABC lacks CREATE SESSION privilege; logon denied."
Only E$_TARGET_ANI_TEST is created with no data. No such tables like C$_0TARGET_ANI_TEST, I$_TARGET_ANI_TEST are created and also data is not inserted in the target table TARGET_ANI_TEST.Hi,
I have checked that only E$ table is created. C$ and I$ table are not created ( I have selected my target schema as the part for the staging table).
All the parameters for dropping the tables are selected as "<default>:false".
I am importing the following KMs with the following parameters:
1) CKM Oracle
DROP_ERROR_TABLE
:false
DROP_CHECK_TABLE
:false
CREATE_ERROR_INDEX
:true
COMPATIBLE
:9
VALIDATE
:false
ENABLE_EDITION_SUPPORT
:false
UPGRADE_ERROR_TABLE
:false
2) LKM SQL to SQL
DELETE_TEMPORARY_OBJECTS
:true
3) IKM SQL Incremental Update
INSERT
:true
UPDATE
:true
COMMIT
:true
SYNC_JRN_DELETE
:true
FLOW_CONTROL
:true
RECYCLE_ERRORS
:false
STATIC_CONTROL
:false
TRUNCATE
:false
DELETE_ALL
:false
CREATE_TARG_TABLE
:false
DELETE_TEMPORARY_OBJECTS
:true -
How can you add data from a variable into a column in a data flow?
I need to populate a table with data from a variable. The data type of the variable is String. I'm running into issues doing it the way I am. I have variable
User:VariableName = "Some moderately sized string of data"
When I try to use a Derived Column Transformation Editor to insert the variable into the data flow as a new column, SSIS forces the Data Type to be Unicode String[DT_WSTR] and I can't change it. Additionally the length is 0 and I also can't change that.
When I run the package it errors with a truncation error. If the length is 0 then that makes sense but then why can't I change it to something that makes more sense?
What is the correct way to go about this?Use advanced editor to change data type and length.
http://www.sureshjoshi.com/development/ssis-string-variables-in-derived-columns/ -
Truncating data in prepared statement
I'm using a prepared statement to pull data out of one SQL database into a recordSet, and another prepared statement to take the data from the recordSet and insert the data into another SQL database. In the source database, the lastname and firstname fields are both defined as char(25) and the phone field is defined as char(24). In the receiving database, the lastname and firstname fields are each defined as nvarchar(100) and the phone field is defined as nvarchar(50).
The program will only run successfully if I trim the data in each field to the first 16 characters. Any time it hits a field with more than 16 characters, it throws a SQL Error: String data, right truncation.
The setObject statements are:
update.setObject(1,lastname,java.sql.Types.VARCHAR);
update.setObject(2,firstname,java.sql.Types.VARCHAR);
update.setObject(3,phone1,java.sql.Types.VARCHAR);
int rowCount = update.executeUpdate();
Why can't I push the entire 25-character name fields into the 100-character name fields? And the 24-character phone field into the 50-character phone field?mrw127 wrote:
sun.jdbc.odbc.JdbcOdbcDriver
I don't know how to tell which version it is.
It would revert to the ODBC driver version then rather than anything in java.
I spent a couple hours trying to use com.microsoft.sqlserver.jdbc.SQLServerDriver that I downloaded on Monday but could not get it to work. I even put both .jars in the c:\temp dir, updated my classpath, even rebooted after making the changes, but it could not find the driver. Reverted back to the JdbcOdbcDriver.The current MS driver seems to work adequately and so does the jTDS driver from soucreforge. I would suspect both would support nvarchar correctly. -
Import data from text file to a table using t-sql
Hi,
I am trying to import data from a text file to a table using the below query but it is returning an error.
SELECT *, 2 FROM OPENROWSET(BULK 'W:\file.txt',
FORMATFILE = 'W:\format_file.xml', FIRSTROW = 1, LASTROW = 1) as f
The error is:
Bulk load data conversion error (truncation) for row 1, column 1 (COPYRIGHT_DETAIL_CODE).<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="3" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="4" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="5" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="6" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="7" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="8" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="9" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="10" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="11" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="12" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="13" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="14" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="2" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="15" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="3" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="16" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="4" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
<FIELD ID="17" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="43" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="Name1" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="2" NAME="Name2" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="3" NAME="Name3" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="4" NAME="Name4" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="5" NAME="Name5" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="6" NAME="Name6" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="7" NAME="Name7" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="8" NAME="Name8" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="9" NAME="Name9" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="10" NAME="Name10" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="11" NAME="Name11" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="12" NAME="Name12" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="13" NAME="Name13" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="14" NAME="Name14" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="15" NAME="Name15" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="16" NAME="Name16" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="17" NAME="Name17" xsi:type="SQLVARYCHAR"/>
</ROW>
</BCPFORMAT>
The format file that I am using is just like the same one above.
-
VISA Read gets incorrect data from serial connection
I am having difficulty using the VISA functions in LabVIEW to read data from a virtual COM port. Data is being sent from a serial to USB chip via a USB connection using OpenSDA drivers. I have a python program written to read from this chip as well, and it never has an issue. However, when trying to achieve the same read in LabVIEW I am running into the problem of getting incorrect data in the read buffer using the VISA Read function.
I have a VISA Configure Serial Port function set up with a control to select the COM port that the device is plugged into. Baud rate is default at 9600. Termination char of my data is a newline, which is also default. Enable termination char is set to true. A VISA Open function follows this configuration, and then feeds the VISA Resource Name Out into a while loop where a VISA Read function displays the data in read buffer. Byte count for the VISA Read is set to 20 so I can read more of the erroneous datat, however actual data will only be 6-12 bytes. The while loop has a wait function, and no matter how much I slow down the readings I still get incorrect data (I have tried 20ms thru 1000ms).
The data I expect to receive in the read buffer from VISA Read is in the form of "0-255,0-255,0-255\n", like the following:
51,93,31\n
or
51,193,128\n
And occasionally I receive this data correctly, however I intermittently (sometimes every couple reads, sometimes a couple times in a row) get incorrect readings like this:
51,1\n
51,193739\n
\n
51,1933,191\n
51,,193,196\n
51,1933,252
51,203,116203,186\n
Where it seems like the read data is truncated, missing characters, or has additional characters. Looking at these values, however, it seems like the read was done incorrectly because the bytes seem partially correct (51 is the first number even in incorrect reads).
I have search but haven't found a similar issue and I am not sure what to try from here on. Any help is appreciated. Thanks!
Attachments:
Serial_Read_debugging.vi 13 KBThe first thing is that none of the error clusters are connected so you could be getting errors that you are not seeing. Are you sure about the comm parameters? Finally, I have never had a lot of luck looking for termination characters. You might want to just capture data and append each read into one long string just to see if you are still seeing this strangeness.
What sort of device is returning the data? How often does it spit out the data? How much distance is there between it and your computer? Can you configure it append something like a checksum or crc to the data?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Maybe you are looking for
-
Flash Player 9 video yes audio no
My Flash Player 9 worked well before, now I don't have audio when playing i.e. YouTube, etc. Did reinstall and all the same again. No audio. All other stuff WMP11, Real Player, Quick Time are working fine video and audio. Anyone knows what could it b
-
Datasource or Datasource 3.x
We are starting out on a new BW project. We have BW 7.0 installed and R/3 4.7 although we are going to upgrade shortly to NW2005. I want to turn on BC and have a play with that. So I have linked to a source system in our development environment. I've
-
HT201304 how do you reset a forgotten restrictions passcode?
how do you reset a forgotten restrictions password?
-
Can Communication User Id change its password
Hello Experts, Can Communication User Id change its own password and can the password be deactivated automatically even after when its used? Regards, Sums
-
Is there any BADI or any other alternate in ECC for the Field exits
Hi guys, Is there any BADI or any other alternate in ECC for the Field exits: FIELD_EXIT_BP_VERS_Z FIELD_EXIT_BP_VERSION