...
I have a .csv file created by a script with data in a tabular format.
I need to insert all the value into mysql database which is running in a different machine.
what is the command to export the .csv file into database using shell script.
...
If you have MySQL client installed in your machine, then you could use a nifty little tool called mysqlimport to import your csv file into a MySQL table.
Could any one help me in basic shell script to export text file data to csv.
I need to export only particular data from text file to csv column.
I am a newbie to UNIX could anyone help me with sample script code (3 Replies)
I have written a k shell program which is executing a sql and exporting data in numeric form like 0412323444 into .csv file. the problem i am facing is that , the data is coming in excel formatted in scientific form like 4.1+E08,while my requirement is to store data as such 0412323444 in excel ( no... (5 Replies)
Hi All,
Am porting my application from AIX to Windows. As a part of this I need to port the Database in IBM DB2 UDB to SQL Server 2005. Is there any Guide/Doc/Article available on this? How to convert the stored procedures and physical data from DB2 to SQL Server 2005?
Thanks in Advance (0 Replies)
Hi,
I know in oracle a .sql file is called by @ <path> /<filename>.
But how to call in sql 2005, I am opening the sql sessionwith sqsh, is there any command to execute there a .sql file (query in sql 2005) in K shell script. (0 Replies)
Friends...This is the first time i am trying the report generation using shell script... any suggestions are welcome.
Is there a way to set the font size & color when i am exporting the data from unix shell script as a CSV file ?
The following sample data is saved as a .csv file in the... (2 Replies)
Hello everyone I'm new here and this is my first post so first of all I want to say that this is a great forum and I have managed to found most of my answers in these forums : )
So with that I ask you my first question:
I have an excel file which I saved as a csv. However the excel file... (3 Replies)
Hello All
I am getting a problem.What i want to do is to connect unix(korn shell) and sql server 2005. But it is not happening.
The task is to schedule a job using crown or something else that connect with sql server 2005 and run the query and save the result in a text file. (5 Replies)
I have created 2 .csv files in my home directory in unix and trying to export them to my machine. Can anyone tell me the script to export those? 1 file name is columns.csv (9 Replies)
Discussion started by: tinamiller
9 Replies
LEARN ABOUT XFREE86
insq
insq(9F) Kernel Functions for Drivers insq(9F)NAME
insq - insert a message into a queue
SYNOPSIS
#include <sys/stream.h>
int insq(queue_t *q, mblk_t *emp, mblk_t *nmp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Pointer to the queue containing message emp.
emp Enqueued message before which the new message is to be inserted. mblk_t is an instance of the msgb(9S) structure.
nmp Message to be inserted.
DESCRIPTION
insq() inserts a message into a queue. The message to be inserted, nmp, is placed in q immediately before the message emp. If emp is NULL,
the new message is placed at the end of the queue. The queue class of the new message is ignored. All flow control parameters are updated.
The service procedure is enabled unless QNOENB is set.
RETURN VALUES
insq() returns 1 on success, and 0 on failure.
CONTEXT
insq() can be called from user or interrupt context.
EXAMPLES
This routine illustrates the steps a transport provider may take to place expedited data ahead of normal data on a queue (assume all M_DATA
messages are converted into M_PROTO T_DATA_REQ messages). Normal T_DATA_REQ messages are just placed on the end of the queue (line 16).
However, expedited T_EXDATA_REQ messages are inserted before any normal messages already on the queue (line 25). If there are no normal
messages on the queue, bp will be NULL and we fall out of the for loop (line 21). insq acts like putq(9F) in this case.
1 #include
2 #include
3
4 static int
5 xxxwput(queue_t *q, mblk_t *mp)
6 {
7 union T_primitives *tp;
8 mblk_t *bp;
9 union T_primitives *ntp;
10
11 switch (mp->b_datap->db_type) {
12 case M_PROTO:
13 tp = (union T_primitives *)mp->b_rptr;
14 switch (tp->type) {
15 case T_DATA_REQ:
16 putq(q, mp);
17 break;
18
19 case T_EXDATA_REQ:
20 /* Insert code here to protect queue and message block */
21 for (bp = q->q_first; bp; bp = bp->b_next) {
22 if (bp->b_datap->db_type == M_PROTO) {
23 ntp = (union T_primitives *)bp->b_rptr;
24 if (ntp->type != T_EXDATA_REQ)
25 break;
26 }
27 }
28 (void)insq(q, bp, mp);
29 /* End of region that must be protected */
30 break;
. . .
31 }
32 }
33 }
When using insq(), you must ensure that the queue and the message block is not modified by another thread at the same time. You can achieve
this either by using STREAMS functions or by implementing your own locking.
SEE ALSO putq(9F), rmvq(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
WARNINGS
If emp is non-NULL, it must point to a message on q or a system panic could result.
SunOS 5.10 9 Jul 2001 insq(9F)