public long writeString(String val) throws SQLException {
		if ((val == null) || (val.length() == 0)) {
			return 0;
		}
		StringRecord rec = stringMap.get(val);
		if (rec != null) {
			moveToEnd(rec);
			return rec.id;
		}
		// String is not in cache
		long id = readStringId(val);	// Try to read from database
		if (id != 0) {
			return id;
		}
		return writeNewString(val);		// Otherwise add the string to the table
	}
Try to fetch string from our memory cache, or load it from database, or return empty string

@param id the row ID
@return the string fetched from the table, or empty string if not found
@throws SQLException if there is a problem parsing the table record(s)
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/tables/SQLStringTable.java