您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sqlTableExists函数代码示例

51自学网 2021-06-03 08:12:38
  C++
这篇教程C++ sqlTableExists函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sqlTableExists函数的典型用法代码示例。如果您正苦于以下问题:C++ sqlTableExists函数的具体用法?C++ sqlTableExists怎么用?C++ sqlTableExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sqlTableExists函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: newHash

struct hash *getAncientRepeats(struct sqlConnection *tConn,			       struct sqlConnection *qConn)/* Get hash of ancient repeats.  This keyed by name.family.class. */{struct sqlConnection *conn = NULL;struct sqlResult *sr;char **row;char key[512];struct hash *hash = newHash(10);if (sqlTableExists(tConn, "ancientRepeat"))    conn = tConn;else if (sqlTableExists(qConn, "ancientRepeat"))    conn = qConn;else    errAbort("Can't find ancientRepeat table in %s or %s",	     sqlGetDatabase(tConn), sqlGetDatabase(qConn));sr = sqlGetResult(conn, "NOSQLINJ select name,family,class from ancientRepeat");while ((row = sqlNextRow(sr)) != NULL)    {    sprintf(key, "%s.%s.%s", row[0], row[1], row[2]);    hashAdd(hash, key, NULL);    }sqlFreeResult(&sr);return hash;}
开发者ID:blumroy,项目名称:kentUtils,代码行数:26,


示例2: checkInitialLoad

void checkInitialLoad(struct sqlConnection *conn)/* verify that certain table don't exist whne initialLoad is specified */{static char *checkTbls[] = {    "gbSeq", "gbExtFile", "gbStatus", NULL};int i;int existCnt = 0;for (i = 0; checkTbls[i] != NULL; i++)    {    if (sqlTableExists(conn, checkTbls[i]))        existCnt++;    }if (existCnt > 0)    {    fprintf(stderr, "Error: table already exist:");    for (i = 0; checkTbls[i] != NULL; i++)        {        if (sqlTableExists(conn, checkTbls[i]))            fprintf(stderr, " %s", checkTbls[i]);        }    fprintf(stderr, "/n");    errAbort("drop tables with -drop or don't specify -initialLoad");    }}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:28,


示例3: ctdExists

static boolean ctdExists(struct section *section, 	struct sqlConnection *conn, char *geneId)/* Return TRUE if CTD database exists and it has an entry with the gene symbol */{char query[1024];char *geneSymbol;if (isRgdGene(conn))    {    if (sqlTableExists(conn, "rgdGene2Xref") == FALSE) return FALSE;    }else    {    if (sqlTableExists(conn, "kgXref") == FALSE) return FALSE;    }if (sqlTableExists(conn, "hgFixed.ctdSorted") == TRUE)    {    if (isRgdGene(conn))	{	sqlSafef(query, sizeof(query), "select ChemicalId from rgdGene2Xref x, hgFixed.ctdSorted c"	" where x.info=c.GeneSymbol and infoType = 'Name' and rgdGeneId='%s' limit 1", geneId);	geneSymbol = sqlQuickString(conn, query);	}    else        {	sqlSafef(query, sizeof(query), "select ChemicalId from kgXref x, hgFixed.ctdSorted c"	" where x.geneSymbol=c.GeneSymbol and kgId='%s' limit 1", geneId);	geneSymbol = sqlQuickString(conn, query);	}    if (geneSymbol != NULL) return(TRUE);    }return(FALSE);}
开发者ID:bowhan,项目名称:kent,代码行数:34,


示例4: prOrfeomeCloneLinks

static void prOrfeomeCloneLinks(struct sqlConnection *conn, char *acc, struct cloneInfo *ci)/* print table of clone links */{webPrintLinkTableStart();webPrintLabelCell("Links");webPrintLinkTableNewRow();if (ci->gi > 0)    prOrderLink("ORFeome", ci);#if 0// link to ORFeome database// FIXME: this doesn't appear to work, need to ask Christa// http://www.orfeomecollaboration.org/bin/cloneStatus.pl#endifif (ci->imageId > 0)    prImageLink(ci);prGenbankLink(ci);if (ci->refSeqAccv != NULL)    prRefSeqLinks(ci);if (sqlTableExists(conn, "ccdsGene"))    prCcdsLinks(conn, ci);if (sqlTableExists(conn, "knownGene"))    prUcscGenesLinks(conn, ci);webPrintLinkTableEnd();}
开发者ID:bowhan,项目名称:kent,代码行数:27,


示例5: hgsqlSwapTables

void hgsqlSwapTables(char *database, char *table1, char *table2, char *table3)/* hgsqlSwapTables - swaps tables in database. */{    struct sqlConnection *conn = hAllocConn(database);    boolean noTable2 = FALSE;    if (!sqlTableExists(conn, table1))        errAbort("%s does not exist",table1);    if (!sqlTableExists(conn, table2))    {        if (okNoTable2)            noTable2 = TRUE;        else            errAbort("%s does not exist", table2);    }    if (sqlTableExists(conn, table3))    {        if (dropTable3)            sqlDropTable(conn, table3);        else            errAbort("%s exists", table3);    }    if (!noTable2)        sqlRenameTable(conn, table2, table3);    sqlRenameTable(conn, table1, table2);}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:30,


示例6: doReMapAli

static void doReMapAli(struct sqlConnection *conn,     int taxon, char *db,     int fromTaxon, char *fromDb,    char *track, char *fasta    )/* re-map anything in track specified that is not aligned,       nor even attempted yet, using specified fasta file. */{char cmd[256];int rc = 0;struct dyString *dy = dyStringNew(0);char dbTrk[256];safef(dbTrk,sizeof(dbTrk),"%s.%s",db,track);if (!sqlTableExists(conn, dbTrk))    errAbort("Track %s does not exist/n",dbTrk);if (!fileExists(fasta))    errAbort("Unable to locate fasta file %s",fasta);if (sqlTableExists(conn, "vgRemapTemp"))    {    sqlUpdate(conn, "drop table vgRemapTemp;");    }safef(cmd,sizeof(cmd),"hgPepPred %s generic vgRemapTemp %s ",database,fasta);verbose(1,"%s/n",cmd); system(cmd);/* required for mysql 5 longtext for case-insensitive comparisons of blobs */sqlUpdate(conn, "ALTER table vgRemapTemp modify seq longtext;");sqlUpdate(conn, "create index seq on vgRemapTemp(seq(40));");/* get remapped psl probes not yet aligned */dyStringClear(dy);dyStringPrintf(dy,     "select m.matches,m.misMatches,m.repMatches,m.nCount,m.qNumInsert,m.qBaseInsert,"    "m.tNumInsert,m.tBaseInsert,m.strand,"    "concat('vgPrb_',e.id),m.qSize,m.qStart,m.qEnd,m.tName,m.tSize,m.tStart,m.tEnd,m.blockCount,"    "m.blockSizes,m.qStarts,m.tStarts"        " from vgPrb e, vgPrbAliAll a, %s.%s m, vgRemapTemp n"    " where e.id = a.vgPrb and a.db = '%s' and a.status='new'"    " and m.qName = n.name and n.seq = e.seq"    " and e.taxon = %d and e.state='seq' and e.seq <> ''"    " order by m.tName,m.tStart"    ,db,track,db,fromTaxon);rc = 0;rc = sqlSaveQuery(conn, dy->string, "vgPrbReMap.psl", FALSE);verbose(1,"Count of Psls found for reMap: %d/n", rc);sqlUpdate(conn, "drop table vgRemapTemp;");dyStringFree(&dy);}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:58,


示例7: reactomeCount

static int reactomeCount(struct pathwayLink *pl, struct sqlConnection *conn, 	char *geneId)/* Count up number of hits. */{int ret = 0;char query[256];char *spID, *chp;char condStr[256];char *origSpID;/* check the existence of kgXref table first */if (!isRgdGene(conn))    {    if (!sqlTableExists(conn, "kgXref")) return(0);    }else    {    if (!sqlTableExists(conn, "rgdGene2Xref")) return(0);    }if (isRgdGene(conn))    {    sqlSafefFrag(condStr, sizeof(condStr), "name='%s'", geneId);    spID = sqlGetField(database, "rgdGene2ToUniProt", "value", condStr);    }else    {    sqlSafefFrag(condStr, sizeof(condStr), "kgID='%s'", geneId);    spID = sqlGetField(database, "kgXref", "spID", condStr);    }if (spID != NULL)    {    origSpID = cloneString(spID);    /* convert splice variant UniProt ID to its main root ID */    chp = strstr(spID, "-");    if (chp != NULL) *chp = '/0';    if (!isRgdGene(conn))        {        sqlSafef(query, sizeof(query), 	  "select count(*) from %s.spReactomeEvent, %s.spVariant, %s.kgXref where kgID='%s' and kgXref.spID=variant and variant = '%s' and spReactomeEvent.spID=parent", 	  PROTEOME_DB_NAME, PROTEOME_DB_NAME, database, geneId, origSpID);	}    else    	{        sqlSafef(query, sizeof(query), 	  "select count(*) from %s.spReactomeEvent, %s.spVariant, %s.rgdGene2ToUniProt where name='%s' and value=variant and variant = '%s' and spReactomeEvent.spID=parent", 	  PROTEOME_DB_NAME, PROTEOME_DB_NAME, database, geneId, origSpID);	}    ret = sqlQuickNum(conn, query);    }return ret;}
开发者ID:davidhoover,项目名称:kent,代码行数:54,


示例8: ccdsGeneMapSelectByGeneOver

struct ccdsGeneMap *getCcdsGenesForMappedGene(struct sqlConnection *conn, char *acc,                                              char *mapTable)/* get a list of ccds genes associated with a current and window from a * mapping table, or NULL */{struct ccdsGeneMap *ccdsGenes = NULL;if (sqlTableExists(conn, mapTable) && sqlTableExists(conn, "ccdsInfo"))    ccdsGenes = ccdsGeneMapSelectByGeneOver(conn, mapTable, acc, seqName,                                       winStart, winEnd, 0.0);slSort(&ccdsGenes, ccdsGeneMapCcdsIdCmp);return ccdsGenes;}
开发者ID:davidhoover,项目名称:kent,代码行数:12,


示例9: rnaStructureExists

static boolean rnaStructureExists(struct section *section, 	struct sqlConnection *conn, char *geneId)/* Return TRUE if tables exists and have our gene. */{if (sqlTableExists(conn, "foldUtr3") && 	sqlRowExists(conn, "foldUtr3", "name", geneId))    return TRUE;if (sqlTableExists(conn, "foldUtr5") && 	sqlRowExists(conn, "foldUtr5", "name", geneId))    return TRUE;return FALSE;}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:12,


示例10: genomeSetting

static char *findGeneId(struct sqlConnection *conn, char *name)/* Given some sort of gene name, see if it is in our primary gene table, and if not * look it up in alias table if we have one. */{/* Just check if it's in the main gene table, and if so return input name. */char *mainTable = genomeSetting("knownGene");char query[256];sqlSafef(query, sizeof(query), "select count(*) from %s where name = '%s'", mainTable, name);if (sqlQuickNum(conn, query) > 0)    return name;else    {    /* check OMIM gene symbol table first */    if (sqlTableExists(conn, "omimGeneSymbol"))    	{    	sqlSafef(query, sizeof(query), "select geneSymbol from omimGeneSymbol where geneSymbol= '%s'", name);    	char *symbol = sqlQuickString(conn, query);    	if (symbol != NULL)	    {    	    sqlSafef(query, sizeof(query), "select kgId from kgXref where geneSymbol = '%s'", symbol);    	    char *kgId = sqlQuickString(conn, query);	    if (kgId != NULL)	    	{    	    	/* The canonical gene is preferred */	        sqlSafef(query, sizeof(query), 		"select c.transcript from knownCanonical c,knownIsoforms i where i.transcript = '%s' and i.clusterId=c.clusterId", kgId);    	        char *canonicalKgId = sqlQuickString(conn, query);	    	if (canonicalKgId != NULL) 		    {		    return canonicalKgId;		    }		else                    return(kgId);		}	    }	}    }char *alias = genomeOptionalSetting("kgAlias");if (alias != NULL && sqlTableExists(conn, alias))     {     sqlSafef(query, sizeof(query), "select kgID from %s where alias = '%s'", alias, name);     char *id = sqlQuickString(conn, query);     if (id == NULL)         hUserAbort("Couldn't find %s in %s.%s or %s.%s", name, database, mainTable, database, alias);     return id;     }else     hUserAbort("Couldn't find %s in %s.%s", name, database, mainTable);return NULL;}
开发者ID:ucscGenomeBrowser,项目名称:kent,代码行数:51,


示例11: transRegCodeMotifExists

static boolean transRegCodeMotifExists(struct section *section, 	struct sqlConnection *conn, char *geneId)/* Return TRUE if tables exists and have our gene. */{char *gene;if (!sqlTableExists(conn, "transRegCodeMotif"))    return FALSE;if (!sqlTableExists(conn, "sgdToName"))    return FALSE;gene = orfToGene(conn, geneId);if (gene == NULL)    return FALSE;return sqlRowExists(conn, "transRegCodeMotif", "name", gene);}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:14,


示例12: checkForTypeChange

static void checkForTypeChange(struct sqlConnection *conn,                                struct gbSelect* select,                               struct gbStatusTbl* statusTbl)/* Check that new sequences are not already in the seq table.  This handles * the case of a sequence's type changing.  Of course, this  isn't a real * change, but a correction to the genbank record.  Due to the partationing * between mRNAs and EST, this isn't detected normally.  But it's a pain * to find when it happens, as it just results in a tab file load failure. * This shouldn't be called for initialLoad, as it would be very slow and * not accomplish anything since the tables are loaded at the end. */{if (sqlTableExists(conn, SEQ_TBL))    {    int changeCnt = 0;    struct gbStatus* status;    for (status = statusTbl->newList; status != NULL; status = status->next)        {        if (checkForAccTypeChange(conn, select, status))            changeCnt++;        }    if (changeCnt > 0)        errAbort("%d accession types have changed, add incorrect ones to etc/ignore.idx",                 changeCnt);    }}
开发者ID:davidhoover,项目名称:kent,代码行数:26,


示例13: getXrefInfo

static void getXrefInfo(struct sqlConnection *conn,			char **retXrefTable, char **retIdField,			char **retAliasField)/* See if curTrack specifies an xref/alias table for lookup of IDs. */{char *xrefSpec = curTrack ? trackDbSetting(curTrack, "idXref") : NULL;char *xrefTable = NULL, *idField = NULL, *aliasField = NULL;if (xrefSpec != NULL)    {    char *words[3];    chopLine(cloneString(xrefSpec), words);    if (isEmpty(words[2]))	errAbort("trackDb error: track %s, setting idXref must be followed "		 "by three words (xrefTable, idField, aliasField).",		 curTrack->track);    xrefTable = words[0];    idField = words[1];    aliasField = words[2];    if (!sqlTableExists(conn, xrefTable) ||	sqlFieldIndex(conn, xrefTable, idField) < 0 ||	sqlFieldIndex(conn, xrefTable, aliasField) < 0)	xrefTable = idField = aliasField = NULL;    }if (retXrefTable != NULL)    *retXrefTable = xrefTable;if (retIdField != NULL)    *retIdField = idField;if (retAliasField != NULL)    *retAliasField = aliasField;}
开发者ID:maximilianh,项目名称:kent,代码行数:30,


示例14: chainDbAddBlocks

void chainDbAddBlocks(struct chain *chain, char *track, struct sqlConnection *conn)/* Add blocks to chain header. */{struct dyString *query = newDyString(1024);struct sqlResult *sr = NULL;char **row;struct cBlock *b;char fullName[64];safef(fullName, sizeof(fullName), "%s_%s", chain->tName, track);if (!sqlTableExists(conn, fullName))    strcpy(fullName, track);sqlDyStringPrintf(query, 	"select tStart,tEnd,qStart from %sLink where chainId = %d",fullName, chain->id);sr = sqlGetResult(conn, query->string);while ((row = sqlNextRow(sr)) != NULL)    {    AllocVar(b);    b->tStart = sqlUnsigned(row[0]);    b->tEnd = sqlUnsigned(row[1]);    b->qStart = sqlUnsigned(row[2]);    b->qEnd = b->qStart + (b->tEnd - b->tStart);    slAddHead(&chain->blockList, b);    }slReverse(&chain->blockList);sqlFreeResult(&sr);dyStringFree(&query);}
开发者ID:bowhan,项目名称:kent,代码行数:29,


示例15: localizationExists

static boolean localizationExists(struct section *section,	struct sqlConnection *conn, char *geneId)/* Return TRUE if localization and existance tables exist and have something * on this one. */{char query[256];/* mitopred - prediction of nuclear-encoded mitochondrial proteins */if (swissProtAcc != NULL && sqlTableExists(conn, "mitopred"))    {    sqlSafef(query, sizeof(query),	  "select count(*) from mitopred where name = '%s' or name = '%s'",	  swissProtAcc, spAnyAccToId(spConn, swissProtAcc));    if (sqlQuickNum(conn, query) > 0)	return TRUE;    }/* SGD (Sacchromyces Genome Database) localization & abundance data */if (sqlTablesExist(conn, "sgdLocalization sgdAbundance"))    {    sqlSafef(query, sizeof(query),	  "select count(*) from sgdLocalization where name = '%s'", geneId);    if (sqlQuickNum(conn, query) > 0)	return TRUE;    sqlSafef(query, sizeof(query),	  "select count(*) from sgdAbundance where name = '%s'", geneId);    if (sqlQuickNum(conn, query) > 0)	return TRUE;    }return FALSE;}
开发者ID:davidhoover,项目名称:kent,代码行数:29,


示例16: getSignalAt

static double getSignalAt(char *table, struct bed *cluster)/* Get (average) signal from table entries that overlap cluster */{struct sqlConnection *conn = hAllocConn(database);int count = 0;double sum = 0;if (sqlTableExists(conn, table))  // Table might be withdrawn from data thrash    {    int rowOffset;    struct sqlResult *sr = hRangeQuery(conn, table, cluster->chrom, cluster->chromStart, 	    cluster->chromEnd, NULL, &rowOffset);    int signalCol = sqlFieldColumn(sr, "signalValue");    if (signalCol < 0)	internalErr();    char **row;    while ((row = sqlNextRow(sr)) != NULL)	{	count += 1;	sum += sqlDouble(row[signalCol]);	}    sqlFreeResult(&sr);    }hFreeConn(&conn);if (count > 0)    return sum/count;else    return 0;}
开发者ID:ucscGenomeBrowser,项目名称:kent,代码行数:28,


示例17: chimeraxGen

static void chimeraxGen(struct sqlConnection *conn,                        char *pdbId, char *where,                        char *primarySnpId,                        char *outName)/* Generate a chimerax file for the given PDB, optionally coloring * primarySnpId differently.  The where arguments specifies which entries to * obtain from the lsSnpPdb table. */{FILE *xfh = chimeraxBegin(outName);fprintf(xfh, "/ndisplayPdb(/"%s/", (", pdbId);struct lsSnpPdb *pdbSnp, *pdbSnps = NULL;if (sqlTableExists(conn, "lsSnpPdb"))    pdbSnps = sqlQueryObjs(conn, (sqlLoadFunc)lsSnpPdbLoad, sqlQueryMulti,                           "SELECT * FROM lsSnpPdb WHERE %-s", where);for (pdbSnp = pdbSnps; pdbSnp != NULL; pdbSnp = pdbSnp->next)    prSnp(xfh, pdbSnp, primarySnpId);lsSnpPdbFreeList(&pdbSnps);fprintf(xfh, "))/n");chimeraxEnd(&xfh);}
开发者ID:elmargb,项目名称:kentUtils,代码行数:25,


示例18: rollupPsl

static void rollupPsl(char *pslName, char *table, struct sqlConnection *conn, char *db){char cmd[256];char dbTbl[256];if (fileSize(pslName)==0)    return;safef(dbTbl,sizeof(dbTbl),"%s.%s",db,table);if (!sqlTableExists(conn, dbTbl))    {    verbose(1,"FYI: Table %s does not exist/n",dbTbl);    safef(cmd,sizeof(cmd),"rm -f %s.psl; touch %s.psl",table,table); /* make empty file */    verbose(1,"%s/n",cmd); system(cmd);    }else    {    dumpPslTable(conn, db, table);    }safef(cmd,sizeof(cmd),"cat %s %s.psl | sort -u | sort -k 10,10 > %sNew.psl", pslName, table, table);verbose(1,"%s/n",cmd); system(cmd);safef(cmd,sizeof(cmd),"hgLoadPsl %s %sNew.psl -table=%s",db,table,table);verbose(1,"%s/n",cmd); system(cmd);safef(cmd,sizeof(cmd),"rm %s %s.psl %sNew.psl",pslName,table,table);verbose(1,"%s/n",cmd); //system(cmd);}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:31,


示例19: hAllocConn

struct genoGraph *getCompGraphs(struct sqlConnection *conn)/* Get graphs defined in database that are part of a composite. */{struct genoGraph *list = NULL, *gg;struct sqlConnection *conn2 = hAllocConn(database);struct slName *compositeGGList = NULL, *comp;/* Get initial information from metaChromGraph table */if (sqlTableExists(conn, "metaChromGraph"))    compositeGGList = sqlQuickList(conn, "select name from metaChromGraph where binaryFile='composite'");/* Build a hash of genoGraphs out of composite trackDbs and fill in from cart. */for (comp = compositeGGList; comp != NULL; comp = comp->next)    {    struct trackDb *tdb = hTrackDbForTrack(database, comp->name);    if (tdb)	{	struct chromGraphSettings *cgs = chromGraphSettingsGet(comp->name, conn2, tdb, cart);	AllocVar(gg);	gg->name = cloneString(comp->name);	gg->shortLabel = tdb->shortLabel;	gg->longLabel = tdb->longLabel;	gg->settings = cgs;	gg->isSubGraph = FALSE;	gg->isComposite = TRUE;	slAddHead(&list, gg);	}    }hFreeConn(&conn2);slReverse(&list);return list;}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:33,


示例20: pubsParseClassColors

static void pubsParseClassColors() /* parse class colors from hgFixed.pubsClassColors into the hash pubsClassColors */{if (pubsClassColors!=NULL)    return;pubsClassColors = hashNew(0);struct sqlConnection *conn = hAllocConn("hgFixed");if (!sqlTableExists(conn, "pubsClassColors"))     {    return;    }char *query = "NOSQLINJ SELECT class, rgbColor FROM pubsClassColors";struct sqlResult *sr = sqlGetResult(conn, query);char **row = NULL;while ((row = sqlNextRow(sr)) != NULL)    {    char *class = row[0];    char *colStr = row[1];    // copied from genePredItemClassColor - is there no function for this?    // convert comma sep rgb string to array    char *rgbVals[5];    chopString(colStr, ",", rgbVals, sizeof(rgbVals));    struct rgbColor *rgb;    AllocVar(rgb);    rgb->r = (sqlUnsigned(rgbVals[0]));    rgb->g = (sqlUnsigned(rgbVals[1]));    rgb->b = (sqlUnsigned(rgbVals[2]));    //printf("Adding hash: %s -> %d,%d,%d", class, rgb->r, rgb->g, rgb->b);    hashAdd(pubsClassColors, cloneString(class), rgb);    }sqlFreeResult(&sr);}
开发者ID:maximilianh,项目名称:kent,代码行数:33,


示例21: setupTable

void setupTable(struct sqlConnection *conn) /* Set up the autoTest table for testing. Call dropTable() later to remove table. */{struct lineFile *lf = lineFileOpen("output/newTest.sql", TRUE);char *update = NULL;char *line = NULL;struct dyString *ds = newDyString(256);if(sqlTableExists(conn, testTableName))    errAbort("dbLinkTest.c::setupTable() - Table %s.%s already exists. Can't create another.",             sqlGetDatabase(conn), testTableName);while(lineFileNextReal(lf, &line))     {    char *tmp = strstr(line, "not null");    if(tmp != NULL)	{	*tmp = ',';	tmp++;	*tmp = '/0';	}    subChar(line, '/t', ' ');    dyStringPrintf(ds, "%s", line);    }update = replaceChars(ds->string, "PRIMARY KEY", "UNIQUE");sqlUpdate(conn, update);freez(&update);dyStringFree(&ds);lineFileClose(&lf);}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:29,


示例22: refSeqPepClean

static void refSeqPepClean(struct sqlConnection *conn)/* Delete all refseq peptides that are in gbSeq but no longer * referenced by refLink.  */{char query[1024];struct sqlResult* sr;char **row;struct sqlDeleter* deleter;/* don't do anything if we don't have the refLink table.  This can * happen if refSeq was enabled after the initial load */if (!sqlTableExists(conn, "refLink"))    return;deleter = sqlDeleterNew(gTmpDir, (gbVerbose >= 4));/* Use a join to get list of acc, which proved reasonable fastly because * the the list is small */sqlSafef(query, sizeof(query), "SELECT acc FROM gbSeq LEFT JOIN refLink ON (refLink.protAcc = gbSeq.acc) "      "WHERE (acc LIKE 'NP_%%') AND (refLink.protAcc IS NULL)");sr = sqlGetResult(conn, query);while ((row = sqlNextRow(sr)) != NULL)    sqlDeleterAddAcc(deleter, row[0]);sqlFreeResult(&sr);sqlDeleterDel(deleter, conn, SEQ_TBL, "acc");sqlDeleterFree(&deleter);}
开发者ID:ucsc-mus-strain-cactus,项目名称:kent,代码行数:28,


示例23: loadOneTable

void loadOneTable(char *database, struct sqlConnection *conn, char *tempName, char *tableName)/* Load .tab file tempName into tableName and remove tempName. */{struct dyString *query = newDyString(1024);verbose(1, "Loading up table %s/n", tableName);if (sqlTableExists(conn, tableName))    {    sqlDyStringPrintf(query, "DROP table %s", tableName);    sqlUpdate(conn, query->string);    }/* Create first part of table definitions, the fields. */dyStringClear(query);sqlDyStringPrintf(query, createRmskOut, tableName);/* Create the indexes */int indexLen = hGetMinIndexLength(database);sqlDyStringPrintf(query, "   INDEX(genoName(%d),bin))/n", indexLen);sqlUpdate(conn, query->string);/* Load database from tab-file. */dyStringClear(query);sqlDyStringPrintf(query, "LOAD data local infile '%s' into table %s",	       tempName, tableName);sqlUpdate(conn, query->string);remove(tempName);}
开发者ID:davidhoover,项目名称:kent,代码行数:29,


示例24: safef

struct slName *getTablesForField(struct sqlConnection *conn,                                 char *splitPrefix, char *table, char *splitSuffix)/* Get tables that match field. */{    struct slName *list = NULL, *el;    if (splitPrefix != NULL || splitSuffix != NULL)    {        char query[256], **row;        struct sqlResult *sr;        safef(query, sizeof(query), "show tables like '%s%s%s'",              emptyForNull(splitPrefix), table, emptyForNull(splitSuffix));        sr = sqlGetResult(conn, query);        while ((row = sqlNextRow(sr)) != NULL)        {            el = slNameNew(row[0]);            slAddHead(&list, el);        }        sqlFreeResult(&sr);        slReverse(&list);    }    if (list == NULL)    {        if (sqlTableExists(conn, table))            list = slNameNew(table);    }    return list;}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:27,


示例25: geneReviewsExists

static boolean geneReviewsExists(struct section *section,        struct sqlConnection *conn, char *geneId)/* Return TRUE if geneReviewsDetail table exist and have GeneReviews articles * on this one. */{char query[256];char * geneSymbol;char * grSymbol;if (sqlTableExists(conn, "geneReviewsDetail"))    {       sqlSafef(query, sizeof(query), "select geneSymbol from kgXref where kgId = '%s'", geneId);       geneSymbol = sqlQuickString(conn, query);       if (geneSymbol != NULL)          {             sqlSafef(query, sizeof(query), "select  geneSymbol from geneReviewsDetail where geneSymbol='%s'", geneSymbol);             grSymbol = sqlQuickString(conn, query);             if (grSymbol != NULL)                {                  return TRUE;                }           }     }return FALSE;}
开发者ID:ucscGenomeBrowser,项目名称:kent,代码行数:25,


示例26: hubConnectTableExists

boolean hubConnectTableExists()/* Return TRUE if the hubStatus table exists. */{struct sqlConnection *conn = hConnectCentral();boolean exists = sqlTableExists(conn, getHubStatusTableName());hDisconnectCentral(&conn);return exists;}
开发者ID:davidhoover,项目名称:kent,代码行数:8,


示例27: checkOneDependency

void checkOneDependency(struct joiner *joiner,                        struct joinerDependency *dep, struct sqlConnection *conn, char *dbName)/* Check out one dependency in one database. */{    char *tableToCheck = dep->table->table;    if (sqlWildcardIn(tableToCheck))    {        errAbort("Can't handle wildCards in dependency tables line %d of %s",                 dep->lineIx, joiner->fileName);    }    if (slNameInList(dep->table->dbList, dbName)            && sqlTableExists(conn, tableToCheck))    {        time_t tableTime = sqlTableUpdateTime(conn, tableToCheck);        struct joinerTable *dependsOn;        for (dependsOn = dep->dependsOnList; dependsOn != NULL;                dependsOn = dependsOn->next)        {            if (slNameInList(dependsOn->dbList, dbName))            {                if (!sqlTableExists(conn, dependsOn->table))                {                    warn("Error: %s.%s doesn't exist line %d of %s",                         dbName, dependsOn->table,                         dep->lineIx, joiner->fileName);                }                else                {                    time_t depTime = sqlTableUpdateTime(conn, dependsOn->table);                    if (depTime > tableTime)                    {                        char *depStr = sqlUnixTimeToDate(&depTime, FALSE);                        char *tableStr = sqlUnixTimeToDate(&tableTime, FALSE);                        warn("Error: %s.%s updated after %s.%s line %d of %s",                             dbName, dependsOn->table, dbName, tableToCheck,                             dep->lineIx, joiner->fileName);                        warn("/t%s vs. %s", depStr, tableStr);                        freeMem(depStr);                        freeMem(tableStr);                    }                }            }        }    }}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:46,


示例28: altSpliceExists

static boolean altSpliceExists(struct section *section,        struct sqlConnection *conn, char *geneId)/* Return TRUE if altSplice table exists and has something * on this one. */{char *mark = NULL;if (!sqlTableExists(conn, "altGraphX") || !sqlTableExists(conn, "agxBed"))    return FALSE;section->items = altGraphId(conn, curGenePred);/* each graph can have different connected components, if there   is a component take the prefix for matching back to the graph.   i.e. cut of an '-1' or '-2' */if (section->items != NULL)    if ((mark = strrchr((char *)section->items, '-')) != NULL)        *mark = '/0';return section->items != NULL;}
开发者ID:bowhan,项目名称:kent,代码行数:17,


示例29: makeTableDescriptions

void makeTableDescriptions(char *database, char *asFile)/* makeTableDescriptions - Add table descriptions to database.. */{struct sqlConnection *conn = sqlConnect(database);struct lineFile *lf = lineFileOpen(asFile, TRUE);FILE *f = hgCreateTabFile(".", "tableDescriptions");/* Open a tab file with name corresponding to tableName in tmpDir. */char *line;/* struct asObject *asList = */ asParseFile(asFile);	/* Just to check syntax */if (sqlTableExists(conn, "chromInfo"))    errAbort("%s looks like a genome database, has chromInfo, aborting",     	database);sqlRemakeTable(conn, "tableDescriptions",   "NOSQLINJ CREATE TABLE tableDescriptions (/n"   "  tableName varchar(255) not null,/n"   "  autoSqlDef longblob not null,/n"   "  gbdAnchor varchar(255) not null,/n"   "  PRIMARY KEY(tableName(32))/n"   ")" );while (lineFileNextReal(lf, &line))    {    if (startsWith("table", line))        {	struct dyString *as = dyStringNew(0);	char *name = trimSpaces(line + 6);	/* Skip over table. */	char *escaped = NULL;	fprintf(f, "%s/t", name);	/* Putting lines into as. */	for (;;)	    {	    char *s;	    dyStringAppend(as, line);	    dyStringAppendC(as, '/n');	    s = skipLeadingSpaces(line);	    if (s[0] == ')')	        break;	    if (!lineFileNext(lf, &line, NULL))	        errAbort("Unexpected end of file, missing closing paren in %s",			lf->fileName);	    }	escaped = needMem(2*as->stringSize+1);	fprintf(f, "%s/t", sqlEscapeTabFileString2(escaped, as->string));	fprintf(f, "/n");	freez(&escaped);	dyStringFree(&as);	}    else        errAbort("Expecting table line %d of %s", lf->lineIx, lf->fileName);    }hgLoadTabFile(conn, ".", "tableDescriptions", &f);}
开发者ID:blumroy,项目名称:kentUtils,代码行数:58,


示例30: ccdsInfoSelectByMrna

static struct ccdsInfo *getCcdsInfoForSrcDb(struct sqlConnection *conn, char *acc)/* Get a ccdsInfo object for a RefSeq, ensembl, or vega gene, if it * exists, otherwise return NULL */{if (sqlTableExists(conn, "ccdsInfo"))    return ccdsInfoSelectByMrna(conn, acc);else    return NULL;}
开发者ID:davidhoover,项目名称:kent,代码行数:9,



注:本文中的sqlTableExists函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sqlUnsigned函数代码示例
C++ sqlStringComma函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。